From 3b8acd4f41ecc453a3b09428e8a9d68b379da2e6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 11 Aug 2011 14:17:28 -0700 Subject: EXP-1079 FIX User is not logged out immediately inworld when selecting to change modes and restart while logged in used requestQuit instead of forceQuit --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ebd7c6c688..b29821479b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7819,7 +7819,7 @@ class LLChangeMode : public view_listener_t { case 0: gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file); - LLAppViewer::instance()->forceQuit(); + LLAppViewer::instance()->requestQuit(); break; case 1: default: -- cgit v1.2.3 From dc8944ac49332fb1eda044614430722093086bec Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 15 Aug 2011 11:10:00 -0700 Subject: EXP-1081 FIX add search auth token as cookie instead of query param moved all parameters other than search query to base64 encoded llsd --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloatersearch.cpp | 65 +++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 01842d1037..f2111d288d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4004,7 +4004,7 @@ Type String Value - http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + http://pdp38.lindenlab.com:9091/viewer/[CATEGORY]/?q=[QUERY] WebProfileURL diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 2a946b1edf..23cc23376f 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -27,16 +27,26 @@ #include "llviewerprecompiledheaders.h" +#include "llappviewer.h" +#include "llbase64.h" #include "llcommandhandler.h" #include "llfloaterreg.h" #include "llfloatersearch.h" #include "llmediactrl.h" #include "llnotificationsutil.h" +#include "llparcel.h" +#include "llplugincookiestore.h" #include "lllogininstance.h" #include "lluri.h" #include "llagent.h" +#include "llsdserialize.h" #include "llui.h" #include "llviewercontrol.h" +#include "llviewerregion.h" +#include "llversioninfo.h" +#include "llviewermedia.h" +#include "llviewernetwork.h" +#include "llviewerparcelmgr.h" #include "llweb.h" // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps @@ -168,12 +178,14 @@ void LLFloaterSearch::search(const SearchQuery &p) // add the permissions token that login.cgi gave us // We use "search_token", and fallback to "auth_token" if not present. + LLSD search_cookie; + LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token"); if (search_token.asString().empty()) { search_token = LLLoginInstance::getInstance()->getResponse("auth_token"); } - subs["AUTH_TOKEN"] = search_token.asString(); + search_cookie["AUTH_TOKEN"] = search_token.asString(); // add the user's preferred maturity (can be changed via prefs) std::string maturity; @@ -189,10 +201,57 @@ void LLFloaterSearch::search(const SearchQuery &p) { maturity = "13"; // PG } - subs["MATURITY"] = maturity; + search_cookie["MATURITY"] = maturity; // add the user's god status - subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; + search_cookie["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; + search_cookie["VERSION"] = LLVersionInfo::getVersion(); + search_cookie["VERSION_MAJOR"] = LLVersionInfo::getMajor(); + search_cookie["VERSION_MINOR"] = LLVersionInfo::getMinor(); + search_cookie["VERSION_PATCH"] = LLVersionInfo::getPatch(); + search_cookie["VERSION_BUILD"] = LLVersionInfo::getBuild(); + search_cookie["CHANNEL"] = LLVersionInfo::getChannel(); + search_cookie["GRID"] = LLGridManager::getInstance()->getGridLabel(); + search_cookie["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + search_cookie["SESSION_ID"] = gAgent.getSessionID(); + search_cookie["FIRST_LOGIN"] = gAgent.isFirstLogin(); + + std::string lang = LLUI::getLanguage(); + if (lang == "en-us") + { + lang = "en"; + } + search_cookie["LANGUAGE"] = lang; + + // find the region ID + LLUUID region_id; + LLViewerRegion *region = gAgent.getRegion(); + if (region) + { + region_id = region->getRegionID(); + } + search_cookie["REGION_ID"] = region_id; + + // find the parcel local ID + S32 parcel_id = 0; + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + parcel_id = parcel->getLocalID(); + } + search_cookie["PARCEL_ID"] = llformat("%d", parcel_id); + + std::stringstream cookie_string_stream; + LLSDSerialize::toXML(search_cookie, cookie_string_stream); + std::string cookie_string = cookie_string_stream.str(); + + U8* cookie_string_buffer = (U8*)cookie_string.c_str(); + std::string cookie_value = LLBase64::encode(cookie_string_buffer, cookie_string.size()); + + // for staging services + LLViewerMedia::getCookieStore()->setCookiesFromHost(std::string("viewer_session_info=") + cookie_value, ".lindenlab.com"); + // for live services + LLViewerMedia::getCookieStore()->setCookiesFromHost(std::string("viewer_session_info=") + cookie_value, ".secondlife.com"); // get the search URL and expand all of the substitutions // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) -- cgit v1.2.3 From 72ffcd147a85cb727d194a4c57360a1a69890cb1 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 15 Aug 2011 11:12:51 -0700 Subject: EXP-1081 FIX add search auth token as cookie instead of query param fixed search url --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f2111d288d..33541b559b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4004,7 +4004,7 @@ Type String Value - http://pdp38.lindenlab.com:9091/viewer/[CATEGORY]/?q=[QUERY] + http://search-beta.secondlife.com/viewer/[CATEGORY]/?q=[QUERY] WebProfileURL -- cgit v1.2.3