diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e80dff7..7bea166 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3485,11 +3485,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3485 | agent.AgentID, agent.circuitcode, teleportFlags); | 3485 | agent.AgentID, agent.circuitcode, teleportFlags); |
3486 | 3486 | ||
3487 | reason = String.Empty; | 3487 | reason = String.Empty; |
3488 | if (!VerifyUserPresence(agent, out reason)) | 3488 | try |
3489 | { | ||
3490 | if (!VerifyUserPresence(agent, out reason)) | ||
3491 | return false; | ||
3492 | } | ||
3493 | catch (Exception e) | ||
3494 | { | ||
3495 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); | ||
3489 | return false; | 3496 | return false; |
3497 | } | ||
3490 | 3498 | ||
3491 | if (!AuthorizeUser(agent, out reason)) | 3499 | try |
3500 | { | ||
3501 | if (!AuthorizeUser(agent, out reason)) | ||
3502 | return false; | ||
3503 | } | ||
3504 | catch (Exception e) | ||
3505 | { | ||
3506 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); | ||
3492 | return false; | 3507 | return false; |
3508 | } | ||
3493 | 3509 | ||
3494 | m_log.InfoFormat( | 3510 | m_log.InfoFormat( |
3495 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", | 3511 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", |
@@ -3699,14 +3715,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3699 | } | 3715 | } |
3700 | } | 3716 | } |
3701 | 3717 | ||
3702 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) | 3718 | if (m_regInfo.EstateSettings != null) |
3703 | { | 3719 | { |
3704 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", | 3720 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) |
3705 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 3721 | { |
3706 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", | 3722 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
3707 | RegionInfo.RegionName); | 3723 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3708 | return false; | 3724 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", |
3725 | RegionInfo.RegionName); | ||
3726 | return false; | ||
3727 | } | ||
3709 | } | 3728 | } |
3729 | else | ||
3730 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); | ||
3710 | 3731 | ||
3711 | IGroupsModule groupsModule = | 3732 | IGroupsModule groupsModule = |
3712 | RequestModuleInterface<IGroupsModule>(); | 3733 | RequestModuleInterface<IGroupsModule>(); |
@@ -3718,21 +3739,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
3718 | GroupMembershipData[] GroupMembership = | 3739 | GroupMembershipData[] GroupMembership = |
3719 | groupsModule.GetMembershipData(agent.AgentID); | 3740 | groupsModule.GetMembershipData(agent.AgentID); |
3720 | 3741 | ||
3721 | for (int i = 0; i < GroupMembership.Length; i++) | 3742 | if (GroupMembership != null) |
3722 | agentGroups.Add(GroupMembership[i].GroupID); | 3743 | { |
3744 | for (int i = 0; i < GroupMembership.Length; i++) | ||
3745 | agentGroups.Add(GroupMembership[i].GroupID); | ||
3746 | } | ||
3747 | else | ||
3748 | m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); | ||
3723 | } | 3749 | } |
3724 | 3750 | ||
3725 | bool groupAccess = false; | 3751 | bool groupAccess = false; |
3726 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; | 3752 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; |
3727 | 3753 | ||
3728 | foreach (UUID group in estateGroups) | 3754 | if (estateGroups != null) |
3729 | { | 3755 | { |
3730 | if (agentGroups.Contains(group)) | 3756 | foreach (UUID group in estateGroups) |
3731 | { | 3757 | { |
3732 | groupAccess = true; | 3758 | if (agentGroups.Contains(group)) |
3733 | break; | 3759 | { |
3760 | groupAccess = true; | ||
3761 | break; | ||
3762 | } | ||
3734 | } | 3763 | } |
3735 | } | 3764 | } |
3765 | else | ||
3766 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | ||
3736 | 3767 | ||
3737 | if (!m_regInfo.EstateSettings.PublicAccess && | 3768 | if (!m_regInfo.EstateSettings.PublicAccess && |
3738 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && | 3769 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && |