diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 311 insertions, 109 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index 46ee3c0..0b54746 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs | |||
@@ -55,21 +55,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
55 | 55 | ||
56 | protected bool m_enabled = false; // Module is only enabled if running in standalone mode | 56 | protected bool m_enabled = false; // Module is only enabled if running in standalone mode |
57 | 57 | ||
58 | public bool RegionLoginsEnabled | ||
59 | { | ||
60 | get | ||
61 | { | ||
62 | if (m_firstScene != null) | ||
63 | { | ||
64 | return m_firstScene.SceneGridService.RegionLoginsEnabled; | ||
65 | } | ||
66 | else | ||
67 | { | ||
68 | return false; | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | |||
73 | protected HGLoginAuthService m_loginService; | 58 | protected HGLoginAuthService m_loginService; |
74 | 59 | ||
75 | #region IRegionModule Members | 60 | #region IRegionModule Members |
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index beb2307..ebc7f59 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -47,6 +47,7 @@ | |||
47 | <RegionModule id="LandServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Land.LandServiceInConnectorModule" /> | 47 | <RegionModule id="LandServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Land.LandServiceInConnectorModule" /> |
48 | <RegionModule id="NeighbourServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour.NeighbourServiceInConnectorModule" /> \ | 48 | <RegionModule id="NeighbourServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour.NeighbourServiceInConnectorModule" /> \ |
49 | <RegionModule id="HypergridServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.HypergridServiceInConnectorModule" /> \ | 49 | <RegionModule id="HypergridServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.HypergridServiceInConnectorModule" /> \ |
50 | <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ | ||
50 | 51 | ||
51 | </Extension> | 52 | </Extension> |
52 | 53 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 93cb60c..f9cd90f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -696,8 +696,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
696 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) | 696 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) |
697 | { | 697 | { |
698 | comingHome = false; | 698 | comingHome = false; |
699 | if (!m_aScene.SceneGridService.RegionLoginsEnabled) | ||
700 | return false; | ||
701 | 699 | ||
702 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID); | 700 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID); |
703 | if (uinfo != null) | 701 | if (uinfo != null) |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs new file mode 100644 index 0000000..dfa8df6 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Console; | ||
36 | using OpenSim.Framework.Communications.Cache; | ||
37 | using OpenSim.Region.Framework.Interfaces; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.World | ||
42 | { | ||
43 | public class AccessModule : ISharedRegionModule | ||
44 | { | ||
45 | private static readonly ILog m_log = | ||
46 | LogManager.GetLogger( | ||
47 | MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
49 | private List<Scene> m_SceneList = new List<Scene>(); | ||
50 | |||
51 | public void Initialise(IConfigSource config) | ||
52 | { | ||
53 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
54 | "login enable", | ||
55 | "login enable", | ||
56 | "Enable simulator logins", | ||
57 | String.Empty, | ||
58 | HandleLoginCommand); | ||
59 | |||
60 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
61 | "login disable", | ||
62 | "login disable", | ||
63 | "Disable simulator logins", | ||
64 | String.Empty, | ||
65 | HandleLoginCommand); | ||
66 | |||
67 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
68 | "login status", | ||
69 | "login status", | ||
70 | "Show login status", | ||
71 | String.Empty, | ||
72 | HandleLoginCommand); | ||
73 | } | ||
74 | |||
75 | public void PostInitialise() | ||
76 | { | ||
77 | } | ||
78 | |||
79 | public void Close() | ||
80 | { | ||
81 | } | ||
82 | |||
83 | public string Name | ||
84 | { | ||
85 | get { return "AccessModule"; } | ||
86 | } | ||
87 | |||
88 | public Type ReplaceableInterface | ||
89 | { | ||
90 | get { return null; } | ||
91 | } | ||
92 | |||
93 | public void AddRegion(Scene scene) | ||
94 | { | ||
95 | if (!m_SceneList.Contains(scene)) | ||
96 | m_SceneList.Add(scene); | ||
97 | } | ||
98 | |||
99 | public void RemoveRegion(Scene scene) | ||
100 | { | ||
101 | m_SceneList.Remove(scene); | ||
102 | } | ||
103 | |||
104 | public void RegionLoaded(Scene scene) | ||
105 | { | ||
106 | } | ||
107 | |||
108 | public void HandleLoginCommand(string module, string[] cmd) | ||
109 | { | ||
110 | if ((Scene)MainConsole.Instance.ConsoleScene == null) | ||
111 | { | ||
112 | foreach (Scene s in m_SceneList) | ||
113 | { | ||
114 | if(!ProcessCommand(s, cmd)) | ||
115 | break; | ||
116 | } | ||
117 | } | ||
118 | else | ||
119 | { | ||
120 | ProcessCommand((Scene)MainConsole.Instance.ConsoleScene, cmd); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | bool ProcessCommand(Scene scene, string[] cmd) | ||
125 | { | ||
126 | if (cmd.Length < 2) | ||
127 | { | ||
128 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
129 | return false; | ||
130 | } | ||
131 | |||
132 | switch (cmd[1]) | ||
133 | { | ||
134 | case "enable": | ||
135 | if (scene.LoginsDisabled) | ||
136 | MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
137 | scene.LoginsDisabled = false; | ||
138 | break; | ||
139 | case "disable": | ||
140 | if (!scene.LoginsDisabled) | ||
141 | MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
142 | scene.LoginsDisabled = true; | ||
143 | break; | ||
144 | case "status": | ||
145 | if (scene.LoginsDisabled) | ||
146 | MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName)); | ||
147 | else | ||
148 | MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName)); | ||
149 | break; | ||
150 | default: | ||
151 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
152 | return false; | ||
153 | } | ||
154 | |||
155 | return true; | ||
156 | } | ||
157 | } | ||
158 | } | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index b1dcb14..695cced 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -75,10 +75,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
75 | m_scene.RegionInfo.EstateSettings.AbuseEmail, | 75 | m_scene.RegionInfo.EstateSettings.AbuseEmail, |
76 | estateOwner); | 76 | estateOwner); |
77 | 77 | ||
78 | remote_client.SendEstateManagersList(invoice, | 78 | remote_client.SendEstateList(invoice, |
79 | (int)Constants.EstateAccessCodex.EstateManagers, | ||
79 | m_scene.RegionInfo.EstateSettings.EstateManagers, | 80 | m_scene.RegionInfo.EstateSettings.EstateManagers, |
80 | m_scene.RegionInfo.EstateSettings.EstateID); | 81 | m_scene.RegionInfo.EstateSettings.EstateID); |
81 | 82 | ||
83 | remote_client.SendEstateList(invoice, | ||
84 | (int)Constants.EstateAccessCodex.AccessOptions, | ||
85 | m_scene.RegionInfo.EstateSettings.EstateAccess, | ||
86 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
87 | |||
88 | remote_client.SendEstateList(invoice, | ||
89 | (int)Constants.EstateAccessCodex.AllowedGroups, | ||
90 | m_scene.RegionInfo.EstateSettings.EstateGroups, | ||
91 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
92 | |||
82 | remote_client.SendBannedUserList(invoice, | 93 | remote_client.SendBannedUserList(invoice, |
83 | m_scene.RegionInfo.EstateSettings.EstateBans, | 94 | m_scene.RegionInfo.EstateSettings.EstateBans, |
84 | m_scene.RegionInfo.EstateSettings.EstateID); | 95 | m_scene.RegionInfo.EstateSettings.EstateID); |
@@ -233,127 +244,176 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
233 | if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID) | 244 | if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID) |
234 | return; // never process owner | 245 | return; // never process owner |
235 | 246 | ||
236 | switch (estateAccessType) | 247 | if ((estateAccessType & 4) != 0) // User add |
237 | { | 248 | { |
238 | case 64: | 249 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) |
239 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | 250 | { |
240 | { | 251 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); |
241 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 252 | m_scene.RegionInfo.EstateSettings.Save(); |
242 | 253 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | |
243 | bool alreadyInList = false; | 254 | } |
244 | 255 | else | |
245 | for (int i = 0; i < banlistcheck.Length; i++) | 256 | { |
246 | { | 257 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); |
247 | if (user == banlistcheck[i].BannedUserID) | 258 | } |
248 | { | ||
249 | alreadyInList = true; | ||
250 | break; | ||
251 | } | ||
252 | |||
253 | } | ||
254 | if (!alreadyInList) | ||
255 | { | ||
256 | 259 | ||
257 | EstateBan item = new EstateBan(); | 260 | } |
261 | if ((estateAccessType & 8) != 0) // User remove | ||
262 | { | ||
263 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
264 | { | ||
265 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | ||
266 | m_scene.RegionInfo.EstateSettings.Save(); | ||
258 | 267 | ||
259 | item.BannedUserID = user; | 268 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); |
260 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | 269 | } |
261 | item.BannedHostAddress = "0.0.0.0"; | 270 | else |
262 | item.BannedHostIPMask = "0.0.0.0"; | 271 | { |
272 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
273 | } | ||
274 | } | ||
275 | if ((estateAccessType & 16) != 0) // Group add | ||
276 | { | ||
277 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
278 | { | ||
279 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | ||
280 | m_scene.RegionInfo.EstateSettings.Save(); | ||
281 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | ||
282 | } | ||
283 | else | ||
284 | { | ||
285 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
286 | } | ||
287 | } | ||
288 | if ((estateAccessType & 32) != 0) // Group remove | ||
289 | { | ||
290 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
291 | { | ||
292 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | ||
293 | m_scene.RegionInfo.EstateSettings.Save(); | ||
263 | 294 | ||
264 | m_scene.RegionInfo.EstateSettings.AddBan(item); | 295 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); |
265 | m_scene.RegionInfo.EstateSettings.Save(); | 296 | } |
297 | else | ||
298 | { | ||
299 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
300 | } | ||
301 | } | ||
302 | if ((estateAccessType & 64) != 0) // Ban add | ||
303 | { | ||
304 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
305 | { | ||
306 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
266 | 307 | ||
267 | ScenePresence s = m_scene.GetScenePresence(user); | 308 | bool alreadyInList = false; |
268 | if (s != null) | ||
269 | { | ||
270 | if (!s.IsChildAgent) | ||
271 | { | ||
272 | s.ControllingClient.SendTeleportLocationStart(); | ||
273 | m_scene.TeleportClientHome(user, s.ControllingClient); | ||
274 | } | ||
275 | } | ||
276 | 309 | ||
277 | } | 310 | for (int i = 0; i < banlistcheck.Length; i++) |
278 | else | 311 | { |
312 | if (user == banlistcheck[i].BannedUserID) | ||
279 | { | 313 | { |
280 | remote_client.SendAlertMessage("User is already on the region ban list"); | 314 | alreadyInList = true; |
315 | break; | ||
281 | } | 316 | } |
282 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 317 | |
283 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
284 | } | ||
285 | else | ||
286 | { | ||
287 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
288 | } | 318 | } |
289 | break; | 319 | if (!alreadyInList) |
290 | case 128: | ||
291 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
292 | { | 320 | { |
293 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
294 | 321 | ||
295 | bool alreadyInList = false; | 322 | EstateBan item = new EstateBan(); |
296 | EstateBan listitem = null; | 323 | |
324 | item.BannedUserID = user; | ||
325 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | ||
326 | item.BannedHostAddress = "0.0.0.0"; | ||
327 | item.BannedHostIPMask = "0.0.0.0"; | ||
297 | 328 | ||
298 | for (int i = 0; i < banlistcheck.Length; i++) | 329 | m_scene.RegionInfo.EstateSettings.AddBan(item); |
330 | m_scene.RegionInfo.EstateSettings.Save(); | ||
331 | |||
332 | ScenePresence s = m_scene.GetScenePresence(user); | ||
333 | if (s != null) | ||
299 | { | 334 | { |
300 | if (user == banlistcheck[i].BannedUserID) | 335 | if (!s.IsChildAgent) |
301 | { | 336 | { |
302 | alreadyInList = true; | 337 | s.ControllingClient.SendTeleportLocationStart(); |
303 | listitem = banlistcheck[i]; | 338 | m_scene.TeleportClientHome(user, s.ControllingClient); |
304 | break; | ||
305 | } | 339 | } |
306 | |||
307 | } | 340 | } |
308 | if (alreadyInList && listitem != null) | 341 | |
309 | { | ||
310 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | ||
311 | m_scene.RegionInfo.EstateSettings.Save(); | ||
312 | } | ||
313 | else | ||
314 | { | ||
315 | remote_client.SendAlertMessage("User is not on the region ban list"); | ||
316 | } | ||
317 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | ||
318 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
319 | } | 342 | } |
320 | else | 343 | else |
321 | { | 344 | { |
322 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 345 | remote_client.SendAlertMessage("User is already on the region ban list"); |
323 | } | 346 | } |
324 | break; | 347 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
325 | case 256: | 348 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); |
349 | } | ||
350 | else | ||
351 | { | ||
352 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
353 | } | ||
354 | } | ||
355 | if ((estateAccessType & 128) != 0) // Ban remove | ||
356 | { | ||
357 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
358 | { | ||
359 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
326 | 360 | ||
327 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 361 | bool alreadyInList = false; |
328 | { | 362 | EstateBan listitem = null; |
329 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 363 | |
330 | m_scene.RegionInfo.EstateSettings.Save(); | 364 | for (int i = 0; i < banlistcheck.Length; i++) |
331 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
332 | } | ||
333 | else | ||
334 | { | 365 | { |
335 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 366 | if (user == banlistcheck[i].BannedUserID) |
336 | } | 367 | { |
368 | alreadyInList = true; | ||
369 | listitem = banlistcheck[i]; | ||
370 | break; | ||
371 | } | ||
337 | 372 | ||
338 | break; | 373 | } |
339 | case 512: | 374 | if (alreadyInList && listitem != null) |
340 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
341 | { | 375 | { |
342 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 376 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
343 | m_scene.RegionInfo.EstateSettings.Save(); | 377 | m_scene.RegionInfo.EstateSettings.Save(); |
344 | |||
345 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
346 | } | 378 | } |
347 | else | 379 | else |
348 | { | 380 | { |
349 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 381 | remote_client.SendAlertMessage("User is not on the region ban list"); |
350 | } | 382 | } |
351 | break; | 383 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
352 | 384 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | |
353 | default: | 385 | } |
386 | else | ||
387 | { | ||
388 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
389 | } | ||
390 | } | ||
391 | if ((estateAccessType & 256) != 0) // Manager add | ||
392 | { | ||
393 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
394 | { | ||
395 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | ||
396 | m_scene.RegionInfo.EstateSettings.Save(); | ||
397 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
398 | } | ||
399 | else | ||
400 | { | ||
401 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
402 | } | ||
403 | } | ||
404 | if ((estateAccessType & 512) != 0) // Manager remove | ||
405 | { | ||
406 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
407 | { | ||
408 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | ||
409 | m_scene.RegionInfo.EstateSettings.Save(); | ||
354 | 410 | ||
355 | m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString()); | 411 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); |
356 | break; | 412 | } |
413 | else | ||
414 | { | ||
415 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
416 | } | ||
357 | } | 417 | } |
358 | } | 418 | } |
359 | 419 | ||