From 0fec01385d3c09490457aa1069f2985d5ec793f9 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Apr 2010 22:02:49 -0700 Subject: DEV-48542 - CID-444/CID-445: missing break in switch, llpanellogin.cpp Added missing breaks. CR: Josh --- indra/newview/llpanellogin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b620a005d2..548f97b9f1 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -785,11 +785,20 @@ void LLPanelLogin::getLocation(LLSLURL& slurl) switch(combo->getCurrentIndex()) { case 0: + { slurl = LLSLURL(LLSLURL::SIM_LOCATION_HOME); + break; + } case 1: + { slurl = LLSLURL(LLSLURL::SIM_LOCATION_LAST); + break; + } default: + { slurl = LLSLURL(combo->getValue().asString()); + break; + } } } -- cgit v1.2.3 From 9fdba53b09193290ab33fc6aa414329d126505ed Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 21 Apr 2010 00:17:58 -0700 Subject: Show beta grids depending on a settings.xml setting. for SLE, this will be turned off. For trunk, it's turned on. Also, fixed an issue with manual entry of locations into the location dropdown. --- indra/newview/llpanellogin.cpp | 82 ++++++++---------------------------------- 1 file changed, 15 insertions(+), 67 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a9e6484061..2bd763c681 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -221,16 +221,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLLineEditor* edit = getChild("password_edit"); if (edit) edit->setDrawAsterixes(TRUE); - LLComboBox* combo = getChild("start_location_combo"); - if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION) { LLSLURL slurl(gSavedSettings.getString("LoginLocation")); LLStartUp::setStartSLURL(slurl); } updateLocationCombo(false); - - combo->setCommitCallback(onSelectLocation, NULL); LLComboBox* server_choice_combo = sInstance->getChild("server_combo"); server_choice_combo->setCommitCallback(onSelectServer, NULL); @@ -692,7 +688,6 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) return; } - llinfos << "updatelocationcombo " << LLStartUp::getStartSLURL().asString() << llendl; LLComboBox* combo = sInstance->getChild("start_location_combo"); switch(LLStartUp::getStartSLURL().getType()) @@ -724,7 +719,7 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) } // static -void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) +void LLPanelLogin::updateStartSLURL() { if (!sInstance) return; @@ -733,30 +728,11 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) switch (index) { - case 2: + case 0: { - LLSLURL slurl = LLSLURL(combo->getSelectedValue()); - if((slurl.getType() == LLSLURL::LOCATION) && - (slurl.getGrid() != LLStartUp::getStartSLURL().getGrid())) - { - - - // we've changed the grid, so update the grid selection - try - { - LLStartUp::setStartSLURL(slurl); - } - catch (LLInvalidGridName ex) - { - LLSD args; - args["GRID"] = slurl.getGrid(); - LLNotificationsUtil::add("InvalidGrid", args); - return; - } - loadLoginPage(); - } + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); break; - } + } case 1: { LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); @@ -764,44 +740,18 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) } default: { - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); + LLSLURL slurl = LLSLURL(combo->getValue().asString()); + if(slurl.getType() == LLSLURL::LOCATION) + { + // we've changed the grid, so update the grid selection + LLStartUp::setStartSLURL(slurl); + } break; - } + } } } -// static -void LLPanelLogin::getLocation(LLSLURL& slurl) -{ - LLSLURL result; - if (!sInstance) - { - llwarns << "Attempted getLocation with no login view shown" << llendl; - } - - LLComboBox* combo = sInstance->getChild("start_location_combo"); - - switch(combo->getCurrentIndex()) - { - case 0: - { - slurl = LLSLURL(LLSLURL::SIM_LOCATION_HOME); - break; - } - case 1: - { - slurl = LLSLURL(LLSLURL::SIM_LOCATION_LAST); - break; - } - default: - { - slurl = LLSLURL(combo->getValue().asString()); - break; - } - } -} - void LLPanelLogin::setLocation(const LLSLURL& slurl) { LLStartUp::setStartSLURL(slurl); @@ -1024,7 +974,7 @@ void LLPanelLogin::onClickConnect(void *) LLNotificationsUtil::add("InvalidGrid", args); return; } - + updateStartSLURL(); std::string username = sInstance->childGetText("username_edit"); if(username.empty()) { @@ -1134,11 +1084,9 @@ void LLPanelLogin::updateServerCombo() // We add all of the possible values, sorted, and then add a bar and the current value at the top LLComboBox* server_choice_combo = sInstance->getChild("server_combo"); server_choice_combo->removeall(); -#ifdef LL_RELEASE_FOR_DOWNLOAD - std::map known_grids = LLGridManager::getInstance()->getKnownGrids(TRUE); -#else - std::map known_grids = LLGridManager::getInstance()->getKnownGrids(FALSE); -#endif + + std::map known_grids = LLGridManager::getInstance()->getKnownGrids(!gSavedSettings.getBOOL("ShowBetaGrids")); + for (std::map::iterator grid_choice = known_grids.begin(); grid_choice != known_grids.end(); grid_choice++) -- cgit v1.2.3 From c139e52a5bf1ca2273d4fd22f28f55b12ba8a2d7 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 21 Apr 2010 14:22:49 -0700 Subject: Remove diamondware and rearrange login panel to be like it is in the default viewer 2 build --- indra/newview/llpanellogin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 2bd763c681..22fb70de73 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -715,7 +715,9 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) sInstance->childSetVisible("start_location_combo", show_start); sInstance->childSetVisible("start_location_text", show_start); - sInstance->childSetVisible("server_combo", TRUE); + BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); + sInstance->childSetVisible("server_combo_text", show_server); + sInstance->childSetVisible("server_combo", show_server); } // static -- cgit v1.2.3 From 5e727964dbd6d5e55dd3a0921e8e1f0f77a99747 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 22 Apr 2010 15:09:34 -0700 Subject: DEV-49332 - cryptic error message when typing in single username when logging into maingrid. Needs to be changed when IE is checked in, of course. Now we check the expected credential formats for a given grid against the format that is typed in, and throw an error if it's invalid. --- indra/newview/llpanellogin.cpp | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 22fb70de73..63fe7bfa91 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -571,7 +571,7 @@ void LLPanelLogin::setFields(LLPointer credential, // static void LLPanelLogin::getFields(LLPointer& credential, - BOOL remember) + BOOL& remember) { if (!sInstance) { @@ -603,14 +603,14 @@ void LLPanelLogin::getFields(LLPointer& credential, { LL_INFOS2("Credentials", "Authentication") << "account: " << username << LL_ENDL; // single username, so this is a 'clear' identifier - identifier["type"] = "account"; + identifier["type"] = CRED_IDENTIFIER_TYPE_ACCOUNT; identifier["account_name"] = username; if (LLPanelLogin::sInstance->mPasswordModified) { authenticator = LLSD::emptyMap(); // password is plaintext - authenticator["type"] = "clear"; + authenticator["type"] = CRED_AUTHENTICATOR_TYPE_CLEAR; authenticator["secret"] = password; } } @@ -618,14 +618,14 @@ void LLPanelLogin::getFields(LLPointer& credential, { LL_INFOS2("Credentials", "Authentication") << "agent: " << username << LL_ENDL; // traditional firstname / lastname - identifier["type"] = "agent"; + identifier["type"] = CRED_IDENTIFIER_TYPE_AGENT; identifier["first_name"] = username.substr(0, separator_index); identifier["last_name"] = username.substr(separator_index+1, username.npos); if (LLPanelLogin::sInstance->mPasswordModified) { authenticator = LLSD::emptyMap(); - authenticator["type"] = "hash"; + authenticator["type"] = CRED_AUTHENTICATOR_TYPE_HASH; authenticator["algorithm"] = "md5"; LLMD5 pass((const U8 *)password.c_str()); char md5pass[33]; /* Flawfinder: ignore */ @@ -978,14 +978,42 @@ void LLPanelLogin::onClickConnect(void *) } updateStartSLURL(); std::string username = sInstance->childGetText("username_edit"); + + if(username.empty()) { + // user must type in something into the username field LLNotificationsUtil::add("MustHaveAccountToLogIn"); } else { - // has both first and last name typed - sInstance->mCallback(0, sInstance->mCallbackData); + LLPointer cred; + BOOL remember; + getFields(cred, remember); + std::string identifier_type; + cred->identifierType(identifier_type); + LLSD allowed_credential_types; + LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types); + + // check the typed in credential type against the credential types expected by the server. + for(LLSD::array_iterator i = allowed_credential_types.beginArray(); + i != allowed_credential_types.endArray(); + i++) + { + + if(i->asString() == identifier_type) + { + // yay correct credential type + sInstance->mCallback(0, sInstance->mCallbackData); + return; + } + } + + // Right now, maingrid is the only thing that is picky about + // credential format, as it doesn't yet allow account (single username) + // format creds. - Rox. James, we wanna fix the message when we change + // this. + LLNotificationsUtil::add("InvalidCredentialFormat"); } } } -- cgit v1.2.3 From 268a7dbad8e277519a0e10da2cceee25994410b0 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 29 Apr 2010 12:32:35 -0700 Subject: DEV-49491 - Multiple spaces between first and last name in username cause failed login --- indra/newview/llpanellogin.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 8d4f715c6e..8e86aa9c56 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -614,23 +614,30 @@ void LLPanelLogin::getFields(LLPointer& credential, authenticator["secret"] = password; } } - else if (separator_index == username.find_last_of(' ')) + else { - LL_INFOS2("Credentials", "Authentication") << "agent: " << username << LL_ENDL; - // traditional firstname / lastname - identifier["type"] = CRED_IDENTIFIER_TYPE_AGENT; - identifier["first_name"] = username.substr(0, separator_index); - identifier["last_name"] = username.substr(separator_index+1, username.npos); + std::string first = username.substr(0, separator_index); + std::string last = username.substr(separator_index, username.npos); + LLStringUtil::trim(last); - if (LLPanelLogin::sInstance->mPasswordModified) + if (last.find_first_of(' ') == last.npos) { - authenticator = LLSD::emptyMap(); - authenticator["type"] = CRED_AUTHENTICATOR_TYPE_HASH; - authenticator["algorithm"] = "md5"; - LLMD5 pass((const U8 *)password.c_str()); - char md5pass[33]; /* Flawfinder: ignore */ - pass.hex_digest(md5pass); - authenticator["secret"] = md5pass; + LL_INFOS2("Credentials", "Authentication") << "agent: " << username << LL_ENDL; + // traditional firstname / lastname + identifier["type"] = CRED_IDENTIFIER_TYPE_AGENT; + identifier["first_name"] = first; + identifier["last_name"] = last; + + if (LLPanelLogin::sInstance->mPasswordModified) + { + authenticator = LLSD::emptyMap(); + authenticator["type"] = CRED_AUTHENTICATOR_TYPE_HASH; + authenticator["algorithm"] = "md5"; + LLMD5 pass((const U8 *)password.c_str()); + char md5pass[33]; /* Flawfinder: ignore */ + pass.hex_digest(md5pass); + authenticator["secret"] = md5pass; + } } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); -- cgit v1.2.3 From 79f697ad513525893fe9ebab62bf2a61186342ec Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 21 May 2010 15:36:12 -0700 Subject: Fix for EXT-5667 (support window.open() in shared media so google docs will work). Moved the processing of clicks on _external and _blank targeted links from LLMediaCtrl to LLViewerMediaImpl. Removed LLMediaCtrl::setOpenInExternalBrowser() since that functionality is available through the use of the _external target attribute in web content. Removed LLMediaCtrl:: setOpenInInternalBrowser() since it was unimplemented and not used. Made the webkit media plugin set llqtwebkit's window open behavior to WOB_SIMULATE_BLANK_HREF_CLICK. This is #ifdefed out on Linux until we get a new Linux build of llqtwebkit. --- indra/newview/llpanellogin.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 508a58e74f..0009f7203a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -270,20 +270,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, web_browser->setTabStop(FALSE); // web_browser->navigateToLocalPage( "loading", "loading.html" ); - if (gSavedSettings.getBOOL("RegInClient")) - { - // need to follow links in the internal browser - web_browser->setOpenInExternalBrowser( false ); - - getChild("login_widgets")->setVisible(false); - } - else - { - // make links open in external browser - web_browser->setOpenInExternalBrowser( true ); - - reshapeBrowser(); - } + reshapeBrowser(); // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build( this ); @@ -487,7 +474,6 @@ void LLPanelLogin::showLoginWidgets() { sInstance->childSetVisible("login_widgets", true); LLMediaCtrl* web_browser = sInstance->getChild("login_html"); - web_browser->setOpenInExternalBrowser( true ); sInstance->reshapeBrowser(); // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = sInstance->getString("real_url"); -- cgit v1.2.3 From cf05f59dd923d623bc50135214a488a29664ab95 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 27 May 2010 17:20:29 -0700 Subject: EXT-7388 - --grid command-line argument does nothing Fix up overriding of --loginuri --loginpage --helperuri --- 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 0009f7203a..c8dae024cf 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -1164,7 +1164,8 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe) void LLPanelLogin::updateLoginPanelLinks() { - LLSD grid_data = LLGridManager::getInstance()->getGridInfo(); + LLSD grid_data; + LLGridManager::getInstance()->getGridInfo(grid_data); bool system_grid = grid_data.has(GRID_IS_SYSTEM_GRID_VALUE); // need to call through sInstance, as it's called from onSelectServer, which -- cgit v1.2.3