summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-11-04 09:12:32 +0000
committerLynx Linden <lynx@lindenlab.com>2009-11-04 09:12:32 +0000
commit068e1320399510afea2b2e2925c9755153d05423 (patch)
tree909dc0558a11ca412248b0e06468e4690cd22bf1 /indra/newview
parentb368f466248054517813922bb745f1da2a6a8df9 (diff)
DEV-41358 DEV-41362: Get an authentication token from login.cgi and
pass this token through to the search web pages via a q= query parameter in the search URL. This will let the search facility determine the user's maturity and teen settings. I also now escape the search string that the user typed in, 'cos they could type anything. Thanks to Mani for showing me how to get responses from login.cgi.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatersearch.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp
index bd9798c18e..97c573ddea 100644
--- a/indra/newview/llfloatersearch.cpp
+++ b/indra/newview/llfloatersearch.cpp
@@ -34,8 +34,8 @@
#include "llviewerprecompiledheaders.h"
#include "llfloatersearch.h"
#include "llmediactrl.h"
-#include "llagent.h"
-
+#include "lllogininstance.h"
+#include "lluri.h"
LLFloaterSearch::LLFloaterSearch(const LLSD& key) :
LLFloater(key),
@@ -116,15 +116,11 @@ void LLFloaterSearch::search(const LLSD &key)
// append the search query string
std::string search_text = key.has("id") ? key["id"].asString() : "";
- url += std::string("?q=") + search_text;
+ url += std::string("?q=") + LLURI::escape(search_text);
- // append the maturity and teen capabilities for this agent
- BOOL godlike = gAgent.isGodlike();
- bool mature_enabled = gAgent.canAccessMature() || godlike;
- bool adult_enabled = gAgent.canAccessAdult() || godlike;
- std::string mature = (mature_enabled) ? "True" : "False";
- std::string teen = (!adult_enabled) ? "True" : "False";
- url += "&t=" + teen + "&m=" + mature;
+ // append the permissions token that login.cgi gave us
+ LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token");
+ url += "&p=" + search_token.asString();
// and load the URL in the web view
mBrowser->navigateTo(url);