diff options
author | McCabe Maxsted | 2011-04-19 14:49:18 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-04-19 14:49:18 -0700 |
commit | a0902a050cc713f742990a09d2a610d4c135b7c7 (patch) | |
tree | c4a2c89cd48d6e50908959deed5318c6cd4fbaf5 /linden/indra/newview/llpanellogin.cpp | |
parent | Fixed usernames default setting to '.' when logging into second life for the ... (diff) | |
download | meta-impy-a0902a050cc713f742990a09d2a610d4c135b7c7.zip meta-impy-a0902a050cc713f742990a09d2a610d4c135b7c7.tar.gz meta-impy-a0902a050cc713f742990a09d2a610d4c135b7c7.tar.bz2 meta-impy-a0902a050cc713f742990a09d2a610d4c135b7c7.tar.xz |
Remember name and password based on grid. This is far from optimal, but will work for the time being.
* UI needs to be made clear on what's going on with user's passwords
* 'Remember password' checkbox now works on login (but is unclear)
* Stored passwords are MD5s in grid_info.xml
* Fixed vivox license appearing on other grids rather than specifically on second life login when voice is enabled
* Small fix for username entry after logout
* Sadly, storing password in the mac keychain needs to be reimplemented now
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r-- | linden/indra/newview/llpanellogin.cpp | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 7b05794..fd9d077 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -91,6 +91,7 @@ | |||
91 | 91 | ||
92 | const S32 BLACK_BORDER_HEIGHT = 160; | 92 | const S32 BLACK_BORDER_HEIGHT = 160; |
93 | const S32 MAX_PASSWORD = 16; | 93 | const S32 MAX_PASSWORD = 16; |
94 | const std::string PASSWORD_FILLER = "123456789!123456"; | ||
94 | 95 | ||
95 | LLPanelLogin *LLPanelLogin::sInstance = NULL; | 96 | LLPanelLogin *LLPanelLogin::sInstance = NULL; |
96 | BOOL LLPanelLogin::sCapslockDidNotification = FALSE; | 97 | BOOL LLPanelLogin::sCapslockDidNotification = FALSE; |
@@ -174,7 +175,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
174 | mLogoImage(), | 175 | mLogoImage(), |
175 | mCallback(callback), | 176 | mCallback(callback), |
176 | mCallbackData(cb_data), | 177 | mCallbackData(cb_data), |
177 | mHtmlAvailable( TRUE ) | 178 | mHtmlAvailable( TRUE ), |
179 | mActualPassword("") | ||
178 | { | 180 | { |
179 | setFocusRoot(TRUE); | 181 | setFocusRoot(TRUE); |
180 | 182 | ||
@@ -212,7 +214,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
212 | childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace); | 214 | childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace); |
213 | childSetPrevalidate("username_edit", LLLineEditor::prevalidatePrintableSpace); | 215 | childSetPrevalidate("username_edit", LLLineEditor::prevalidatePrintableSpace); |
214 | 216 | ||
215 | childSetCommitCallback("password_edit", mungePassword); | 217 | childSetCommitCallback("password_edit", onPasswordChanged, this); |
216 | childSetKeystrokeCallback("password_edit", onPassKey, this); | 218 | childSetKeystrokeCallback("password_edit", onPassKey, this); |
217 | childSetUserData("password_edit", this); | 219 | childSetUserData("password_edit", this); |
218 | 220 | ||
@@ -355,22 +357,6 @@ void LLPanelLogin::setSiteIsAlive( bool alive ) | |||
355 | } | 357 | } |
356 | } | 358 | } |
357 | 359 | ||
358 | void LLPanelLogin::mungePassword(LLUICtrl* caller, void* user_data) | ||
359 | { | ||
360 | LLPanelLogin* self = (LLPanelLogin*)user_data; | ||
361 | LLLineEditor* editor = (LLLineEditor*)caller; | ||
362 | std::string password = editor->getText(); | ||
363 | |||
364 | // Re-md5 if we've changed at all | ||
365 | if (password != self->mIncomingPassword) | ||
366 | { | ||
367 | LLMD5 pass((unsigned char *)password.c_str()); | ||
368 | char munged_password[MD5HEX_STR_SIZE]; | ||
369 | pass.hex_digest(munged_password); | ||
370 | self->mMungedPassword = munged_password; | ||
371 | } | ||
372 | } | ||
373 | |||
374 | LLPanelLogin::~LLPanelLogin() | 360 | LLPanelLogin::~LLPanelLogin() |
375 | { | 361 | { |
376 | LLPanelLogin::sInstance = NULL; | 362 | LLPanelLogin::sInstance = NULL; |
@@ -596,6 +582,8 @@ void LLPanelLogin::setFields(const std::string& firstname, | |||
596 | // static | 582 | // static |
597 | void LLPanelLogin::setPassword(const std::string& password) | 583 | void LLPanelLogin::setPassword(const std::string& password) |
598 | { | 584 | { |
585 | // we check for sInstance before getting here | ||
586 | |||
599 | // Max "actual" password length is 16 characters. | 587 | // Max "actual" password length is 16 characters. |
600 | // Hex digests are always 32 characters. | 588 | // Hex digests are always 32 characters. |
601 | if (password.length() == 32) | 589 | if (password.length() == 32) |
@@ -604,21 +592,16 @@ void LLPanelLogin::setPassword(const std::string& password) | |||
604 | // We don't actually use the password input field, | 592 | // We don't actually use the password input field, |
605 | // fill it with MAX_PASSWORD characters so we get a | 593 | // fill it with MAX_PASSWORD characters so we get a |
606 | // nice row of asterixes. | 594 | // nice row of asterixes. |
607 | const std::string filler("123456789!123456"); | 595 | sInstance->childSetText("password_edit", PASSWORD_FILLER); |
608 | sInstance->childSetText("password_edit", filler); | ||
609 | sInstance->mIncomingPassword = filler; | ||
610 | sInstance->mMungedPassword = password; | ||
611 | } | 596 | } |
612 | else | 597 | else |
613 | { | 598 | { |
614 | // this is a normal text password | 599 | // this is a normal text password |
615 | sInstance->childSetText("password_edit", password); | 600 | sInstance->childSetText("password_edit", password); |
616 | sInstance->mIncomingPassword = password; | ||
617 | LLMD5 pass((unsigned char *)password.c_str()); | ||
618 | char munged_password[MD5HEX_STR_SIZE]; | ||
619 | pass.hex_digest(munged_password); | ||
620 | sInstance->mMungedPassword = munged_password; | ||
621 | } | 601 | } |
602 | |||
603 | // munging happens in the grid manager now | ||
604 | sInstance->mActualPassword = password; | ||
622 | } | 605 | } |
623 | 606 | ||
624 | 607 | ||
@@ -714,7 +697,8 @@ void LLPanelLogin::getFields(std::string *firstname, | |||
714 | LLStringUtil::trim(*lastname); | 697 | LLStringUtil::trim(*lastname); |
715 | } | 698 | } |
716 | 699 | ||
717 | *password = sInstance->mMungedPassword; | 700 | // sent to us from LLStartUp. Saved only on an actual connect |
701 | *password = sInstance->mActualPassword; | ||
718 | } | 702 | } |
719 | 703 | ||
720 | // static | 704 | // static |
@@ -893,7 +877,7 @@ void LLPanelLogin::loadLoginForm() | |||
893 | lastname_l->setText(lastname_s); | 877 | lastname_l->setText(lastname_s); |
894 | } | 878 | } |
895 | 879 | ||
896 | setPassword(gHippoGridManager->getCurrentGrid()->getAvatarPassword()); | 880 | setPassword(gHippoGridManager->getCurrentGrid()->getPassword()); |
897 | } | 881 | } |
898 | 882 | ||
899 | 883 | ||
@@ -1224,6 +1208,20 @@ void LLPanelLogin::onClickNewAccount(void*) | |||
1224 | } | 1208 | } |
1225 | } | 1209 | } |
1226 | 1210 | ||
1211 | // static | ||
1212 | void LLPanelLogin::onPasswordChanged(LLUICtrl* caller, void* user_data) | ||
1213 | { | ||
1214 | LLPanelLogin* self = (LLPanelLogin*)user_data; | ||
1215 | LLLineEditor* editor = (LLLineEditor*)caller; | ||
1216 | std::string password = editor->getText(); | ||
1217 | |||
1218 | // update if we've changed at all | ||
1219 | // is there a good way to let users know we can't let them use PASSWORD_FILLER? | ||
1220 | if (password != self->mActualPassword && password != PASSWORD_FILLER) | ||
1221 | { | ||
1222 | self->mActualPassword = password; | ||
1223 | } | ||
1224 | } | ||
1227 | 1225 | ||
1228 | // *NOTE: This function is dead as of 2008 August. I left it here in case | 1226 | // *NOTE: This function is dead as of 2008 August. I left it here in case |
1229 | // we suddenly decide to put the Quit button back. JC | 1227 | // we suddenly decide to put the Quit button back. JC |