diff options
author | Oren Hurvitz | 2014-05-18 16:10:18 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-05-19 11:11:30 +0100 |
commit | dd30a29ba07a181d5c8f5773140a7247a0066510 (patch) | |
tree | c5e2844ce29947dabd7944a8551c35afc5d1c359 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Better error-handling and logging in case User Profile requests fail (diff) | |
download | opensim-SC_OLD-dd30a29ba07a181d5c8f5773140a7247a0066510.zip opensim-SC_OLD-dd30a29ba07a181d5c8f5773140a7247a0066510.tar.gz opensim-SC_OLD-dd30a29ba07a181d5c8f5773140a7247a0066510.tar.bz2 opensim-SC_OLD-dd30a29ba07a181d5c8f5773140a7247a0066510.tar.xz |
Return more specific error messages if an attempt to enter a region fails due to permissions (in QueryAccess and IsAuthorizedForRegion)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e6887b4..1115399 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3865,7 +3865,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3865 | if (!AuthorizationService.IsAuthorizedForRegion( | 3865 | if (!AuthorizationService.IsAuthorizedForRegion( |
3866 | agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason)) | 3866 | agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason)) |
3867 | { | 3867 | { |
3868 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because {4}", | 3868 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because: {4}", |
3869 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason); | 3869 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason); |
3870 | 3870 | ||
3871 | return false; | 3871 | return false; |
@@ -5465,7 +5465,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5465 | /// <returns></returns> | 5465 | /// <returns></returns> |
5466 | public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason) | 5466 | public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason) |
5467 | { | 5467 | { |
5468 | reason = "You are banned from the region"; | 5468 | reason = string.Empty; |
5469 | 5469 | ||
5470 | if (Permissions.IsGod(agentID)) | 5470 | if (Permissions.IsGod(agentID)) |
5471 | { | 5471 | { |
@@ -5525,6 +5525,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5525 | catch (Exception e) | 5525 | catch (Exception e) |
5526 | { | 5526 | { |
5527 | m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} "+ e.StackTrace, e.Message); | 5527 | m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} "+ e.StackTrace, e.Message); |
5528 | reason = "Error authorizing agent: " + e.Message; | ||
5528 | return false; | 5529 | return false; |
5529 | } | 5530 | } |
5530 | 5531 | ||
@@ -5568,6 +5569,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5568 | if (!TestLandRestrictions(agentID, out reason, ref posX, ref posY)) | 5569 | if (!TestLandRestrictions(agentID, out reason, ref posX, ref posY)) |
5569 | { | 5570 | { |
5570 | // m_log.DebugFormat("[SCENE]: Denying {0} because they are banned on all parcels", agentID); | 5571 | // m_log.DebugFormat("[SCENE]: Denying {0} because they are banned on all parcels", agentID); |
5572 | reason = "You are banned from the region on all parcels"; | ||
5571 | return false; | 5573 | return false; |
5572 | } | 5574 | } |
5573 | } | 5575 | } |
@@ -5575,13 +5577,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
5575 | { | 5577 | { |
5576 | ILandObject land = LandChannel.GetLandObject(position.X, position.Y); | 5578 | ILandObject land = LandChannel.GetLandObject(position.X, position.Y); |
5577 | if (land == null) | 5579 | if (land == null) |
5580 | { | ||
5581 | reason = "No parcel found"; | ||
5578 | return false; | 5582 | return false; |
5583 | } | ||
5579 | 5584 | ||
5580 | bool banned = land.IsBannedFromLand(agentID); | 5585 | bool banned = land.IsBannedFromLand(agentID); |
5581 | bool restricted = land.IsRestrictedFromLand(agentID); | 5586 | bool restricted = land.IsRestrictedFromLand(agentID); |
5582 | 5587 | ||
5583 | if (banned || restricted) | 5588 | if (banned || restricted) |
5589 | { | ||
5590 | if (banned) | ||
5591 | reason = "You are banned from the parcel"; | ||
5592 | else | ||
5593 | reason = "The parcel is restricted"; | ||
5584 | return false; | 5594 | return false; |
5595 | } | ||
5585 | } | 5596 | } |
5586 | 5597 | ||
5587 | reason = String.Empty; | 5598 | reason = String.Empty; |