From 37ca582a2dacfbe7cbb37d2e9ecddca0a9bc8ed7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 3 Jan 2020 20:12:46 +0200 Subject: SL-9699 Do not disable 'remember me' checkbox --- indra/newview/llpanellogin.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4fd39d1211..00172277bc 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -560,7 +560,6 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem { sInstance->getChild("remember_name")->setValue(remember_user); sInstance->populateUserList(credential); - remember_check->setEnabled(remember_user); } } @@ -1112,14 +1111,22 @@ void LLPanelLogin::onUserListCommit(void*) } // static +// At the moment only happens if !mFirstLoginThisInstall void LLPanelLogin::onRememberUserCheck(void*) { - if (sInstance) + if (sInstance && !sInstance->mFirstLoginThisInstall) { LLCheckBoxCtrl* remember_name(sInstance->getChild("remember_name")); LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_check")); + LLComboBox* user_combo(sInstance->getChild("username_combo")); bool remember = remember_name->getValue().asBoolean(); + if (user_combo->getCurrentIndex() != -1 && !remember) + { + remember = true; + remember_name->setValue(true); + LLNotificationsUtil::add("LoginCantRemoveUsername"); + } remember_psswrd->setEnabled(remember); } } @@ -1185,12 +1192,15 @@ void LLPanelLogin::updateLoginButtons() login_btn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0); - if (!mFirstLoginThisInstall) - { - LLComboBox* user_combo = getChild("username_combo"); - LLCheckBoxCtrl* remember_name = getChild("remember_name"); - remember_name->setEnabled(user_combo->getCurrentIndex() == -1); - } + if (!mFirstLoginThisInstall) + { + LLComboBox* user_combo = getChild("username_combo"); + LLCheckBoxCtrl* remember_name = getChild("remember_name"); + if (user_combo->getCurrentIndex() != -1) + { + remember_name->setValue(true); + } // Note: might be good idea to do "else remember_name->setValue(mRememberedState)" but it might behave 'weird' to user + } } void LLPanelLogin::populateUserList(LLPointer credential) -- cgit v1.2.3 From 1e59ac11e2ca7bac9f91cda71733715a3f960042 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 9 Jan 2020 03:05:00 +0200 Subject: SL-12533 Switching between grids on login page does not always switch the remembered user list --- indra/newview/llpanellogin.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 00172277bc..2cc5ea72d6 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -762,11 +762,8 @@ BOOL LLPanelLogin::areCredentialFieldsDirty() } else { - std::string username = sInstance->getChild("username_combo")->getValue().asString(); - LLStringUtil::trim(username); - std::string password = sInstance->getChild("password_edit")->getValue().asString(); LLComboBox* combo = sInstance->getChild("username_combo"); - if(combo && combo->isDirty()) + if (combo && combo->getCurrentIndex() == -1 && combo->isDirty()) { return true; } @@ -1155,8 +1152,30 @@ void LLPanelLogin::updateServer() try { // if they've selected another grid, we should load the credentials - // for that grid and set them to the UI. - if(!sInstance->areCredentialFieldsDirty()) + // for that grid and set them to the UI. But if there were any modifications to + // fields, modifications should carry over. + // Not sure if it should carry over password but it worked like this before login changes + // Example: you started typing in and found that your are under wrong grid, + // you switch yet don't lose anything + if (sInstance->areCredentialFieldsDirty()) + { + // save modified creds + LLComboBox* user_combo = sInstance->getChild("username_combo"); + LLLineEditor* pswd_edit = sInstance->getChild("password_edit"); + std::string username = user_combo->getSimple(); + LLStringUtil::trim(username); + std::string password = pswd_edit->getValue().asString(); + + // populate dropbox and setFields + // Note: following call is related to initializeLoginInfo() + LLPointer credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid()); + sInstance->populateUserList(credential); + + // restore creds + user_combo->setTextEntry(username); + pswd_edit->setValue(password); + } + else { // populate dropbox and setFields // Note: following call is related to initializeLoginInfo() -- cgit v1.2.3 From 5d4c7195e8ee9a2bc0ee7ac39dbd4186d0784e7c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 9 Jan 2020 03:23:52 +0200 Subject: SL-12533 Correct password drop and fixed 'dirty' condition --- indra/newview/llpanellogin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 2cc5ea72d6..4edcf4a47d 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -763,7 +763,7 @@ BOOL LLPanelLogin::areCredentialFieldsDirty() else { LLComboBox* combo = sInstance->getChild("username_combo"); - if (combo && combo->getCurrentIndex() == -1 && combo->isDirty()) + if (combo && combo->getCurrentIndex() == -1 && !combo->getValue().asString().empty()) { return true; } @@ -1249,6 +1249,7 @@ void LLPanelLogin::populateUserList(LLPointer credential) { // selection failed, just deselect whatever might be selected user_combo->setValue(std::string()); + getChild("password_edit")->setValue(std::string()); } else { -- cgit v1.2.3 From 94d718c15002b0c3e99ac14bad8379bde81d36f0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 13 Jan 2020 19:46:10 +0200 Subject: =?UTF-8?q?SL-12556=20Fixed=20The=20=E2=80=98Log=20In=E2=80=99=20b?= =?UTF-8?q?utton=20being=20active=20with=20empty=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanellogin.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4edcf4a47d..dd4ca261ff 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -609,15 +609,19 @@ void LLPanelLogin::setFields(LLPointer credential) login_id += " "; login_id += lastname; } - sInstance->getChild("username_combo")->setLabel(login_id); + sInstance->getChild("username_combo")->setLabel(login_id); + sInstance->mUsernameLength = login_id.length(); } else if(identifier.has("type") && (std::string)identifier["type"] == "account") { - sInstance->getChild("username_combo")->setLabel((std::string)identifier["account_name"]); + std::string login_id = identifier["account_name"].asString(); + sInstance->getChild("username_combo")->setLabel(login_id); + sInstance->mUsernameLength = login_id.length(); } else { - sInstance->getChild("username_combo")->setLabel(std::string()); + sInstance->getChild("username_combo")->setLabel(std::string()); + sInstance->mUsernameLength = 0; } sInstance->addFavoritesToStartLocation(); @@ -641,7 +645,8 @@ void LLPanelLogin::setFields(LLPointer credential) } else { - sInstance->getChild("password_edit")->setValue(std::string()); + sInstance->getChild("password_edit")->setValue(std::string()); + sInstance->mPasswordLength = 0; } } @@ -1250,6 +1255,9 @@ void LLPanelLogin::populateUserList(LLPointer credential) // selection failed, just deselect whatever might be selected user_combo->setValue(std::string()); getChild("password_edit")->setValue(std::string()); + mUsernameLength = 0; + mPasswordLength = 0; + updateLoginButtons(); } else { -- cgit v1.2.3 From 3233dfe833050cbd0a7d17f4f87a46bcffc1da52 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 13 Jan 2020 21:16:39 +0200 Subject: SL-12555 Fixed Login failed with credencials after the first incorrect entry --- indra/newview/llpanellogin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index dd4ca261ff..2b84d87e53 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -664,7 +664,7 @@ void LLPanelLogin::getFields(LLPointer& credential, LLSD identifier = LLSD::emptyMap(); LLSD authenticator = LLSD::emptyMap(); - std::string username = sInstance->getChild("username_combo")->getValue().asString(); + std::string username = sInstance->getChild("username_combo")->getSimple(); std::string password = sInstance->getChild("password_edit")->getValue().asString(); LLStringUtil::trim(username); -- cgit v1.2.3 From c83536f6c3950c21836f276f93d8538e67eac9b0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 16 Jan 2020 15:23:38 +0200 Subject: SL-12556 Fixed another case of login button being active --- indra/newview/llpanellogin.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 2b84d87e53..cfa935cd01 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -1232,6 +1232,8 @@ void LLPanelLogin::populateUserList(LLPointer credential) LLComboBox* user_combo = getChild("username_combo"); user_combo->removeall(); user_combo->clear(); + mUsernameLength = 0; + mPasswordLength = 0; if (gSecAPIHandler->hasCredentialMap("login_list", LLGridManager::getInstance()->getGrid())) { @@ -1255,8 +1257,6 @@ void LLPanelLogin::populateUserList(LLPointer credential) // selection failed, just deselect whatever might be selected user_combo->setValue(std::string()); getChild("password_edit")->setValue(std::string()); - mUsernameLength = 0; - mPasswordLength = 0; updateLoginButtons(); } else @@ -1274,6 +1274,14 @@ void LLPanelLogin::populateUserList(LLPointer credential) user_combo->add(LLPanelLogin::getUserName(credential), credential->userID(), ADD_BOTTOM, TRUE); setFields(credential); } + else + { + updateLoginButtons(); + } + } + else + { + updateLoginButtons(); } } } -- cgit v1.2.3 From c5be566a6fbf121d1ca140586a02cda18f83b11b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 20 Jan 2020 14:43:48 +0200 Subject: SL-12596 Fixed incorectly enabled checkbox and enabled login button --- indra/newview/llpanellogin.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cfa935cd01..7ef3685cdb 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -549,16 +549,19 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } - LLUICtrl* remember_check = sInstance->getChild("remember_check"); - remember_check->setValue(remember_psswrd); 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_psswrd); + remember_password->setEnabled(remember_user); sInstance->populateUserList(credential); } } @@ -746,13 +749,14 @@ void LLPanelLogin::getFields(LLPointer& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - remember_psswrd = sInstance->getChild("remember_check")->getValue(); 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' } } @@ -1080,6 +1084,7 @@ void LLPanelLogin::onUserNameTextEnty(void*) { sInstance->mPasswordModified = true; sInstance->getChild("password_edit")->setValue(std::string()); + sInstance->mPasswordLength = 0; sInstance->addFavoritesToStartLocation(); //will call updateLoginButtons() } @@ -1119,7 +1124,7 @@ void LLPanelLogin::onRememberUserCheck(void*) if (sInstance && !sInstance->mFirstLoginThisInstall) { LLCheckBoxCtrl* remember_name(sInstance->getChild("remember_name")); - LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_check")); + LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_password")); LLComboBox* user_combo(sInstance->getChild("username_combo")); bool remember = remember_name->getValue().asBoolean(); @@ -1179,6 +1184,8 @@ void LLPanelLogin::updateServer() // restore creds user_combo->setTextEntry(username); pswd_edit->setValue(password); + sInstance->mUsernameLength = username.length(); + sInstance->mPasswordLength = password.length(); } else { -- cgit v1.2.3 From a4cabf80d3c7a125a23dbab0fadec5c8c5ab8d97 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 29 Jan 2020 16:39:49 +0200 Subject: SL-12590 SL-12608 Fixed wrong states --- indra/newview/llpanellogin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 7ef3685cdb..224cec9650 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -1230,6 +1230,8 @@ void LLPanelLogin::updateLoginButtons() if (user_combo->getCurrentIndex() != -1) { remember_name->setValue(true); + LLCheckBoxCtrl* remember_pass = getChild("remember_password"); + remember_pass->setEnabled(TRUE); } // Note: might be good idea to do "else remember_name->setValue(mRememberedState)" but it might behave 'weird' to user } } @@ -1239,6 +1241,8 @@ void LLPanelLogin::populateUserList(LLPointer credential) LLComboBox* user_combo = getChild("username_combo"); user_combo->removeall(); user_combo->clear(); + user_combo->setValue(std::string()); + getChild("password_edit")->setValue(std::string()); mUsernameLength = 0; mPasswordLength = 0; @@ -1261,9 +1265,7 @@ void LLPanelLogin::populateUserList(LLPointer credential) if (credential.isNull() || !user_combo->setSelectedByValue(LLSD(credential->userID()), true)) { - // selection failed, just deselect whatever might be selected - user_combo->setValue(std::string()); - getChild("password_edit")->setValue(std::string()); + // selection failed, fields will be mepty updateLoginButtons(); } else @@ -1278,7 +1280,8 @@ void LLPanelLogin::populateUserList(LLPointer credential) const LLSD &ident = credential->getIdentifier(); if (ident.isMap() && ident.has("type")) { - user_combo->add(LLPanelLogin::getUserName(credential), credential->userID(), ADD_BOTTOM, TRUE); + // this llsd might hold invalid credencial (failed login), so + // do not add to the list, just set field. setFields(credential); } else -- cgit v1.2.3