diff options
Diffstat (limited to 'indra/newview/lllogininstance.cpp')
-rw-r--r-- | indra/newview/lllogininstance.cpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 282a273be6..4bffe7feac 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -33,9 +33,6 @@ #include "stringize.h" #include "llsdserialize.h" -// llmessage (!) -#include "llfiltersd2xmlrpc.h" // for xml_escape_string() - // login #include "lllogin.h" @@ -60,7 +57,6 @@ #include "llsdserialize.h" #include "lltrans.h" -#include <boost/scoped_ptr.hpp> #include <boost/regex.hpp> #include <sstream> @@ -216,6 +212,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia request_params["read_critical"] = false; // handleTOSResponse request_params["last_exec_event"] = mLastExecEvent; request_params["last_exec_duration"] = mLastExecDuration; + request_params["last_exec_session_id"] = mLastAgentSessionId.asString(); request_params["mac"] = (char*)hashed_unique_id_string; request_params["version"] = LLVersionInfo::instance().getVersion(); request_params["channel"] = LLVersionInfo::instance().getChannel(); @@ -332,6 +329,15 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) LL_DEBUGS("LLLogin") << "reason " << reason_response << " message " << message_response << LL_ENDL; + + if (response.has("mfa_hash")) + { + mRequestData["params"]["mfa_hash"] = response["mfa_hash"]; + mRequestData["params"]["token"] = ""; + + saveMFAHash(response); + } + // For the cases of critical message or TOS agreement, // start the TOS dialog. The dialog response will be handled // by the LLLoginInstance::handleTOSResponse() callback. @@ -450,7 +456,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) gViewerWindow->setShowProgress(false); } - showMFAChallange(LLTrans::getString(response["message_id"])); + showMFAChallange(LLTrans::getString(response["message_id"].asString())); } else if( reason_response == "key" || reason_response == "presence" @@ -596,6 +602,24 @@ bool LLLoginInstance::handleMFAChallenge(LLSD const & notif, LLSD const & respon return true; } +void LLLoginInstance::saveMFAHash(LLSD const& response) +{ + std::string grid(LLGridManager::getInstance()->getGridId()); + std::string user_id(LLStartUp::getUserId()); + + // Only save mfa_hash for future logins if the user wants their info remembered. + if (response.has("mfa_hash") && gSavedSettings.getBOOL("RememberUser") && LLLoginInstance::getInstance()->saveMFA()) + { + gSecAPIHandler->addToProtectedMap("mfa_hash", grid, user_id, response["mfa_hash"]); + } + else if (!LLLoginInstance::getInstance()->saveMFA()) + { + gSecAPIHandler->removeFromProtectedMap("mfa_hash", grid, user_id); + } + // TODO(brad) - related to SL-17223 consider building a better interface that sync's automatically + gSecAPIHandler->syncProtectedMap(); +} + std::string construct_start_string() { std::string start; @@ -606,13 +630,14 @@ std::string construct_start_string() { // a startup URL was specified LLVector3 position = start_slurl.getPosition(); - std::string unescaped_start = + // NOTE - do not xml escape here, will get escaped properly later by LLSD::asXMLRPCValue() + // see secondlife/viewer#2395 + start = STRINGIZE( "uri:" << start_slurl.getRegion() << "&" << position[VX] << "&" << position[VY] << "&" << position[VZ]); - start = xml_escape_string(unescaped_start); break; } case LLSLURL::HOME_LOCATION: |