diff options
author | Michelle Argus | 2012-07-02 19:12:10 +0200 |
---|---|---|
committer | Melanie | 2012-07-02 18:45:11 +0100 |
commit | 3399596e0e2df2d0e260ba88ce8a0166de8cbff2 (patch) | |
tree | 6c51196af1255ef3568ca4c243d23dc54b9cdafa /OpenSim/Region | |
parent | Add preservation of running state of scripts when drag-copying. (diff) | |
download | opensim-SC-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.zip opensim-SC-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.gz opensim-SC-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.bz2 opensim-SC-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.xz |
Adds a list of viewers that are allowed or banned from the region.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 293c72a..2493df1 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_BanedViewers = 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 |
@@ -779,6 +782,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
779 | } | 782 | } |
780 | } | 783 | } |
781 | 784 | ||
785 | string grant = startupConfig.GetString("AllowedViewerList", String.Empty); | ||
786 | if (grant.Length > 0) | ||
787 | { | ||
788 | foreach (string viewer in grant.Split(',')) | ||
789 | { | ||
790 | m_AllowedViewers.Add(viewer.Trim().ToLower()); | ||
791 | } | ||
792 | } | ||
793 | |||
794 | grant = startupConfig.GetString("BannedViewerList", String.Empty); | ||
795 | if (grant.Length > 0) | ||
796 | { | ||
797 | foreach (string viewer in grant.Split(',')) | ||
798 | { | ||
799 | m_BanedViewers.Add(viewer.Trim().ToLower()); | ||
800 | } | ||
801 | } | ||
802 | |||
782 | MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime); | 803 | MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime); |
783 | m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup); | 804 | m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup); |
784 | m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); | 805 | m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); |
@@ -3417,6 +3438,50 @@ namespace OpenSim.Region.Framework.Scenes | |||
3417 | return false; | 3438 | return false; |
3418 | } | 3439 | } |
3419 | 3440 | ||
3441 | //Check if the viewer is banned or in the viewer access list | ||
3442 | //We check if the substring is listed for higher flexebility | ||
3443 | bool ViewerDenied = true; | ||
3444 | |||
3445 | //Check if the specific viewer is listed in the allowed viewer list | ||
3446 | if (m_AllowedViewers.Count > 0) | ||
3447 | { | ||
3448 | foreach (string viewer in m_AllowedViewers) | ||
3449 | { | ||
3450 | if (viewer == agent.Viewer.Substring(0, viewer.Length).Trim().ToLower()) | ||
3451 | { | ||
3452 | ViewerDenied = false; | ||
3453 | break; | ||
3454 | } | ||
3455 | } | ||
3456 | } | ||
3457 | else | ||
3458 | { | ||
3459 | ViewerDenied = false; | ||
3460 | } | ||
3461 | |||
3462 | //Check if the viewer is in the banned list | ||
3463 | if (m_BanedViewers.Count > 0) | ||
3464 | { | ||
3465 | foreach (string viewer in m_BanedViewers) | ||
3466 | { | ||
3467 | if (viewer == agent.Viewer.Substring(0, viewer.Length).Trim().ToLower()) | ||
3468 | { | ||
3469 | ViewerDenied = true; | ||
3470 | break; | ||
3471 | } | ||
3472 | } | ||
3473 | } | ||
3474 | |||
3475 | if (ViewerDenied) | ||
3476 | { | ||
3477 | m_log.DebugFormat( | ||
3478 | "[SCENE]: Access denied for {0} {1} using {2}", | ||
3479 | agent.firstname, agent.lastname, agent.Viewer); | ||
3480 | reason = "Access denied, your viewer is banned by the region owner"; | ||
3481 | return false; | ||
3482 | } | ||
3483 | |||
3484 | |||
3420 | ScenePresence sp = GetScenePresence(agent.AgentID); | 3485 | ScenePresence sp = GetScenePresence(agent.AgentID); |
3421 | 3486 | ||
3422 | if (sp != null && !sp.IsChildAgent) | 3487 | if (sp != null && !sp.IsChildAgent) |