diff options
Diffstat (limited to 'OpenSim/Services/LLLoginService/LLLoginService.cs')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index c6e6768..250f8f1 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -77,7 +77,11 @@ namespace OpenSim.Services.LLLoginService | |||
77 | protected string m_MapTileURL; | 77 | protected string m_MapTileURL; |
78 | protected string m_SearchURL; | 78 | protected string m_SearchURL; |
79 | 79 | ||
80 | protected string m_AllowedClients; | ||
81 | protected string m_DeniedClients; | ||
82 | |||
80 | IConfig m_LoginServerConfig; | 83 | IConfig m_LoginServerConfig; |
84 | IConfig m_ClientsConfig; | ||
81 | 85 | ||
82 | public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) | 86 | public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) |
83 | { | 87 | { |
@@ -105,7 +109,10 @@ namespace OpenSim.Services.LLLoginService | |||
105 | m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); | 109 | m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); |
106 | m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); | 110 | m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); |
107 | m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); | 111 | m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); |
108 | 112 | ||
113 | m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); | ||
114 | m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); | ||
115 | |||
109 | // These are required; the others aren't | 116 | // These are required; the others aren't |
110 | if (accountService == string.Empty || authService == string.Empty) | 117 | if (accountService == string.Empty || authService == string.Empty) |
111 | throw new Exception("LoginService is missing service specifications"); | 118 | throw new Exception("LoginService is missing service specifications"); |
@@ -216,11 +223,38 @@ namespace OpenSim.Services.LLLoginService | |||
216 | bool success = false; | 223 | bool success = false; |
217 | UUID session = UUID.Random(); | 224 | UUID session = UUID.Random(); |
218 | 225 | ||
219 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} from {2} with user agent {3} starting in {4}", | 226 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", |
220 | firstName, lastName, clientIP.Address.ToString(), clientVersion, startLocation); | 227 | firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); |
221 | try | 228 | try |
222 | { | 229 | { |
223 | // | 230 | // |
231 | // Check client | ||
232 | // | ||
233 | if (m_AllowedClients != string.Empty) | ||
234 | { | ||
235 | Regex arx = new Regex(m_AllowedClients); | ||
236 | Match am = arx.Match(clientVersion); | ||
237 | |||
238 | if (!am.Success) | ||
239 | { | ||
240 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is not allowed", clientVersion); | ||
241 | return LLFailedLoginResponse.LoginBlockedProblem; | ||
242 | } | ||
243 | } | ||
244 | |||
245 | if (m_DeniedClients != string.Empty) | ||
246 | { | ||
247 | Regex drx = new Regex(m_DeniedClients); | ||
248 | Match dm = drx.Match(clientVersion); | ||
249 | |||
250 | if (dm.Success) | ||
251 | { | ||
252 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is denied", clientVersion); | ||
253 | return LLFailedLoginResponse.LoginBlockedProblem; | ||
254 | } | ||
255 | } | ||
256 | |||
257 | // | ||
224 | // Get the account and check that it exists | 258 | // Get the account and check that it exists |
225 | // | 259 | // |
226 | UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); | 260 | UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); |