summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-11-13 16:19:16 -0800
committercallum_linden <none@none>2015-11-13 16:19:16 -0800
commitec55f2cd10db838140b34b04717e9e50a6b736ce (patch)
treea388597838c75bc37430ca9d848902ac7a55e78e /indra
parent2091813119fbe915ad1427ad51202e67ff086180 (diff)
MAINT-5862 Fix Provide a way for new Linux users to accept ToS
Diffstat (limited to 'indra')
-rwxr-xr-xindra/cmake/00-Common.cmake3
-rwxr-xr-xindra/newview/llfloaterpreference.cpp11
-rwxr-xr-xindra/newview/llfloatertos.cpp26
-rwxr-xr-xindra/newview/llweb.cpp4
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_tos.xml15
5 files changed, 57 insertions, 2 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 1a3b6c5117..86fc2dfff5 100755
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -166,6 +166,9 @@ if (LINUX)
-pthread
)
+ # force this platform to accept TOS via external browser
+ add_definitions(-DEXTERNAL_TOS)
+
add_definitions(-DAPPID=secondlife)
add_definitions(-fvisibility=hidden)
# don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index dac610eda1..f7861fb4fd 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -108,6 +108,7 @@
#include "llpluginclassmedia.h"
#include "llteleporthistorystorage.h"
#include "llproxy.h"
+#include "llweb.h"
#include "lllogininstance.h" // to check if logged in yet
#include "llsdserialize.h"
@@ -1942,6 +1943,16 @@ BOOL LLPanelPreference::postBuild()
gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2));
}
+#ifdef EXTERNAL_TOS
+ LLRadioGroup* ext_browser_settings = getChild<LLRadioGroup>("preferred_browser_behavior");
+ if (ext_browser_settings)
+ {
+ // turn off ability to set external/internal browser
+ ext_browser_settings->setSelectedByValue(LLWeb::BROWSER_EXTERNAL_ONLY, true);
+ ext_browser_settings->setEnabled(false);
+ }
+#endif
+
apply();
return true;
}
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index ae33acb842..4cb1ca6cc0 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -46,7 +46,6 @@
#include "message.h"
#include "llstartup.h" // login_alert_done
-
LLFloaterTOS::LLFloaterTOS(const LLSD& data)
: LLModalDialog( data["message"].asString() ),
mMessage(data["message"].asString()),
@@ -85,7 +84,7 @@ protected:
{
if ( mParent )
{
- mParent->setSiteIsAlive( true );
+ mParent->setSiteIsAlive(true);
}
}
@@ -136,6 +135,20 @@ BOOL LLFloaterTOS::postBuild()
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
if ( web_browser )
{
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// remove exisiting UI and replace with a link to external page where users can accept ToS
+#ifdef EXTERNAL_TOS
+ LLTextBox* header = getChild<LLTextBox>("tos_heading");
+ if (header)
+ header->setVisible(false);
+
+ LLTextBox* external_prompt = getChild<LLTextBox>("external_tos_required");
+ if (external_prompt)
+ external_prompt->setVisible(true);
+
+ web_browser->setVisible(false);
+#else
web_browser->addObserver(this);
// Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer.
@@ -147,6 +160,7 @@ BOOL LLFloaterTOS::postBuild()
// All links from tos_html should be opened in external browser
media_plugin->setOverrideClickTarget("_external");
}
+#endif
}
return TRUE;
@@ -154,6 +168,13 @@ BOOL LLFloaterTOS::postBuild()
void LLFloaterTOS::setSiteIsAlive( bool alive )
{
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// force the regular HTML UI to deactivate so alternative is rendered instead.
+#ifdef EXTERNAL_TOS
+ mSiteAlive = false;
+#else
+
mSiteAlive = alive;
// only do this for TOS pages
@@ -182,6 +203,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
tos_agreement->setEnabled( true );
}
}
+#endif
}
LLFloaterTOS::~LLFloaterTOS()
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 0be6e49834..b37e41fb85 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -234,6 +234,9 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
//static
bool LLWeb::useExternalBrowser(const std::string &url)
{
+#ifdef EXTERNAL_TOS
+ return true;
+#else
if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY)
{
return true;
@@ -250,4 +253,5 @@ bool LLWeb::useExternalBrowser(const std::string &url)
return !(boost::regex_search(uri_string, matches, pattern));
}
return false;
+#endif
}
diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml
index af1617eb39..c5313391c6 100755
--- a/indra/newview/skins/default/xui/en/floater_tos.xml
+++ b/indra/newview/skins/default/xui/en/floater_tos.xml
@@ -57,6 +57,21 @@
width="552">
Please read the following Terms of Service and Privacy Policy carefully. To continue logging in to [SECOND_LIFE], you must accept the agreement.
</text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ font="SansSerif"
+ height="30"
+ layout="topleft"
+ left="16"
+ name="external_tos_required"
+ visible="false"
+ top="32"
+ word_wrap="true"
+ width="552">
+ To continue logging in to [SECOND_LIFE], you must accept the [https://id.secondlife.com/openid/login?return_to=https%3A%2F%2Fmy.secondlife.com%2Fopenid Terms of Service and Privacy Policy].
+ </text>
<web_browser
trusted_content="true"
follows="left|top"