aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie2012-07-05 22:17:39 +0100
committerMelanie2012-07-05 22:17:39 +0100
commit5776351f6abd4ca8cca7344b26ab989425c67687 (patch)
treefe0c0355ceb25db47125525b9b72d2077cc3c29f /OpenSim/Region/Framework/Scenes/Scene.cs
parentMerge branch 'master' into careminster (diff)
parentminor: add client name to various login service log messages to disambiguate ... (diff)
downloadopensim-SC_OLD-5776351f6abd4ca8cca7344b26ab989425c67687.zip
opensim-SC_OLD-5776351f6abd4ca8cca7344b26ab989425c67687.tar.gz
opensim-SC_OLD-5776351f6abd4ca8cca7344b26ab989425c67687.tar.bz2
opensim-SC_OLD-5776351f6abd4ca8cca7344b26ab989425c67687.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 78edeb0..a63ed13 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -120,6 +120,9 @@ namespace OpenSim.Region.Framework.Scenes
120 { 120 {
121 get { return m_defaultDrawDistance; } 121 get { return m_defaultDrawDistance; }
122 } 122 }
123
124 private List<string> m_AllowedViewers = new List<string>();
125 private List<string> m_BannedViewers = new List<string>();
123 126
124 // TODO: need to figure out how allow client agents but deny 127 // TODO: need to figure out how allow client agents but deny
125 // root agents when ACL denies access to root agent 128 // root agents when ACL denies access to root agent
@@ -808,6 +811,24 @@ namespace OpenSim.Region.Framework.Scenes
808 } 811 }
809 } 812 }
810 813
814 string grant = startupConfig.GetString("AllowedViewerList", String.Empty);
815 if (grant.Length > 0)
816 {
817 foreach (string viewer in grant.Split(','))
818 {
819 m_AllowedViewers.Add(viewer.Trim().ToLower());
820 }
821 }
822
823 grant = startupConfig.GetString("BannedViewerList", String.Empty);
824 if (grant.Length > 0)
825 {
826 foreach (string viewer in grant.Split(','))
827 {
828 m_BannedViewers.Add(viewer.Trim().ToLower());
829 }
830 }
831
811 MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime); 832 MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime);
812 m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup); 833 m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup);
813 m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); 834 m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
@@ -3571,6 +3592,50 @@ namespace OpenSim.Region.Framework.Scenes
3571 return false; 3592 return false;
3572 } 3593 }
3573 3594
3595 //Check if the viewer is banned or in the viewer access list
3596 //We check if the substring is listed for higher flexebility
3597 bool ViewerDenied = true;
3598
3599 //Check if the specific viewer is listed in the allowed viewer list
3600 if (m_AllowedViewers.Count > 0)
3601 {
3602 foreach (string viewer in m_AllowedViewers)
3603 {
3604 if (viewer == agent.Viewer.Substring(0, viewer.Length).Trim().ToLower())
3605 {
3606 ViewerDenied = false;
3607 break;
3608 }
3609 }
3610 }
3611 else
3612 {
3613 ViewerDenied = false;
3614 }
3615
3616 //Check if the viewer is in the banned list
3617 if (m_BannedViewers.Count > 0)
3618 {
3619 foreach (string viewer in m_BannedViewers)
3620 {
3621 if (viewer == agent.Viewer.Substring(0, viewer.Length).Trim().ToLower())
3622 {
3623 ViewerDenied = true;
3624 break;
3625 }
3626 }
3627 }
3628
3629 if (ViewerDenied)
3630 {
3631 m_log.DebugFormat(
3632 "[SCENE]: Access denied for {0} {1} using {2}",
3633 agent.firstname, agent.lastname, agent.Viewer);
3634 reason = "Access denied, your viewer is banned by the region owner";
3635 return false;
3636 }
3637
3638
3574 ScenePresence sp = GetScenePresence(agent.AgentID); 3639 ScenePresence sp = GetScenePresence(agent.AgentID);
3575 3640
3576 if (sp != null && !sp.IsChildAgent) 3641 if (sp != null && !sp.IsChildAgent)