diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Client/Linden/LLProxyLoginModule.cs | 103 |
1 files changed, 37 insertions, 66 deletions
diff --git a/OpenSim/Client/Linden/LLProxyLoginModule.cs b/OpenSim/Client/Linden/LLProxyLoginModule.cs index 9075f15..14ce682 100644 --- a/OpenSim/Client/Linden/LLProxyLoginModule.cs +++ b/OpenSim/Client/Linden/LLProxyLoginModule.cs | |||
@@ -60,21 +60,6 @@ namespace OpenSim.Client.Linden | |||
60 | m_port = port; | 60 | m_port = port; |
61 | } | 61 | } |
62 | 62 | ||
63 | protected bool RegionLoginsEnabled | ||
64 | { | ||
65 | get | ||
66 | { | ||
67 | if (m_firstScene != null) | ||
68 | { | ||
69 | return m_firstScene.SceneGridService.RegionLoginsEnabled; | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | return false; | ||
74 | } | ||
75 | } | ||
76 | } | ||
77 | |||
78 | protected List<Scene> m_scenes = new List<Scene>(); | 63 | protected List<Scene> m_scenes = new List<Scene>(); |
79 | protected Scene m_firstScene; | 64 | protected Scene m_firstScene; |
80 | 65 | ||
@@ -239,67 +224,53 @@ namespace OpenSim.Client.Linden | |||
239 | agentData.child = false; | 224 | agentData.child = false; |
240 | } | 225 | } |
241 | 226 | ||
242 | if (!RegionLoginsEnabled) | 227 | bool success = false; |
243 | { | 228 | string denyMess = ""; |
244 | m_log.InfoFormat( | ||
245 | "[CLIENT]: Denying access for user {0} {1} because region login is currently disabled", | ||
246 | agentData.firstname, agentData.lastname); | ||
247 | 229 | ||
248 | Hashtable respdata = new Hashtable(); | 230 | Scene scene; |
249 | respdata["success"] = "FALSE"; | 231 | if (TryGetRegion(regionHandle, out scene)) |
250 | respdata["reason"] = "region login currently disabled"; | ||
251 | resp.Value = respdata; | ||
252 | } | ||
253 | else | ||
254 | { | 232 | { |
255 | bool success = false; | 233 | if (scene.RegionInfo.EstateSettings.IsBanned(agentData.AgentID)) |
256 | string denyMess = ""; | 234 | { |
257 | 235 | denyMess = "User is banned from this region"; | |
258 | Scene scene; | 236 | m_log.InfoFormat( |
259 | if (TryGetRegion(regionHandle, out scene)) | 237 | "[CLIENT]: Denying access for user {0} {1} because user is banned", |
238 | agentData.firstname, agentData.lastname); | ||
239 | } | ||
240 | else | ||
260 | { | 241 | { |
261 | if (scene.RegionInfo.EstateSettings.IsBanned(agentData.AgentID)) | 242 | string reason; |
243 | if (scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason)) | ||
262 | { | 244 | { |
263 | denyMess = "User is banned from this region"; | 245 | success = true; |
264 | m_log.InfoFormat( | ||
265 | "[CLIENT]: Denying access for user {0} {1} because user is banned", | ||
266 | agentData.firstname, agentData.lastname); | ||
267 | } | 246 | } |
268 | else | 247 | else |
269 | { | 248 | { |
270 | string reason; | 249 | denyMess = String.Format("Login refused by region: {0}", reason); |
271 | if (scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason)) | 250 | m_log.InfoFormat( |
272 | { | 251 | "[CLIENT]: Denying access for user {0} {1} because user connection was refused by the region", |
273 | success = true; | 252 | agentData.firstname, agentData.lastname); |
274 | } | ||
275 | else | ||
276 | { | ||
277 | denyMess = String.Format("Login refused by region: {0}", reason); | ||
278 | m_log.InfoFormat( | ||
279 | "[CLIENT]: Denying access for user {0} {1} because user connection was refused by the region", | ||
280 | agentData.firstname, agentData.lastname); | ||
281 | } | ||
282 | } | 253 | } |
283 | |||
284 | } | ||
285 | else | ||
286 | { | ||
287 | denyMess = "Region not found"; | ||
288 | } | 254 | } |
289 | 255 | ||
290 | if (success) | 256 | } |
291 | { | 257 | else |
292 | Hashtable respdata = new Hashtable(); | 258 | { |
293 | respdata["success"] = "TRUE"; | 259 | denyMess = "Region not found"; |
294 | resp.Value = respdata; | 260 | } |
295 | } | 261 | |
296 | else | 262 | if (success) |
297 | { | 263 | { |
298 | Hashtable respdata = new Hashtable(); | 264 | Hashtable respdata = new Hashtable(); |
299 | respdata["success"] = "FALSE"; | 265 | respdata["success"] = "TRUE"; |
300 | respdata["reason"] = denyMess; | 266 | resp.Value = respdata; |
301 | resp.Value = respdata; | 267 | } |
302 | } | 268 | else |
269 | { | ||
270 | Hashtable respdata = new Hashtable(); | ||
271 | respdata["success"] = "FALSE"; | ||
272 | respdata["reason"] = denyMess; | ||
273 | resp.Value = respdata; | ||
303 | } | 274 | } |
304 | } | 275 | } |
305 | catch (Exception e) | 276 | catch (Exception e) |