From 0124e8952bd71ef4d0ab83c3c6859191d7591809 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 13 Aug 2021 18:23:33 +0300 Subject: SL-15830 remove ancient "non-system grid" handling from the viewer --- indra/newview/llpanellogin.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 381b80fb66..0dfe5a2330 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -100,15 +100,7 @@ std::string get_user_key_from_name(const std::string &username) std::string key = username; LLStringUtil::trim(key); LLStringUtil::toLower(key); - if (!LLGridManager::getInstance()->isSystemGrid()) - { - size_t separator_index = username.find_first_of(" "); - if (separator_index == username.npos) - { - // CRED_IDENTIFIER_TYPE_ACCOUNT - return key; - } - } + // CRED_IDENTIFIER_TYPE_AGENT size_t separator_index = username.find_first_of(" ._"); std::string first = username.substr(0, separator_index); -- cgit v1.2.3 From baeb14b7562ac926ab39c8abbb6cd910310548d8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 3 Nov 2021 11:42:09 +0200 Subject: SL-15830 remove ancient "non-system grid" handling from the viewer #2 --- indra/newview/llpanellogin.cpp | 63 ------------------------------------------ 1 file changed, 63 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 0dfe5a2330..deb1a963a0 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -92,36 +92,6 @@ LLPointer load_user_credentials(std::string &user_key) } } -// keys are lower case to be case insensitive so they are not always -// identical to names which retain user input, like: -// "AwEsOmE Resident" -> "awesome_resident" -std::string get_user_key_from_name(const std::string &username) -{ - std::string key = username; - LLStringUtil::trim(key); - LLStringUtil::toLower(key); - - // CRED_IDENTIFIER_TYPE_AGENT - size_t separator_index = username.find_first_of(" ._"); - std::string first = username.substr(0, separator_index); - std::string last; - if (separator_index != username.npos) - { - last = username.substr(separator_index + 1, username.npos); - LLStringUtil::trim(last); - } - else - { - // ...on Linden grids, single username users as considered to have - // last name "Resident" - // *TODO: Make login.cgi support "account_name" like above - last = "resident"; - } - - key = first + "_" + last; - return key; -} - class LLLoginLocationAutoHandler : public LLCommandHandler { public: @@ -682,39 +652,6 @@ void LLPanelLogin::getFields(LLPointer& credential, LL_INFOS("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL; // determine if the username is a first/last form or not. size_t separator_index = username.find_first_of(' '); - if (separator_index == username.npos - && !LLGridManager::getInstance()->isSystemGrid()) - { - LL_INFOS("Credentials", "Authentication") << "account: " << username << LL_ENDL; - // single username, so this is a 'clear' identifier - identifier["type"] = CRED_IDENTIFIER_TYPE_ACCOUNT; - identifier["account_name"] = username; - - if (LLPanelLogin::sInstance->mPasswordModified) - { - // password is plaintext - authenticator["type"] = CRED_AUTHENTICATOR_TYPE_CLEAR; - authenticator["secret"] = password; - } - else - { - credential = load_user_credentials(username); - if (credential.notNull()) - { - authenticator = credential->getAuthenticator(); - if (authenticator.emptyMap()) - { - // Likely caused by user trying to log in to non-system grid - // with unsupported name format, just retry - LL_WARNS() << "Authenticator failed to load for: " << username << LL_ENDL; - // password is plaintext - authenticator["type"] = CRED_AUTHENTICATOR_TYPE_CLEAR; - authenticator["secret"] = password; - } - } - } - } - else { // Be lenient in terms of what separators we allow for two-word names // and allow legacy users to login with firstname.lastname -- cgit v1.2.3 From 952aee3f49d9591473b0bc2029dd485dd70a4132 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Mar 2022 20:34:31 +0200 Subject: SL-17064 Add a Remember Password checkbox to the first time login screen. --- indra/newview/llpanellogin.cpp | 49 ++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index deb1a963a0..302ff40bbc 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -323,11 +323,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, username_combo->setReturnCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); username_combo->setKeystrokeOnEsc(TRUE); - if (!mFirstLoginThisInstall) - { - LLCheckBoxCtrl* remember_name = getChild("remember_name"); - remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); - } + + LLCheckBoxCtrl* remember_name = getChild("remember_name"); + remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); } void LLPanelLogin::addFavoritesToStartLocation() @@ -527,21 +525,12 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } - if (sInstance->mFirstLoginThisInstall) - { - LLUICtrl* remember_check = sInstance->getChild("remember_check"); - remember_check->setValue(remember_psswrd); - // no list to populate - setFields(credential); - } - else - { - sInstance->getChild("remember_name")->setValue(remember_user); - LLUICtrl* remember_password = sInstance->getChild("remember_password"); - remember_password->setValue(remember_user && remember_psswrd); - remember_password->setEnabled(remember_user); - sInstance->populateUserList(credential); - } + + sInstance->getChild("remember_name")->setValue(remember_user); + LLUICtrl* remember_password = sInstance->getChild("remember_password"); + remember_password->setValue(remember_user && remember_psswrd); + remember_password->setEnabled(remember_user); + sInstance->populateUserList(credential); } //static @@ -702,16 +691,9 @@ void LLPanelLogin::getFields(LLPointer& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - if (!sInstance->mFirstLoginThisInstall) - { - remember_psswrd = sInstance->getChild("remember_password")->getValue(); - remember_user = sInstance->getChild("remember_name")->getValue(); - } - else - { - remember_psswrd = sInstance->getChild("remember_check")->getValue(); - remember_user = remember_psswrd; // on panel_login_first "remember_check" is named as 'remember me' - } + + remember_psswrd = sInstance->getChild("remember_password")->getValue(); + remember_user = sInstance->getChild("remember_name")->getValue(); } @@ -1074,17 +1056,18 @@ void LLPanelLogin::onUserListCommit(void*) } // static -// At the moment only happens if !mFirstLoginThisInstall void LLPanelLogin::onRememberUserCheck(void*) { - if (sInstance && !sInstance->mFirstLoginThisInstall) + if (sInstance) { LLCheckBoxCtrl* remember_name(sInstance->getChild("remember_name")); LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_password")); LLComboBox* user_combo(sInstance->getChild("username_combo")); bool remember = remember_name->getValue().asBoolean(); - if (user_combo->getCurrentIndex() != -1 && !remember) + if (!sInstance->mFirstLoginThisInstall + && user_combo->getCurrentIndex() != -1 + && !remember) { remember = true; remember_name->setValue(true); -- cgit v1.2.3 From e2aa8e17e2dc4d297d1043ed59b3f415f14751f6 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 28 Mar 2022 17:41:48 +0300 Subject: SL-17039 "Remember Password" checkbox state should be saved per account name --- indra/newview/llpanellogin.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 302ff40bbc..9df3a8e31a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -326,6 +326,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLCheckBoxCtrl* remember_name = getChild("remember_name"); remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); + getChild("remember_password")->setCommitCallback(boost::bind(&LLPanelLogin::onRememberPasswordCheck, this)); } void LLPanelLogin::addFavoritesToStartLocation() @@ -398,10 +399,22 @@ void LLPanelLogin::addFavoritesToStartLocation() combo->addSeparator(); LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL; LLSD user_llsd = iter->second; + bool update_password_setting = true; for (LLSD::array_const_iterator iter1 = user_llsd.beginArray(); iter1 != user_llsd.endArray(); ++iter1) { - std::string label = (*iter1)["name"].asString(); + if ((*iter1).has("save_password")) + { + bool save_password = (*iter1)["save_password"].asBoolean(); + gSavedSettings.setBOOL("RememberPassword", save_password); + if (!save_password) + { + getChild("connect_btn")->setEnabled(false); + } + update_password_setting = false; + } + + std::string label = (*iter1)["name"].asString(); std::string value = (*iter1)["slurl"].asString(); if(label != "" && value != "") { @@ -413,6 +426,10 @@ void LLPanelLogin::addFavoritesToStartLocation() } } } + if (update_password_setting) + { + gSavedSettings.setBOOL("UpdateRememberPasswordSetting", TRUE); + } break; } if (combo->getValue().asString().empty()) @@ -1081,6 +1098,14 @@ void LLPanelLogin::onRememberUserCheck(void*) } } +void LLPanelLogin::onRememberPasswordCheck(void*) +{ + if (sInstance) + { + gSavedSettings.setBOOL("UpdateRememberPasswordSetting", TRUE); + } +} + // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { -- cgit v1.2.3