summaryrefslogtreecommitdiff
path: root/indra/newview/llviewernetwork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewernetwork.cpp')
-rw-r--r--indra/newview/llviewernetwork.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 9f6d606a22..a94ac5973b 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -34,7 +34,6 @@
#include "lltrans.h"
#include "llweb.h"
-
/// key used to store the grid, and the name attribute in the grid data
const std::string GRID_VALUE = "keyname";
/// the value displayed in the grid selector menu, and other human-oriented text
@@ -88,6 +87,13 @@ LLGridManager::LLGridManager()
// an attacker. Don't want someone snagging a password.
std::string grid_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
"grids.xml");
+
+ // fall back to app_settings/grids.xml if it's provided
+ if (!LLFile::isfile(grid_file))
+ {
+ grid_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
+ "grids.xml");
+ }
LL_DEBUGS("GridManager")<<LL_ENDL;
initialize(grid_file);
@@ -133,6 +139,13 @@ void LLGridManager::initialize(const std::string& grid_file)
"https://my.aditi.lindenlab.com/",
"Aditi");
+ // dump example grid file...
+ //llofstream out_llsd_xml;
+ //std::string default_grid_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml");
+ //out_llsd_xml.open(default_grid_file.c_str());
+ //LLSDSerialize::toPrettyXML(mGridList, out_llsd_xml);
+ //out_llsd_xml.close();
+
LLSD other_grids;
llifstream llsd_xml;
if (!grid_file.empty())
@@ -484,12 +497,19 @@ void LLGridManager::getLoginURIs(const std::string& grid, std::vector<std::strin
std::string grid_name = getGrid(grid);
if (!grid_name.empty())
{
- for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray();
- llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray();
- llsd_uri++)
- {
- uris.push_back(llsd_uri->asString());
- }
+ if (mGridList[grid_name][GRID_LOGIN_URI_VALUE].isArray())
+ {
+ for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray();
+ llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray();
+ llsd_uri++)
+ {
+ uris.push_back(llsd_uri->asString());
+ }
+ }
+ else
+ {
+ uris.push_back(mGridList[grid_name][GRID_LOGIN_URI_VALUE].asString());
+ }
}
else
{