diff options
Diffstat (limited to 'OpenSim')
-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 9a3b0c9..9594e6b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3457,11 +3457,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3457 | agent.AgentID, agent.circuitcode, teleportFlags); | 3457 | agent.AgentID, agent.circuitcode, teleportFlags); |
3458 | 3458 | ||
3459 | reason = String.Empty; | 3459 | reason = String.Empty; |
3460 | if (!VerifyUserPresence(agent, out reason)) | 3460 | try |
3461 | { | ||
3462 | if (!VerifyUserPresence(agent, out reason)) | ||
3463 | return false; | ||
3464 | } | ||
3465 | catch (Exception e) | ||
3466 | { | ||
3467 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); | ||
3461 | return false; | 3468 | return false; |
3469 | } | ||
3462 | 3470 | ||
3463 | if (!AuthorizeUser(agent, out reason)) | 3471 | try |
3472 | { | ||
3473 | if (!AuthorizeUser(agent, out reason)) | ||
3474 | return false; | ||
3475 | } | ||
3476 | catch (Exception e) | ||
3477 | { | ||
3478 | m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); | ||
3464 | return false; | 3479 | return false; |
3480 | } | ||
3465 | 3481 | ||
3466 | m_log.InfoFormat( | 3482 | m_log.InfoFormat( |
3467 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", | 3483 | "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", |
@@ -3665,14 +3681,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3665 | } | 3681 | } |
3666 | } | 3682 | } |
3667 | 3683 | ||
3668 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) | 3684 | if (m_regInfo.EstateSettings != null) |
3669 | { | 3685 | { |
3670 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", | 3686 | if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) |
3671 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 3687 | { |
3672 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", | 3688 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
3673 | RegionInfo.RegionName); | 3689 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
3674 | return false; | 3690 | reason = String.Format("Denied access to region {0}: You have been banned from that region.", |
3691 | RegionInfo.RegionName); | ||
3692 | return false; | ||
3693 | } | ||
3675 | } | 3694 | } |
3695 | else | ||
3696 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); | ||
3676 | 3697 | ||
3677 | IGroupsModule groupsModule = | 3698 | IGroupsModule groupsModule = |
3678 | RequestModuleInterface<IGroupsModule>(); | 3699 | RequestModuleInterface<IGroupsModule>(); |
@@ -3684,21 +3705,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
3684 | GroupMembershipData[] GroupMembership = | 3705 | GroupMembershipData[] GroupMembership = |
3685 | groupsModule.GetMembershipData(agent.AgentID); | 3706 | groupsModule.GetMembershipData(agent.AgentID); |
3686 | 3707 | ||
3687 | for (int i = 0; i < GroupMembership.Length; i++) | 3708 | if (GroupMembership != null) |
3688 | agentGroups.Add(GroupMembership[i].GroupID); | 3709 | { |
3710 | for (int i = 0; i < GroupMembership.Length; i++) | ||
3711 | agentGroups.Add(GroupMembership[i].GroupID); | ||
3712 | } | ||
3713 | else | ||
3714 | m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); | ||
3689 | } | 3715 | } |
3690 | 3716 | ||
3691 | bool groupAccess = false; | 3717 | bool groupAccess = false; |
3692 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; | 3718 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; |
3693 | 3719 | ||
3694 | foreach (UUID group in estateGroups) | 3720 | if (estateGroups != null) |
3695 | { | 3721 | { |
3696 | if (agentGroups.Contains(group)) | 3722 | foreach (UUID group in estateGroups) |
3697 | { | 3723 | { |
3698 | groupAccess = true; | 3724 | if (agentGroups.Contains(group)) |
3699 | break; | 3725 | { |
3726 | groupAccess = true; | ||
3727 | break; | ||
3728 | } | ||
3700 | } | 3729 | } |
3701 | } | 3730 | } |
3731 | else | ||
3732 | m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); | ||
3702 | 3733 | ||
3703 | if (!m_regInfo.EstateSettings.PublicAccess && | 3734 | if (!m_regInfo.EstateSettings.PublicAccess && |
3704 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && | 3735 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && |