diff options
Diffstat (limited to 'indra/newview/llviewerhome.cpp')
-rw-r--r-- | indra/newview/llviewerhome.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp index 58630978c4..6299b4fabd 100644 --- a/indra/newview/llviewerhome.cpp +++ b/indra/newview/llviewerhome.cpp @@ -35,12 +35,11 @@ #include "llviewerhome.h" #include "lllogininstance.h" +#include "llsd.h" #include "llui.h" #include "lluri.h" -#include "llsd.h" -#include "llversioninfo.h" #include "llviewercontrol.h" -#include "llviewernetwork.h" +#include "llweb.h" //static std::string LLViewerHome::getHomeURL() @@ -49,16 +48,12 @@ std::string LLViewerHome::getHomeURL() // this value from settings.xml and support various substitutions LLSD substitution; - substitution["VERSION"] = LLVersionInfo::getVersion(); - substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); - substitution["LANGUAGE"] = LLUI::getLanguage(); - substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); - substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); + substitution["AUTH_TOKEN"] = LLURI::escape(getAuthKey()); + // get the home URL and expand all of the substitutions + // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) std::string homeURL = gSavedSettings.getString("HomeSidePanelURL"); - LLStringUtil::format(homeURL, substitution); - - return homeURL; + return LLWeb::expandURLSubstitutions(homeURL, substitution); } //static @@ -67,7 +62,13 @@ std::string LLViewerHome::getAuthKey() // return the value of the (optional) auth token returned by login.cgi // this lets the server provide an authentication token that we can // blindly pass to the Home web page for it to perform authentication. - static const std::string authKeyName("home_sidetray_token"); - return LLLoginInstance::getInstance()->getResponse(authKeyName); + // We use "home_sidetray_token", and fallback to "auth_token" if not + // present. + LLSD auth_token = LLLoginInstance::getInstance()->getResponse("home_sidetray_token"); + if (auth_token.asString().empty()) + { + auth_token = LLLoginInstance::getInstance()->getResponse("auth_token"); + } + return auth_token.asString(); } |