Fix more merge regressions, update code to use updated UserLoginInfo setting

meow-7.2.2
Cinders 2013-08-29 15:09:26 -06:00
parent c121977038
commit e50e4b330d
4 changed files with 64 additions and 53 deletions

View File

@ -177,8 +177,6 @@
<string>UserLogFile</string>
</map>
<!-- FS:AW FIRE-6721 (merge regression: command line -login not working) -->
<!--
<key>login</key>
<map>
<key>desc</key>
@ -188,17 +186,6 @@
<key>map-to</key>
<string>UserLoginInfo</string>
</map>
-->
<key>login</key>
<map>
<key>desc</key>
<string>3 tokens: first, last and password</string>
<key>count</key>
<integer>3</integer>
<key>map-to</key>
<string>UserLoginInfo1</string>
</map>
<!-- /FS:AW FIRE-6721 -->
<key>loginpage</key>
<map>
@ -210,20 +197,6 @@
<string>LoginPage</string>
</map>
<!-- FS:AW fix commandline loginuri (partial fix of FIRE-3448)-->
<!-- <key>loginuri</key>
<map>
<key>desc</key>
<string>login server and CGI script to use</string>
<key>count</key>
<integer>1</integer>
<key>compose</key>
<boolean>true</boolean>
<key>map-to</key>
<string>CmdLineLoginURI</string>
</map>
-->
<key>loginuri</key>
<map>
<key>desc</key>
@ -231,9 +204,9 @@
<key>count</key>
<integer>1</integer>
<key>map-to</key>
<string>CmdLineLoginURI1</string>
<string>CmdLineLoginURI</string>
</map>
<!-- /FS:AW fix commandline loginuri (partial fix of FIRE-3448)-->
<key>logmetrics</key>
<map>
<key>desc</key>
@ -464,15 +437,6 @@
<integer>1</integer>
<!-- Special case. Mapped to settings procedurally. -->
</map>
<!-- FS:CR - Workaround for Xcode IDE adding its own arguement >
<key>NSDocumentRevisionsDebugMode</key>
<map>
<key>desc</key>
<string>Does nothing... Workaround for command like arguement Xcode passes when running from the IDE</string>
<key />
</map>
<! FS:CR - Workaround for Xcode IDE adding its own arguement >
<! FS:Ansariel - Option to not auto-save passwords when using login option >
<key>logindontsavepassword</key>
@ -482,5 +446,6 @@
<! Special case. Mapped to settings procedurally. >
</map>
<! FS:Ansariel - Option to not auto-save passwords when using login option -->
</map>
</llsd>

View File

@ -164,7 +164,12 @@ LLPointer<LLCredential> LLLoginHandler::initializeLoginInfo()
{
LLPointer<LLCredential> result = NULL;
// so try to load it from the UserLoginInfo
result = loadSavedUserLoginInfo();
result = loadSavedUserLoginInfo();
// <FS:CR>
//if (result.isNull())
//{
// result = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());
//}
return result;
}
@ -174,7 +179,7 @@ LLPointer<LLCredential> LLLoginHandler::loadSavedUserLoginInfo()
{
// load the saved user login info into a LLCredential.
// perhaps this should be moved.
LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo1");
LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
if (cmd_line_login.size() == 3)
{
@ -192,8 +197,8 @@ LLPointer<LLCredential> LLLoginHandler::loadSavedUserLoginInfo()
authenticator["secret"] = md5pass;
// yuck, we'll fix this with mani's changes.
gSavedSettings.setBOOL("AutoLogin", TRUE);
return gSecAPIHandler->createCredential(identifier["first_name"].asString()+" "+identifier["last_name"].asString()+"@"+LLGridManager::getInstance()->getGrid(),
identifier, authenticator);
return gSecAPIHandler->createCredential(identifier["first_name"].asString() + " " + identifier["last_name"].asString() + "@" +LLGridManager::getInstance()->getGrid(),
identifier, authenticator);
}
return NULL;
}

View File

