Example #1
0
// static
void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
{
	// *NOTE: The paramters for this method are ignored. 
	// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
	// calls this method.
	LL_INFOS("AppInit") << "onSelectServer" << LL_ENDL;
	// The user twiddled with the grid choice ui.
	// apply the selection to the grid setting.
	LLPointer<LLCredential> credential;
	
	LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
	LLSD combo_val = combo->getSelectedValue();
	if (combo_val.isUndefined())
	{
		combo_val = combo->getValue();
	}
	
	combo = sInstance->getChild<LLComboBox>("start_location_combo");	
	combo->setCurrentByIndex(1);
	LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation")));
	LLGridManager::getInstance()->setGridChoice(combo_val.asString());
	// This new selection will override preset uris
	// from the command line.
	updateServer();
	updateLocationCombo(false);
	updateLoginPanelLinks();
}
Example #2
0
// static
void LLPanelLogin::setFields(LLPointer<LLCredential> credential)
{
	if (!sInstance)
	{
		llwarns << "Attempted fillFields with no login view shown" << llendl;
		return;
	}

	
	LL_INFOS("Credentials") << "Setting login fields to " << *credential << LL_ENDL;

	LLSD identifier = credential->getIdentifier();
	if((std::string)identifier["type"] == "agent") 
	{
		std::string firstname = identifier["first_name"].asString();
		std::string lastname = identifier["last_name"].asString();
	    std::string login_id = firstname;
	    if (!lastname.empty() && lastname != "Resident")
	    {
		    // support traditional First Last name SLURLs
		    login_id += " ";
		    login_id += lastname;
	    }
	}
	std::string credName = credential->getCredentialName();
	sInstance->getChild<LLComboBox>("username_combo")->selectByValue(credName);
	


// <FS:AW FIRE-6492 Firestorm doesn't always honor the start location option>
/*	if(identifier.has("startlocation")){
		llinfos << "Settings startlocation to: " << identifier["startlocation"].asString() << llendl;
		LLStartUp::setStartSLURL(LLSLURL(identifier["startlocation"].asString()));
		updateLocationCombo(false);
	}
*/
// </FS:AW FIRE-6492 Firestorm doesn't always honor the start location option>
	sInstance->addFavoritesToStartLocation();
	// if the password exists in the credential, set the password field with
	// a filler to get some stars
	LLSD authenticator = credential->getAuthenticator();
	LL_INFOS("Credentials") << "Setting authenticator field " << authenticator["type"].asString() << LL_ENDL;
	bool remember;
	if(authenticator.isMap() && 
	   authenticator.has("secret") && 
	   (authenticator["secret"].asString().size() > 0))
	{
		
		// This is a MD5 hex digest of a password.
		// We don't actually use the password input field, 
		// fill it with MAX_PASSWORD characters so we get a 
		// nice row of asterixes.
		const std::string filler("123456789!123456");
		sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string("123456789!123456"));
		remember=true;
	}
	else
	{
		sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());	
		remember=false;
	}
	sInstance->getChild<LLUICtrl>("remember_check")->setValue(remember);


		U32 arobase = credName.find("@");
	if (arobase != -1 && arobase +1 < credName.length())
		credName = credName.substr(arobase+1, credName.length() - arobase - 1);
// <SA: opensim>
	if(LLGridManager::getInstance()->getGrid() == credName)
	{
		return;
	}

	try
	{
		LLGridManager::getInstance()->setGridChoice(credName);
	}
	catch (LLInvalidGridName ex)
	{
		// do nothing
	}
// </SA: opensim>
	//updateServerCombo();	
	// grid changed so show new splash screen (possibly)
	updateServer();
	updateLoginPanelLinks();
	sInstance->addFavoritesToStartLocation();
	
}
Example #3
0
// static
void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
{
	// *NOTE: The paramters for this method are ignored. 
	// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
	// calls this method.

	// The user twiddled with the grid choice ui.
	// apply the selection to the grid setting.
//	LLPointer<LLCredential> credential; <- SA: is this ever used?
	
	LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
	LLSD combo_val = combo->getSelectedValue();
	if (combo_val.isUndefined())
	{
		combo_val = combo->getValue();
	}


// <AW: opensim>
	std::string new_combo_value = combo_val.asString();
	if (!new_combo_value.empty())
	{
		std::string match = "://";
		size_t found = new_combo_value.find(match);
		if (found != std::string::npos)	
			new_combo_value.erase( 0,found+match.length());
	}

	// e.g user clicked into loginpage
	if(LLGridManager::getInstance()->getGrid() == new_combo_value)
	{
		return;
	}

	try
	{
		LLGridManager::getInstance()->setGridChoice(new_combo_value);
	}
	catch (LLInvalidGridName ex)
	{
		// do nothing
	}
// </AW: opensim>
	//Clear the PW for security reasons, if the Grid changed manually.
	sInstance->getChild<LLLineEditor>("password_edit")->clear();

	LL_INFOS("AppInit") << "onSelectServer " << new_combo_value << LL_ENDL;

	
	combo = sInstance->getChild<LLComboBox>("start_location_combo");	
//	combo->setCurrentByIndex(1);  <- SA: Why???

	
	LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation")));



	// This new selection will override preset uris
	// from the command line.
	updateServer();
	updateLoginPanelLinks();
}