summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/lllogininstance.cpp41
-rw-r--r--indra/newview/lllogininstance.h1
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml333
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp14
4 files changed, 56 insertions, 333 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 229703bb39..b953534e13 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -31,6 +31,7 @@
// llcommon
#include "llevents.h"
#include "stringize.h"
+#include "llsdserialize.h"
// llmessage (!)
#include "llfiltersd2xmlrpc.h" // for xml_escape_string()
@@ -47,12 +48,10 @@
#include "llstartup.h"
#include "llfloaterreg.h"
#include "llnotifications.h"
+#include "llnotificationsutil.h"
#include "llwindow.h"
#include "llviewerwindow.h"
#include "llprogressview.h"
-#if LL_LINUX
-#include "lltrans.h"
-#endif
#include "llsecapi.h"
#include "llstartup.h"
#include "llmachineid.h"
@@ -250,8 +249,6 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event)
void LLLoginInstance::handleLoginFailure(const LLSD& event)
{
-
-
// Login has failed.
// Figure out why and respond...
LLSD response = event["data"];
@@ -302,13 +299,42 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
boost::bind(&LLLoginInstance::handleTOSResponse,
this, _1, "read_critical"));
}
+ else if(reason_response == "update")
+ {
+ // This shouldn't happen - the viewer manager should have forced an update;
+ // possibly the user ran the viewer directly and bypassed the update check
+ std::string required_version = response["message_args"]["VERSION"];
+ LL_WARNS() << "Login failed because an update to version " << required_version << " is required." << LL_ENDL;
+
+ if (gViewerWindow)
+ gViewerWindow->setShowProgress(FALSE);
+
+ LLSD data(LLSD::emptyMap());
+ data["VERSION"] = required_version;
+ LLNotificationsUtil::add("RequiredUpdate", data, LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2));
+ }
+ else if(reason_response == "key")
+ {
+ // this is a password problem or other restriction
+ // an appropriate message has already been displayed
+ attemptComplete();
+ }
else
{
- LL_INFOS() << "LLLoginInstance::handleLoginFailure attemptComplete" << LL_ENDL;
- attemptComplete();
+ LL_WARNS() << "Login failed for an unknown reason: " << LLSDOStreamer<LLSDNotationFormatter>(response) << LL_ENDL;
+
+ if (gViewerWindow)
+ gViewerWindow->setShowProgress(FALSE);
+
+ LLNotificationsUtil::add("LoginFailedUnknown", LLSD::emptyMap(), LLSD::emptyMap(), boost::bind(&LLLoginInstance::handleLoginDisallowed, this, _1, _2));
}
}
+void LLLoginInstance::handleLoginDisallowed(const LLSD& notification, const LLSD& response)
+{
+ attemptComplete();
+}
+
void LLLoginInstance::handleLoginSuccess(const LLSD& event)
{
LL_INFOS() << "LLLoginInstance::handleLoginSuccess" << LL_ENDL;
@@ -363,6 +389,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
return true;
}
+
std::string construct_start_string()
{
std::string start;
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
index 67d0f01ba6..f53c02c6e1 100644
--- a/indra/newview/lllogininstance.h
+++ b/indra/newview/lllogininstance.h
@@ -77,6 +77,7 @@ private:
void handleLoginSuccess(const LLSD& event);
void handleDisconnect(const LLSD& event);
void handleIndeterminate(const LLSD& event);
+ void handleLoginDisallowed(const LLSD& notification, const LLSD& response);
bool handleTOSResponse(bool v, const std::string& key);
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1a7c9229a3..c1e82d7be3 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3825,345 +3825,26 @@ Please set the object for sale and try again.
<notification
icon="alertmodal.tga"
- name="FinishedRawDownload"
+ name="RequiredUpdate"
type="alertmodal">
-Finished download of raw terrain file to:
-[DOWNLOAD_PATH].
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadWindowsMandatory"
- type="alertmodal">
-A new version of [APP_NAME] is available.
-[MESSAGE]
-You must download this update to use [APP_NAME].
+Version [VERSION] is required for login.
+This should have been updated for you but apparently was not.
+Please download from https://secondlife.com/support/downloads/
<tag>confirm</tag>
<usetemplate
- name="okcancelbuttons"
- notext="Quit"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadWindows"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadWindowsReleaseForDownload"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadLinuxMandatory"
- type="alertmodal">
-A new version of [APP_NAME] is available.
-[MESSAGE]
-You must download this update to use [APP_NAME].
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Quit"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadLinux"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadLinuxReleaseForDownload"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadMacMandatory"
- type="alertmodal">
-A new version of [APP_NAME] is available.
-[MESSAGE]
-You must download this update to use [APP_NAME].
-
-Download to your Applications folder?
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Quit"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadMac"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
-
-Download to your Applications folder?
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadMacReleaseForDownload"
- type="alertmodal">
-An updated version of [APP_NAME] is available.
-[MESSAGE]
-This update is not required, but we suggest you install it to improve performance and stability.
-
-Download to your Applications folder?
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Continue"
- yestext="Download"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="FailedUpdateInstall"
- type="alertmodal">
-An error occurred installing the viewer update.
-Please download and install the latest viewer from
-http://secondlife.com/download.
- <usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
- name="FailedRequiredUpdateInstall"
- type="alertmodal">
-We were unable to install a required update.
-You will be unable to log in until [APP_NAME] has been updated.
-
-Please download and install the latest viewer from
-http://secondlife.com/download.
- <tag>fail</tag>
- <usetemplate
- name="okbutton"
- yestext="Quit"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="UpdaterServiceNotRunning"
+ name="LoginFailedUnknown"
type="alertmodal">
-There is a required update for your Second Life Installation.
-
-You may download this update from http://www.secondlife.com/downloads
-or you can install it now.
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Quit Second Life"
- yestext="Download and install now"/>
- </notification>
-
- <notification
- icon="notify.tga"
- name="DownloadBackgroundTip"
- type="notify">
-We have downloaded an update to your [APP_NAME] installation.
-Version [VERSION] [[INFO_URL] Information about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Later..."
- yestext="Install now and restart [APP_NAME]"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="DownloadBackgroundDialog"
- type="alertmodal">
-We have downloaded an update to your [APP_NAME] installation.
- Version [VERSION] [[INFO_URL] Information about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Later..."
- yestext="Install now and restart [APP_NAME]"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="RequiredUpdateDownloadedVerboseDialog"
- type="alertmodal"
- force_urls_external="true">
-We have downloaded a required software update.
-Version [VERSION] [[INFO_URL] Information about this update]
-
-We must restart [APP_NAME] to install the update.
+Login failed for an unrecognized reason.
<tag>confirm</tag>
<usetemplate
name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="RequiredUpdateDownloadedDialog"
- type="alertmodal"
- force_urls_external="true">
-We must restart [APP_NAME] to install the update.
-[[INFO_URL] Information about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="notify.tga"
- name="OtherChannelDownloadBackgroundTip"
- type="notify">
-We have downloaded an update to your [APP_NAME] installation.
-Version [VERSION]
-This experimental viewer has been replaced by a [NEW_CHANNEL] viewer;
-see [[INFO_URL] for details about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Later..."
- yestext="Install now and restart [APP_NAME]"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="OtherChannelDownloadBackgroundDialog"
- type="alertmodal">
-We have downloaded an update to your [APP_NAME] installation.
-Version [VERSION]
-This experimental viewer has been replaced by a [NEW_CHANNEL] viewer;
-see [[INFO_URL] Information about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okcancelbuttons"
- notext="Later..."
- yestext="Install now and restart [APP_NAME]"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="OtherChannelRequiredUpdateDownloadedVerboseDialog"
- type="alertmodal"
- force_urls_external="true">
-We have downloaded a required software update.
-Version [VERSION]
-This experimental viewer has been replaced by a [NEW_CHANNEL] viewer;
-see [[INFO_URL] Information about this update]
-
-We must restart [APP_NAME] to install the update.
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="OtherChannelRequiredUpdateDownloadedDialog"
- type="alertmodal"
- force_urls_external="true">
-We must restart [APP_NAME] to install the update.
-This experimental viewer has been replaced by a [NEW_CHANNEL] viewer;
-see [[INFO_URL] Information about this update]
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="UpdateDownloadInProgress"
- type="alertmodal">
-An update is available!
-It's downloading in the background and we will prompt you to restart your viewer to finish installing it as soon as it's ready.
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="UpdateDownloadComplete"
- type="alertmodal">
-An update was downloaded. It will be installed during restart.
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="UpdateDeferred"
- type="alertmodal">
-An update was downloaded that you previously chose to skip or defer to the next start up.
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- name="UpdateViewerUpToDate"
- type="alertmodal">
-Your viewer is up to date!
-If you can't wait to try out the latest features and fixes, check out the Alternate Viewers page. http://wiki.secondlife.com/wiki/Linden_Lab_Official:Alternate_Viewers.
- <tag>confirm</tag>
- <usetemplate
- name="okbutton"
- yestext="OK"/>
+ yestext="Sorry"/>
</notification>
<notification
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index 3b7ec48d61..85a117a96b 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -40,6 +40,7 @@
// other Linden headers
#include "../test/lltut.h"
#include "llevents.h"
+#include "llnotificationsutil.h"
#if defined(LL_WINDOWS)
#pragma warning(disable: 4355) // using 'this' in base-class ctor initializer expr
@@ -112,6 +113,19 @@ void LLCredential::authenticatorType(std::string &idType)
{
}
+LLNotificationPtr LLNotificationsUtil::add(const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload,
+ boost::function<void (const LLSD&, const LLSD&)> functor)
+{
+ return LLNotificationPtr((LLNotification*)NULL);
+}
+
+LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& args)
+{
+ return LLNotificationPtr((LLNotification*)NULL);
+}
+
//-----------------------------------------------------------------------------
#include "../llviewernetwork.h"
LLGridManager::~LLGridManager()