aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut
diff options
context:
space:
mode:
authorMic Bowman2011-08-05 11:13:02 -0700
committerMic Bowman2011-08-05 11:13:02 -0700
commitc3f579046c4de7a5a65e71e4c02958425fd7998a (patch)
treeb725d9eaa66d5eb7cf1f87ddbb4fa0f4284f71f5 /OpenSim/Region/CoreModules/ServiceConnectorsOut
parentBulletSim: Parameters settable from ini file. Linksets. Physical property val... (diff)
parentremove the largely unused copy/pasted HandleAgentRequestSit() method (diff)
downloadopensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.zip
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.gz
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.bz2
opensim-SC-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.xz
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs17
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs24
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs7
3 files changed, 29 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
index 85a1ac3..18a7177 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
@@ -39,8 +39,7 @@ using OpenMetaverse;
39 39
40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization 40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
41{ 41{
42 public class LocalAuthorizationServicesConnector : 42 public class LocalAuthorizationServicesConnector : ISharedRegionModule, IAuthorizationService
43 ISharedRegionModule, IAuthorizationService
44 { 43 {
45 private static readonly ILog m_log = 44 private static readonly ILog m_log =
46 LogManager.GetLogger( 45 LogManager.GetLogger(
@@ -127,15 +126,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
127 if (!m_Enabled) 126 if (!m_Enabled)
128 return; 127 return;
129 128
130 m_log.InfoFormat("[AUTHORIZATION CONNECTOR]: Enabled local authorization for region {0}", scene.RegionInfo.RegionName); 129 m_log.InfoFormat(
131 130 "[AUTHORIZATION CONNECTOR]: Enabled local authorization for region {0}",
132 131 scene.RegionInfo.RegionName);
133 } 132 }
134 133
135 public bool IsAuthorizedForRegion(string userID, string regionID, out string message) 134 public bool IsAuthorizedForRegion(
135 string userID, string firstName, string lastName, string regionID, out string message)
136 { 136 {
137 return m_AuthorizationService.IsAuthorizedForRegion(userID, regionID, out message); 137 return m_AuthorizationService.IsAuthorizedForRegion(userID, firstName, lastName, regionID, out message);
138 } 138 }
139
140 } 139 }
141} 140} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
index 66994fa..5fa27b8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
@@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
117 117
118 } 118 }
119 119
120 public bool IsAuthorizedForRegion(string userID, string regionID, out string message) 120 public bool IsAuthorizedForRegion(
121 string userID, string firstName, string lastName, string regionID, out string message)
121 { 122 {
122 m_log.InfoFormat("[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID); 123 m_log.InfoFormat(
124 "[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID);
123 125
124 bool isAuthorized = true; 126 bool isAuthorized = true;
125 message = String.Empty; 127 message = String.Empty;
128 string mail = String.Empty;
126 129
127 // get the scene this call is being made for 130 // get the scene this call is being made for
128 Scene scene = null; 131 Scene scene = null;
@@ -140,17 +143,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
140 if (scene != null) 143 if (scene != null)
141 { 144 {
142 UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID)); 145 UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID));
143 isAuthorized = IsAuthorizedForRegion(userID, account.FirstName, account.LastName, 146
144 account.Email, scene.RegionInfo.RegionName, regionID, out message); 147 if (account != null)
148 mail = account.Email;
149
150 isAuthorized
151 = IsAuthorizedForRegion(
152 userID, firstName, lastName, account.Email, scene.RegionInfo.RegionName, regionID, out message);
145 } 153 }
146 else 154 else
147 { 155 {
148 m_log.ErrorFormat("[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0} ",regionID); 156 m_log.ErrorFormat(
157 "[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0}",
158 regionID);
149 } 159 }
150 160
151
152 return isAuthorized; 161 return isAuthorized;
153
154 } 162 }
155 } 163 }
156} 164} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
index c044407..cd7d6bc 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -64,10 +64,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
64 } 64 }
65 65
66 /// <summary> 66 /// <summary>
67 /// Test saving a V0.2 OpenSim Region Archive. 67 /// Test region registration.
68 /// </summary> 68 /// </summary>
69 [Test] 69 [Test]
70 public void TestRegisterRegionV0_2() 70 public void TestRegisterRegion()
71 { 71 {
72 SetUp(); 72 SetUp();
73 73
@@ -123,6 +123,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
123 m_LocalConnector.RegisterRegion(UUID.Zero, r1); 123 m_LocalConnector.RegisterRegion(UUID.Zero, r1);
124 124
125 GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test"); 125 GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test");
126 Assert.IsNull(result, "Retrieved GetRegionByName \"Test\" is not null");
127
128 result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test Region 1");
126 Assert.IsNotNull(result, "Retrieved GetRegionByName is null"); 129 Assert.IsNotNull(result, "Retrieved GetRegionByName is null");
127 Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match"); 130 Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match");
128 131