MAINT-5862 Fix Provide a way for new Linux users to accept ToS
parent
2091813119
commit
ec55f2cd10
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue