diff options
| author | Samuel Kolb <skolb@lindenlab.com> | 2009-12-16 12:04:38 -0800 |
|---|---|---|
| committer | Samuel Kolb <skolb@lindenlab.com> | 2009-12-16 12:04:38 -0800 |
| commit | bedde40e9475f3772807b6fc48c3039d5993f578 (patch) | |
| tree | ae615503b4c917667a5a0b752dd0a6eca2927e9b /indra/newview/llviewerhome.cpp | |
| parent | d7533a2c0646826088d5c1f58c84604c0607b8aa (diff) | |
| parent | 0c0cb6fd79d12016b32bb74ce0e9d2c656143902 (diff) | |
local merge
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(); } |
