aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client
diff options
context:
space:
mode:
authorMelanie2010-01-10 04:16:06 +0000
committerMelanie2010-01-10 04:16:06 +0000
commit1676e70dfe322381495b08ac1187ae9685f94e69 (patch)
treeb0b949af491811972dd866bff09f037e335c2b2b /OpenSim/Client
parentMerge branch 'master' into careminster (diff)
parentFix a small bug in login disable code (diff)
downloadopensim-SC-1676e70dfe322381495b08ac1187ae9685f94e69.zip
opensim-SC-1676e70dfe322381495b08ac1187ae9685f94e69.tar.gz
opensim-SC-1676e70dfe322381495b08ac1187ae9685f94e69.tar.bz2
opensim-SC-1676e70dfe322381495b08ac1187ae9685f94e69.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Client')
-rw-r--r--OpenSim/Client/Linden/LLProxyLoginModule.cs103
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginModule.cs15
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginService.cs19
3 files changed, 44 insertions, 93 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)
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
index 8047f74..e51eace 100644
--- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
+++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
@@ -56,21 +56,6 @@ namespace OpenSim.Client.Linden
56 protected bool authenticate; 56 protected bool authenticate;
57 protected string welcomeMessage; 57 protected string welcomeMessage;
58 58
59 public bool RegionLoginsEnabled
60 {
61 get
62 {
63 if (m_firstScene != null)
64 {
65 return m_firstScene.SceneGridService.RegionLoginsEnabled;
66 }
67 else
68 {
69 return false;
70 }
71 }
72 }
73
74 protected LLStandaloneLoginService m_loginService; 59 protected LLStandaloneLoginService m_loginService;
75 60
76 #region IRegionModule Members 61 #region IRegionModule Members
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs
index 122110d..9ab043a 100644
--- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs
+++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs
@@ -202,20 +202,15 @@ namespace OpenSim.Client.Linden
202 agent.Appearance = new AvatarAppearance(agent.AgentID); 202 agent.Appearance = new AvatarAppearance(agent.AgentID);
203 } 203 }
204 204
205 if (m_regionsConnector.RegionLoginsEnabled) 205 string reason;
206 bool success = m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason);
207 if (!success)
206 { 208 {
207 string reason; 209 response.ErrorReason = "key";
208 bool success = m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason); 210 response.ErrorMessage = reason;
209 if (!success)
210 {
211 response.ErrorReason = "key";
212 response.ErrorMessage = reason;
213 }
214 return success;
215 // return m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason);
216 } 211 }
217 212 return success;
218 return false; 213 // return m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent, out reason);
219 } 214 }
220 215
221 public override void LogOffUser(UserProfileData theUser, string message) 216 public override void LogOffUser(UserProfileData theUser, string message)