@ -84,6 +84,12 @@ const S32 MAX_PASSWORD = 16;
LLPanelLogin *LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
// <FS:CR> We still use this in firestorm...
// Helper for converting a user name into the canonical "Firstname Lastname" form.
// For new accounts without a last name "Resident" is added as a last name.
static std::string canonicalize_username(const std::string& name);
// </FS:CR>
class LLLoginRefreshHandler : public LLCommandHandler
{
public:
@ -325,6 +331,11 @@ void LLPanelLogin::addFavoritesToStartLocation()
// Load favorites into the combo.
std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
// <FS:CR> FIRE-10122 - User@grid stored_favorites.xml
//std::string canonical_user_name = canonicalize_username(user_defined_name);
std::string current_grid = getChild<LLComboBox>("server_combo")->getSimple();
std::string current_user = canonicalize_username(user_defined_name) + " @ " + current_grid;
// </FS:CR>
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
@ -338,10 +349,8 @@ void LLPanelLogin::addFavoritesToStartLocation()
// a single word account name, so it can be compared case-insensitive with the
// user defined "firstname lastname".
// <FS:CR> FIRE-10122 - User@grid stored_favorites.xml
//S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first); <FS:TM> 3.6.4 check this new
//S32 res = LLStringUtil::compareInsensitive(canonical_user_name, iter->first); <TM> LL old
//S32 res = LLStringUtil::compareInsensitive(current_user, iter->first); <TM> FS
S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first);
//S32 res = LLStringUtil::compareInsensitive(canonical_user_name, iter->first);
S32 res = LLStringUtil::compareInsensitive(current_user, iter->first);
// </FS:CR>
if (res != 0)
{
@ -579,12 +588,12 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential)
// 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"));
sInstance->getChild<LLUICtrl>("password_edit")->setValue(filler);
remember = true; // <FS:CR>
}
else
{
sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());
sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());
remember = false; // <FS:CR>
}
sInstance->getChild<LLUICtrl>("remember_check")->setValue(remember);
@ -1149,8 +1158,40 @@ void LLPanelLogin::onLocationSLURL()
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above
}
/////////////////////////////
// Firestorm functions //
/////////////////////////////
std::string canonicalize_username(const std::string& name)
{
std::string cname = name;
// <FS:CR> Strip off any grid appendage
U32 arobase = cname.find("@");
if(arobase > 0)
cname = cname.substr(0, arobase - 1);
// </FS:CR>
// determine if the username is a first/last form or not.
size_t separator_index = cname.find_first_of(" ._");
std::string first = cname.substr(0, separator_index);
std::string last;
if (separator_index != cname.npos)
{
last = cname.substr(separator_index + 1, cname.npos);
LLStringUtil::trim(last);
}
else
{
// ...on Linden grids, single username users as considered to have
// last name "Resident"
last = "Resident";
}
// Username in traditional "firstname lastname" form.
return first + ' ' + last;
}
// <FS:CR>
void LLPanelLogin::addUsersToCombo(BOOL show_server)
{
LLComboBox* combo = getChild<LLComboBox>("username_combo");
@ -1160,7 +1201,7 @@ void LLPanelLogin::addUsersToCombo(BOOL show_server)
std::string current_creds=credentialName();
if(current_creds.find("@") < 1)
{
current_creds = gSavedSettings.getString("UserLoginInfo");
current_creds = gSavedSettings.getLLSD("UserLoginInfo").asString();
}
std::vector<std::string> logins = gSecAPIHandler->listCredentials();
@ -1224,7 +1265,7 @@ void LLPanelLogin::onClickRemove(void*)
{
LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo");
std::string credName = combo->getValue().asString();
if ( credName == gSavedSettings.getString("UserLoginInfo") )
if ( credName == gSavedSettings.getLLSD("UserLoginInfo").asString() )
gSavedSettings.getControl("UserLoginInfo")->resetToDefault();
LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(credName);
gSecAPIHandler->deleteCredential(credential);
@ -1382,4 +1423,4 @@ void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& n
break;
}
}
// </FS:CR>
// </FS:CR>

View File

@ -955,7 +955,7 @@ bool idle_startup()
{
LL_DEBUGS("AppInit") << "loading credentials from gLoginHandler" << LL_ENDL;
display_startup();
gUserCredential = gSecAPIHandler->loadCredential(gSavedSettings.getString("UserLoginInfo"));
gUserCredential = gSecAPIHandler->loadCredential(gSavedSettings.getLLSD("UserLoginInfo").asString());
display_startup();
}
// Make sure the process dialog doesn't hide things