aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2015-12-13 12:42:15 +0000
committerUbitUmarov2015-12-13 12:42:15 +0000
commit36e53b0e03d6499ec8465d75ea1c5b9bd3184401 (patch)
tree10cfb2b2f6fb616d605456fbf1764d2739362360 /OpenSim/Region
parentfix: if no groups module, deny access (diff)
downloadopensim-SC-36e53b0e03d6499ec8465d75ea1c5b9bd3184401.zip
opensim-SC-36e53b0e03d6499ec8465d75ea1c5b9bd3184401.tar.gz
opensim-SC-36e53b0e03d6499ec8465d75ea1c5b9bd3184401.tar.bz2
opensim-SC-36e53b0e03d6499ec8465d75ea1c5b9bd3184401.tar.xz
fix: do tell and log denied access to estate
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs38
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0691062..a5a6ef0 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4457,53 +4457,53 @@ namespace OpenSim.Region.Framework.Scenes
4457 return true; 4457 return true;
4458 4458
4459 // finally test groups 4459 // finally test groups
4460 bool groupAccess = false;
4460 4461
4461 if (m_groupsModule == null) // if no groups refuse 4462 // some say GOTO is ugly
4462 return false; 4463 if(m_groupsModule == null) // if no groups refuse
4464 goto Label_GroupsDone;
4463 4465
4464 UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; 4466 UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups;
4465 4467
4466 if (estateGroups == null) 4468 if(estateGroups == null)
4467 { 4469 {
4468 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate GroupMembership is null!"); 4470 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate GroupMembership is null!");
4469 return false; 4471 goto Label_GroupsDone;
4470 } 4472 }
4471 4473
4472 if(estateGroups.Length == 0) 4474 if(estateGroups.Length == 0)
4473 { 4475 goto Label_GroupsDone;
4474 return false;
4475 }
4476 4476
4477 List<UUID> agentGroups = new List<UUID>(); 4477 List<UUID> agentGroups = new List<UUID>();
4478 GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); 4478 GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
4479 4479
4480 if (GroupMembership == null) 4480 if(GroupMembership == null)
4481 { 4481 {
4482 m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); 4482 m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!");
4483 return false; 4483 goto Label_GroupsDone;
4484 } 4484 }
4485 4485
4486 if(GroupMembership.Length == 0) 4486 if(GroupMembership.Length == 0)
4487 return false; 4487 goto Label_GroupsDone;
4488 4488
4489 for (int i = 0; i < GroupMembership.Length; i++) 4489 for(int i = 0;i < GroupMembership.Length;i++)
4490 agentGroups.Add(GroupMembership[i].GroupID); 4490 agentGroups.Add(GroupMembership[i].GroupID);
4491 4491
4492 bool groupAccess = false; 4492 foreach(UUID group in estateGroups)
4493 foreach (UUID group in estateGroups)
4494 { 4493 {
4495 if (agentGroups.Contains(group)) 4494 if(agentGroups.Contains(group))
4496 { 4495 {
4497 groupAccess = true; 4496 groupAccess = true;
4498 break; 4497 break;
4499 } 4498 }
4500 } 4499 }
4501 4500
4501Label_GroupsDone:
4502 if (!groupAccess) 4502 if (!groupAccess)
4503 { 4503 {
4504 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", 4504 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate",
4505 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 4505 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
4506 reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", 4506 reason = String.Format("Denied access to private region {0}: You are do not have access to that region.",
4507 RegionInfo.RegionName); 4507 RegionInfo.RegionName);
4508 return false; 4508 return false;
4509 } 4509 }