diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/hippogridmanager.cpp | 21 | ||||
-rw-r--r-- | linden/indra/newview/hippogridmanager.h | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/linden/indra/newview/hippogridmanager.cpp b/linden/indra/newview/hippogridmanager.cpp index 4c46d3e..1dfb9ac 100644 --- a/linden/indra/newview/hippogridmanager.cpp +++ b/linden/indra/newview/hippogridmanager.cpp | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "llxorcipher.h" // saved password, MAC address | 51 | #include "llxorcipher.h" // saved password, MAC address |
52 | 52 | ||
53 | #include "hipporestrequest.h" | 53 | #include "hipporestrequest.h" |
54 | 54 | #include <boost/algorithm/string.hpp> | |
55 | 55 | ||
56 | // ******************************************************************** | 56 | // ******************************************************************** |
57 | // Global Variables | 57 | // Global Variables |
@@ -101,9 +101,27 @@ HippoGridInfo::HippoGridInfo(const std::string& gridNick) : | |||
101 | mGridNick = sanitizeGridNick(nick); | 101 | mGridNick = sanitizeGridNick(nick); |
102 | } | 102 | } |
103 | 103 | ||
104 | // Check if this really is a SecondLife grid, to prevent cheating. | ||
105 | void HippoGridInfo::checkLoginURIforSecondLifeness() | ||
106 | { | ||
107 | LLURI loginURI(mLoginURI); | ||
108 | std::string host = loginURI.hostName(); | ||
109 | size_t found; | ||
110 | |||
111 | boost::algorithm::to_lower(host); | ||
112 | |||
113 | found = host.rfind("lindenlab.com"); | ||
114 | if ((found + 13) == host.size()) | ||
115 | mPlatform = PLATFORM_SECONDLIFE; | ||
116 | found = host.rfind("secondlife.com"); | ||
117 | if ((found + 14) == host.size()) | ||
118 | mPlatform = PLATFORM_SECONDLIFE; | ||
119 | } | ||
120 | |||
104 | void HippoGridInfo::setPlatform(Platform platform) | 121 | void HippoGridInfo::setPlatform(Platform platform) |
105 | { | 122 | { |
106 | mPlatform = platform; | 123 | mPlatform = platform; |
124 | checkLoginURIforSecondLifeness(); | ||
107 | if (mPlatform == PLATFORM_SECONDLIFE) | 125 | if (mPlatform == PLATFORM_SECONDLIFE) |
108 | { | 126 | { |
109 | mCurrencySymbol = "L$"; | 127 | mCurrencySymbol = "L$"; |
@@ -136,6 +154,7 @@ void HippoGridInfo::setLoginURI(const std::string& loginURI) | |||
136 | { | 154 | { |
137 | std::string uri = loginURI; | 155 | std::string uri = loginURI; |
138 | mLoginURI = sanitizeURI(uri); | 156 | mLoginURI = sanitizeURI(uri); |
157 | checkLoginURIforSecondLifeness(); | ||
139 | } | 158 | } |
140 | 159 | ||
141 | void HippoGridInfo::setHelperURI(const std::string& helperURI) | 160 | void HippoGridInfo::setHelperURI(const std::string& helperURI) |
diff --git a/linden/indra/newview/hippogridmanager.h b/linden/indra/newview/hippogridmanager.h index c983c9d..8e77f99 100644 --- a/linden/indra/newview/hippogridmanager.h +++ b/linden/indra/newview/hippogridmanager.h | |||
@@ -165,6 +165,8 @@ private: | |||
165 | }; | 165 | }; |
166 | XmlState mXmlState; | 166 | XmlState mXmlState; |
167 | 167 | ||
168 | void checkLoginURIforSecondLifeness(); | ||
169 | |||
168 | static std::string sanitizeURI(std::string &uri); | 170 | static std::string sanitizeURI(std::string &uri); |
169 | void formatFee(std::string &fee, S32 cost, bool showFree) const; | 171 | void formatFee(std::string &fee, S32 cost, bool showFree) const; |
170 | 172 | ||