summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2009-11-07 12:49:07 -0500
committerNat Goodspeed <nat@lindenlab.com>2009-11-07 12:49:07 -0500
commit12f038b599bf1f5e0779ac23d08d57c17e07383e (patch)
tree7b7b791dcb002d59c4c8fbb57fc1a9eaa2dd1a0b /indra
parentf76dab71d6db763cf87bc62d382809114c38d93d (diff)
DEV-42215: Don't zap valid g(First|Last)name with empty strings.
In the --autologin case, gFirstname, gLastname were validly set from gSavedSettings, but at the last minute were overwritten with empty strings from gLoginHandler. Only perform those assignments if gLoginHandler has non-empty strings to contribute.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llstartup.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 4c322810d5..2c1f468f77 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -744,6 +744,7 @@ bool idle_startup()
// We have at least some login information on a SLURL
gFirstname = gLoginHandler.getFirstName();
gLastname = gLoginHandler.getLastName();
+ LL_DEBUGS("LLStartup") << "STATE_FIRST: setting gFirstname, gLastname from gLoginHandler: '" << gFirstname << "' '" << gLastname << "'" << LL_ENDL;
// Show the login screen if we don't have everything
show_connect_box =
@@ -754,6 +755,7 @@ bool idle_startup()
LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
gFirstname = cmd_line_login[0].asString();
gLastname = cmd_line_login[1].asString();
+ LL_DEBUGS("LLStartup") << "Setting gFirstname, gLastname from gSavedSettings(\"UserLoginInfo\"): '" << gFirstname << "' '" << gLastname << "'" << LL_ENDL;
LLMD5 pass((unsigned char*)cmd_line_login[2].asString().c_str());
char md5pass[33]; /* Flawfinder: ignore */
@@ -771,6 +773,7 @@ bool idle_startup()
{
gFirstname = gSavedSettings.getString("FirstName");
gLastname = gSavedSettings.getString("LastName");
+ LL_DEBUGS("LLStartup") << "AutoLogin: setting gFirstname, gLastname from gSavedSettings(\"First|LastName\"): '" << gFirstname << "' '" << gLastname << "'" << LL_ENDL;
gPassword = LLStartUp::loadPasswordFromDisk();
gSavedSettings.setBOOL("RememberPassword", TRUE);
@@ -786,6 +789,7 @@ bool idle_startup()
// a valid grid is selected
gFirstname = gSavedSettings.getString("FirstName");
gLastname = gSavedSettings.getString("LastName");
+ LL_DEBUGS("LLStartup") << "normal login: setting gFirstname, gLastname from gSavedSettings(\"First|LastName\"): '" << gFirstname << "' '" << gLastname << "'" << LL_ENDL;
gPassword = LLStartUp::loadPasswordFromDisk();
show_connect_box = true;
}
@@ -896,8 +900,15 @@ bool idle_startup()
gViewerWindow->moveProgressViewToFront();
//reset the values that could have come in from a slurl
- gFirstname = gLoginHandler.getFirstName();
- gLastname = gLoginHandler.getLastName();
+ // DEV-42215: Make sure they're not empty -- gFirstname and gLastname
+ // might already have been set from gSavedSettings, and it's too bad
+ // to overwrite valid values with empty strings.
+ if (! gLoginHandler.getFirstName().empty() && ! gLoginHandler.getLastName().empty())
+ {
+ gFirstname = gLoginHandler.getFirstName();
+ gLastname = gLoginHandler.getLastName();
+ LL_DEBUGS("LLStartup") << "STATE_LOGIN_CLEANUP: setting gFirstname, gLastname from gLoginHandler: '" << gFirstname << "' '" << gLastname << "'" << LL_ENDL;
+ }
if (show_connect_box)
{