aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMichelle Argus2012-07-02 19:12:10 +0200
committerMelanie2012-07-02 18:45:11 +0100
commit3399596e0e2df2d0e260ba88ce8a0166de8cbff2 (patch)
tree6c51196af1255ef3568ca4c243d23dc54b9cdafa
parentAdd preservation of running state of scripts when drag-copying. (diff)
downloadopensim-SC_OLD-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.zip
opensim-SC_OLD-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.gz
opensim-SC_OLD-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.bz2
opensim-SC_OLD-3399596e0e2df2d0e260ba88ce8a0166de8cbff2.tar.xz
Adds a list of viewers that are allowed or banned from the region.
Signed-off-by: Melanie <melanie@t-data.com>
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs65
-rw-r--r--[-rwxr-xr-x]bin/OpenSim.ini.example17
2 files changed, 82 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)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index aa29c07..741877e 100755..100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -254,6 +254,23 @@
254 ;; default is false 254 ;; default is false
255 ; TelehubAllowLandmark = false 255 ; TelehubAllowLandmark = false
256 256
257 ;# Comma separated list of viewers which may gain access to the regions.
258 ;; One can use a Substring of the viewer name to enable only certain subversions
259 ;; Example: Agent uses the viewer "Imprudence 1.3.2.0"
260 ;; - "Imprudence" has access
261 ;; - "Imprudence 1.3" has access
262 ;; - "Imprudence 1.3.1" has no access
263 ;; AllowedViewerList =
264
265 ;# Comma separated list of viewers which may not gain access to the regions.
266 ;; One can use a Substring of the viewer name to disable only certain subversions
267 ;; Example: Agent uses the viewer "Imprudence 1.3.2.0"
268 ;; - "Imprudence" has no access
269 ;; - "Imprudence 1.3" has no access
270 ;; - "Imprudence 1.3.1" has access
271 ; BannedViewerList =
272
273
257[Estates] 274[Estates]
258 ; If these values are commented out then the user will be asked for estate details when required (this is the normal case). 275 ; If these values are commented out then the user will be asked for estate details when required (this is the normal case).
259 ; If these values are uncommented then they will be used to create a default estate as necessary. 276 ; If these values are uncommented then they will be used to create a default estate as necessary.