Version blocking done right

Wed, 20 Apr 2016 14:50:21 +0200

author
Ansariel
date
Wed, 20 Apr 2016 14:50:21 +0200
changeset 48968
0eebda356b84
parent 48967
a3e2de1438f1
child 48969
782b5ac64396

Version blocking done right

indra/newview/fspanellogin.cpp file | annotate | diff | revisions
indra/newview/llstartup.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/fspanellogin.cpp	Fri May 13 18:33:22 2016 +0200
     1.2 +++ b/indra/newview/fspanellogin.cpp	Wed Apr 20 14:50:21 2016 +0200
     1.3 @@ -943,52 +943,44 @@
     1.4  		std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
     1.5  		gSavedSettings.setString("UserLoginInfo", credentialName());
     1.6  
     1.7 -		LLSD blocked = FSData::instance().allowedLogin();
     1.8 -		if (!blocked.isMap()) //hack for testing for an empty LLSD
     1.9 +		if(username.empty())
    1.10  		{
    1.11 -			if(username.empty())
    1.12 -			{
    1.13 -				// user must type in something into the username field
    1.14 -				LLNotificationsUtil::add("MustHaveAccountToLogIn");
    1.15 -			}
    1.16 -			else if(password.empty())
    1.17 -			{
    1.18 -				LLNotificationsUtil::add("MustEnterPasswordToLogIn");
    1.19 -			}
    1.20 -			else
    1.21 -			{
    1.22 -				LLPointer<LLCredential> cred;
    1.23 -				BOOL remember;
    1.24 -				getFields(cred, remember);
    1.25 -				std::string identifier_type;
    1.26 -				cred->identifierType(identifier_type);
    1.27 -				LLSD allowed_credential_types;
    1.28 -				LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
    1.29 -			
    1.30 -				// check the typed in credential type against the credential types expected by the server.
    1.31 -				for(LLSD::array_iterator i = allowed_credential_types.beginArray();
    1.32 -					i != allowed_credential_types.endArray();
    1.33 -					i++)
    1.34 -				{
    1.35 -				
    1.36 -					if(i->asString() == identifier_type)
    1.37 -					{
    1.38 -						// yay correct credential type
    1.39 -						sInstance->mCallback(0, sInstance->mCallbackData);
    1.40 -						return;
    1.41 -					}
    1.42 -				}
    1.43 -			
    1.44 -				// Right now, maingrid is the only thing that is picky about
    1.45 -				// credential format, as it doesn't yet allow account (single username)
    1.46 -				// format creds.  - Rox.  James, we wanna fix the message when we change
    1.47 -				// this.
    1.48 -				LLNotificationsUtil::add("InvalidCredentialFormat");
    1.49 -			}
    1.50 +			// user must type in something into the username field
    1.51 +			LLNotificationsUtil::add("MustHaveAccountToLogIn");
    1.52 +		}
    1.53 +		else if(password.empty())
    1.54 +		{
    1.55 +			LLNotificationsUtil::add("MustEnterPasswordToLogIn");
    1.56  		}
    1.57  		else
    1.58  		{
    1.59 -			LLNotificationsUtil::add("BlockLoginInfo", blocked);
    1.60 +			LLPointer<LLCredential> cred;
    1.61 +			BOOL remember;
    1.62 +			getFields(cred, remember);
    1.63 +			std::string identifier_type;
    1.64 +			cred->identifierType(identifier_type);
    1.65 +			LLSD allowed_credential_types;
    1.66 +			LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
    1.67 +			
    1.68 +			// check the typed in credential type against the credential types expected by the server.
    1.69 +			for(LLSD::array_iterator i = allowed_credential_types.beginArray();
    1.70 +				i != allowed_credential_types.endArray();
    1.71 +				i++)
    1.72 +			{
    1.73 +				
    1.74 +				if(i->asString() == identifier_type)
    1.75 +				{
    1.76 +					// yay correct credential type
    1.77 +					sInstance->mCallback(0, sInstance->mCallbackData);
    1.78 +					return;
    1.79 +				}
    1.80 +			}
    1.81 +			
    1.82 +			// Right now, maingrid is the only thing that is picky about
    1.83 +			// credential format, as it doesn't yet allow account (single username)
    1.84 +			// format creds.  - Rox.  James, we wanna fix the message when we change
    1.85 +			// this.
    1.86 +			LLNotificationsUtil::add("InvalidCredentialFormat");
    1.87  		}
    1.88  	}
    1.89  }
     2.1 --- a/indra/newview/llstartup.cpp	Fri May 13 18:33:22 2016 +0200
     2.2 +++ b/indra/newview/llstartup.cpp	Wed Apr 20 14:50:21 2016 +0200
     2.3 @@ -1185,6 +1185,17 @@
     2.4  
     2.5  	if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
     2.6  	{
     2.7 +		// <FS:Ansariel> Login block
     2.8 +		LLSD blocked = FSData::instance().allowedLogin();
     2.9 +		if (blocked.isMap()) //hack for testing for an empty LLSD
    2.10 +		{
    2.11 +			LLNotificationsUtil::add("BlockLoginInfo", blocked, LLSD(), login_alert_done);
    2.12 +			LLStartUp::setStartupState(STATE_LOGIN_CONFIRM_NOTIFICATON);
    2.13 +			show_connect_box = true;
    2.14 +			return FALSE;
    2.15 +		}
    2.16 +		// </FS:Ansariel>
    2.17 +
    2.18  		// Post login screen, we should see if any settings have changed that may
    2.19  		// require us to either start/stop or change the socks proxy. As various communications
    2.20  		// past this point may require the proxy to be up.

mercurial