aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDr Scofield2009-04-27 11:51:25 +0000
committerDr Scofield2009-04-27 11:51:25 +0000
commit515e62dc2f4614b140da222c082d3cd69c5960d4 (patch)
treeeda95f708aad85c1fbbe14459111beb3790b8526 /OpenSim/Region
parentAdd copyright headers. Formatting cleanup. (diff)
downloadopensim-SC_OLD-515e62dc2f4614b140da222c082d3cd69c5960d4.zip
opensim-SC_OLD-515e62dc2f4614b140da222c082d3cd69c5960d4.tar.gz
opensim-SC_OLD-515e62dc2f4614b140da222c082d3cd69c5960d4.tar.bz2
opensim-SC_OLD-515e62dc2f4614b140da222c082d3cd69c5960d4.tar.xz
From: Alan M Webb <alan_webb@us.ibm.com>
Added support for access control lists. Scene: Added test to AddNewClient for an entry in the access list when connecting to a region with limited access. EstateSettings: Added an HasAccess(UUID) property to test for an entry in the estate's access list. RemoteAdmin: Add RPC calls for admin_acl_list, clear, add, and remove.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs82
1 files changed, 49 insertions, 33 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 70713c4..c7d32cc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1846,11 +1846,25 @@ namespace OpenSim.Region.Framework.Scenes
1846 1846
1847 public override void AddNewClient(IClientAPI client) 1847 public override void AddNewClient(IClientAPI client)
1848 { 1848 {
1849 if (m_regInfo.EstateSettings.IsBanned(client.AgentId)) 1849 bool welcome = true;
1850
1851 if(m_regInfo.EstateSettings.IsBanned(client.AgentId))
1850 { 1852 {
1851 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", 1853 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
1852 client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName); 1854 client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName);
1853 client.SendAlertMessage("Denied access to region " + RegionInfo.RegionName + ". You have been banned from that region."); 1855 client.SendAlertMessage("Denied access to region " + RegionInfo.RegionName + ". You have been banned from that region.");
1856 welcome = false;
1857 }
1858 else if (!m_regInfo.EstateSettings.PublicAccess && !m_regInfo.EstateSettings.HasAccess(client.AgentId))
1859 {
1860 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access",
1861 client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName);
1862 client.SendAlertMessage("Denied access to private region " + RegionInfo.RegionName + ". You do not have access to this region.");
1863 welcome = false;
1864 }
1865
1866 if(!welcome)
1867 {
1854 try 1868 try
1855 { 1869 {
1856 IEventQueue eq = RequestModuleInterface<IEventQueue>(); 1870 IEventQueue eq = RequestModuleInterface<IEventQueue>();
@@ -1867,50 +1881,52 @@ namespace OpenSim.Region.Framework.Scenes
1867 } 1881 }
1868 catch (Exception e) 1882 catch (Exception e)
1869 { 1883 {
1870 m_log.DebugFormat("[SCENE]: Exception while closing banned client {0} {1}: {2}", client.FirstName, client.LastName, e.Message); 1884 m_log.DebugFormat("[SCENE]: Exception while closing unwelcome client {0} {1}: {2}", client.FirstName, client.LastName, e.Message);
1871 } 1885 }
1872 } 1886 }
1887 else
1888 {
1889 SubscribeToClientEvents(client);
1890 ScenePresence presence;
1873 1891
1874 SubscribeToClientEvents(client); 1892 if (m_restorePresences.ContainsKey(client.AgentId))
1875 ScenePresence presence; 1893 {
1894 m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName);
1876 1895
1877 if (m_restorePresences.ContainsKey(client.AgentId)) 1896 presence = m_restorePresences[client.AgentId];
1878 { 1897 m_restorePresences.Remove(client.AgentId);
1879 m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName);
1880 1898
1881 presence = m_restorePresences[client.AgentId]; 1899 // This is one of two paths to create avatars that are
1882 m_restorePresences.Remove(client.AgentId); 1900 // used. This tends to get called more in standalone
1901 // than grid, not really sure why, but as such needs
1902 // an explicity appearance lookup here.
1903 AvatarAppearance appearance = null;
1904 GetAvatarAppearance(client, out appearance);
1905 presence.Appearance = appearance;
1883 1906
1884 // This is one of two paths to create avatars that are 1907 presence.initializeScenePresence(client, RegionInfo, this);
1885 // used. This tends to get called more in standalone
1886 // than grid, not really sure why, but as such needs
1887 // an explicity appearance lookup here.
1888 AvatarAppearance appearance = null;
1889 GetAvatarAppearance(client, out appearance);
1890 presence.Appearance = appearance;
1891 1908
1892 presence.initializeScenePresence(client, RegionInfo, this); 1909 m_sceneGraph.AddScenePresence(presence);
1893 1910
1894 m_sceneGraph.AddScenePresence(presence); 1911 lock (m_restorePresences)
1912 {
1913 Monitor.PulseAll(m_restorePresences);
1914 }
1915 }
1916 else
1917 {
1918 m_log.DebugFormat(
1919 "[SCENE]: Adding new child agent for {0} in {1}",
1920 client.Name, RegionInfo.RegionName);
1895 1921
1896 lock (m_restorePresences) 1922 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
1897 {
1898 Monitor.PulseAll(m_restorePresences);
1899 }
1900 }
1901 else
1902 {
1903 m_log.DebugFormat(
1904 "[SCENE]: Adding new child agent for {0} in {1}",
1905 client.Name, RegionInfo.RegionName);
1906 1923
1907 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); 1924 CreateAndAddScenePresence(client);
1925 }
1908 1926
1909 CreateAndAddScenePresence(client); 1927 m_LastLogin = Environment.TickCount;
1928 EventManager.TriggerOnNewClient(client);
1910 } 1929 }
1911
1912 m_LastLogin = Environment.TickCount;
1913 EventManager.TriggerOnNewClient(client);
1914 } 1930 }
1915 1931
1916 protected virtual void SubscribeToClientEvents(IClientAPI client) 1932 protected virtual void SubscribeToClientEvents(IClientAPI client)