diff options
author | Diva Canto | 2010-01-15 17:24:41 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-15 17:24:41 -0800 |
commit | 32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f (patch) | |
tree | e20c1afa3edc76101eea15765a447b13b3c4946e /OpenSim/Region/CoreModules | |
parent | Comment (diff) | |
parent | Merge branch 'master' into presence-refactor (diff) | |
download | opensim-SC_OLD-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.zip opensim-SC_OLD-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.gz opensim-SC_OLD-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.bz2 opensim-SC_OLD-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.xz |
Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/opensim into presence-refactor
Diffstat (limited to '')
8 files changed, 329 insertions, 104 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index a835c52..e48b078 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
48 | private List<Scene> m_SceneList = new List<Scene>(); | 48 | private List<Scene> m_SceneList = new List<Scene>(); |
49 | private string m_RestURL = String.Empty; | 49 | private string m_RestURL = String.Empty; |
50 | IMessageTransferModule m_TransferModule = null; | 50 | IMessageTransferModule m_TransferModule = null; |
51 | private bool m_ForwardOfflineGroupMessages = true; | ||
51 | 52 | ||
52 | public void Initialise(IConfigSource config) | 53 | public void Initialise(IConfigSource config) |
53 | { | 54 | { |
@@ -71,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
71 | enabled = false; | 72 | enabled = false; |
72 | return; | 73 | return; |
73 | } | 74 | } |
75 | |||
76 | m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | public void AddRegion(Scene scene) | 79 | public void AddRegion(Scene scene) |
@@ -192,7 +195,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
192 | 195 | ||
193 | private void UndeliveredMessage(GridInstantMessage im) | 196 | private void UndeliveredMessage(GridInstantMessage im) |
194 | { | 197 | { |
195 | if (im.offline != 0) | 198 | if ((im.offline != 0) |
199 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | ||
196 | { | 200 | { |
197 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( | 201 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( |
198 | "POST", m_RestURL+"/SaveMessage/", im); | 202 | "POST", m_RestURL+"/SaveMessage/", im); |
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index f980c24..106e87c 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -65,6 +65,7 @@ | |||
65 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ | 65 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ |
66 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ | 66 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ |
67 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ | 67 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ |
68 | <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ | ||
68 | 69 | ||
69 | </Extension> | 70 | </Extension> |
70 | 71 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 8ec20eb..de71b56 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
195 | 195 | ||
196 | #region IGridService | 196 | #region IGridService |
197 | 197 | ||
198 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 198 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
199 | { | 199 | { |
200 | // Region doesn't exist here. Trying to link remote region | 200 | // Region doesn't exist here. Trying to link remote region |
201 | if (regionInfo.RegionID.Equals(UUID.Zero)) | 201 | if (regionInfo.RegionID.Equals(UUID.Zero)) |
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
210 | 210 | ||
211 | // Try get the map image | 211 | // Try get the map image |
212 | m_HypergridServiceConnector.GetMapImage(regionInfo); | 212 | m_HypergridServiceConnector.GetMapImage(regionInfo); |
213 | return true; | 213 | return String.Empty; |
214 | } | 214 | } |
215 | else | 215 | else |
216 | { | 216 | { |
217 | m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); | 217 | m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); |
218 | return false; | 218 | return "No such region"; |
219 | } | 219 | } |
220 | // Note that these remote regions aren't registered in localBackend, so return null, no local listeners | 220 | // Note that these remote regions aren't registered in localBackend, so return null, no local listeners |
221 | } | 221 | } |
@@ -465,7 +465,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
465 | } | 465 | } |
466 | 466 | ||
467 | // Finally, link it | 467 | // Finally, link it |
468 | if (!RegisterRegion(UUID.Zero, regInfo)) | 468 | if (RegisterRegion(UUID.Zero, regInfo) != String.Empty) |
469 | { | 469 | { |
470 | m_log.Warn("[HGrid]: Unable to link region"); | 470 | m_log.Warn("[HGrid]: Unable to link region"); |
471 | return false; | 471 | return false; |
@@ -706,8 +706,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
706 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) | 706 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) |
707 | { | 707 | { |
708 | comingHome = false; | 708 | comingHome = false; |
709 | if (!m_aScene.SceneGridService.RegionLoginsEnabled) | ||
710 | return false; | ||
711 | 709 | ||
712 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); | 710 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); |
713 | if (account != null) | 711 | if (account != null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index f0081fc..86a8c13 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
169 | 169 | ||
170 | #region IGridService | 170 | #region IGridService |
171 | 171 | ||
172 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 172 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
173 | { | 173 | { |
174 | return m_GridService.RegisterRegion(scopeID, regionInfo); | 174 | return m_GridService.RegisterRegion(scopeID, regionInfo); |
175 | } | 175 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 72c00fc..391e7c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
135 | 135 | ||
136 | #region IGridService | 136 | #region IGridService |
137 | 137 | ||
138 | public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 138 | public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
139 | { | 139 | { |
140 | if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) | 140 | string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); |
141 | |||
142 | if (msg == String.Empty) | ||
141 | return base.RegisterRegion(scopeID, regionInfo); | 143 | return base.RegisterRegion(scopeID, regionInfo); |
142 | 144 | ||
143 | return false; | 145 | return msg; |
144 | } | 146 | } |
145 | 147 | ||
146 | public override bool DeregisterRegion(UUID regionID) | 148 | public override bool DeregisterRegion(UUID regionID) |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs new file mode 100644 index 0000000..8b5a413 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -0,0 +1,157 @@ | |||
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.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.World | ||
41 | { | ||
42 | public class AccessModule : ISharedRegionModule | ||
43 | { | ||
44 | private static readonly ILog m_log = | ||
45 | LogManager.GetLogger( | ||
46 | MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | private List<Scene> m_SceneList = new List<Scene>(); | ||
49 | |||
50 | public void Initialise(IConfigSource config) | ||
51 | { | ||
52 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
53 | "login enable", | ||
54 | "login enable", | ||
55 | "Enable simulator logins", | ||
56 | String.Empty, | ||
57 | HandleLoginCommand); | ||
58 | |||
59 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
60 | "login disable", | ||
61 | "login disable", | ||
62 | "Disable simulator logins", | ||
63 | String.Empty, | ||
64 | HandleLoginCommand); | ||
65 | |||
66 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
67 | "login status", | ||
68 | "login status", | ||
69 | "Show login status", | ||
70 | String.Empty, | ||
71 | HandleLoginCommand); | ||
72 | } | ||
73 | |||
74 | public void PostInitialise() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void Close() | ||
79 | { | ||
80 | } | ||
81 | |||
82 | public string Name | ||
83 | { | ||
84 | get { return "AccessModule"; } | ||
85 | } | ||
86 | |||
87 | public Type ReplaceableInterface | ||
88 | { | ||
89 | get { return null; } | ||
90 | } | ||
91 | |||
92 | public void AddRegion(Scene scene) | ||
93 | { | ||
94 | if (!m_SceneList.Contains(scene)) | ||
95 | m_SceneList.Add(scene); | ||
96 | } | ||
97 | |||
98 | public void RemoveRegion(Scene scene) | ||
99 | { | ||
100 | m_SceneList.Remove(scene); | ||
101 | } | ||
102 | |||
103 | public void RegionLoaded(Scene scene) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | public void HandleLoginCommand(string module, string[] cmd) | ||
108 | { | ||
109 | if ((Scene)MainConsole.Instance.ConsoleScene == null) | ||
110 | { | ||
111 | foreach (Scene s in m_SceneList) | ||
112 | { | ||
113 | if(!ProcessCommand(s, cmd)) | ||
114 | break; | ||
115 | } | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | ProcessCommand((Scene)MainConsole.Instance.ConsoleScene, cmd); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | bool ProcessCommand(Scene scene, string[] cmd) | ||
124 | { | ||
125 | if (cmd.Length < 2) | ||
126 | { | ||
127 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
128 | return false; | ||
129 | } | ||
130 | |||
131 | switch (cmd[1]) | ||
132 | { | ||
133 | case "enable": | ||
134 | if (scene.LoginsDisabled) | ||
135 | MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
136 | scene.LoginsDisabled = false; | ||
137 | break; | ||
138 | case "disable": | ||
139 | if (!scene.LoginsDisabled) | ||
140 | MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
141 | scene.LoginsDisabled = true; | ||
142 | break; | ||
143 | case "status": | ||
144 | if (scene.LoginsDisabled) | ||
145 | MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName)); | ||
146 | else | ||
147 | MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName)); | ||
148 | break; | ||
149 | default: | ||
150 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
151 | return false; | ||
152 | } | ||
153 | |||
154 | return true; | ||
155 | } | ||
156 | } | ||
157 | } | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 2109336..189efdc 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -72,10 +72,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
72 | m_scene.RegionInfo.EstateSettings.AbuseEmail, | 72 | m_scene.RegionInfo.EstateSettings.AbuseEmail, |
73 | estateOwner); | 73 | estateOwner); |
74 | 74 | ||
75 | remote_client.SendEstateManagersList(invoice, | 75 | remote_client.SendEstateList(invoice, |
76 | (int)Constants.EstateAccessCodex.EstateManagers, | ||
76 | m_scene.RegionInfo.EstateSettings.EstateManagers, | 77 | m_scene.RegionInfo.EstateSettings.EstateManagers, |
77 | m_scene.RegionInfo.EstateSettings.EstateID); | 78 | m_scene.RegionInfo.EstateSettings.EstateID); |
78 | 79 | ||
80 | remote_client.SendEstateList(invoice, | ||
81 | (int)Constants.EstateAccessCodex.AccessOptions, | ||
82 | m_scene.RegionInfo.EstateSettings.EstateAccess, | ||
83 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
84 | |||
85 | remote_client.SendEstateList(invoice, | ||
86 | (int)Constants.EstateAccessCodex.AllowedGroups, | ||
87 | m_scene.RegionInfo.EstateSettings.EstateGroups, | ||
88 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
89 | |||
79 | remote_client.SendBannedUserList(invoice, | 90 | remote_client.SendBannedUserList(invoice, |
80 | m_scene.RegionInfo.EstateSettings.EstateBans, | 91 | m_scene.RegionInfo.EstateSettings.EstateBans, |
81 | m_scene.RegionInfo.EstateSettings.EstateID); | 92 | m_scene.RegionInfo.EstateSettings.EstateID); |
@@ -228,127 +239,176 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
228 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) | 239 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) |
229 | return; // never process EO | 240 | return; // never process EO |
230 | 241 | ||
231 | switch (estateAccessType) | 242 | if ((estateAccessType & 4) != 0) // User add |
232 | { | 243 | { |
233 | case 64: | 244 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) |
234 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | 245 | { |
235 | { | 246 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); |
236 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 247 | m_scene.RegionInfo.EstateSettings.Save(); |
237 | 248 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | |
238 | bool alreadyInList = false; | 249 | } |
239 | 250 | else | |
240 | for (int i = 0; i < banlistcheck.Length; i++) | 251 | { |
241 | { | 252 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); |
242 | if (user == banlistcheck[i].BannedUserID) | 253 | } |
243 | { | ||
244 | alreadyInList = true; | ||
245 | break; | ||
246 | } | ||
247 | |||
248 | } | ||
249 | if (!alreadyInList) | ||
250 | { | ||
251 | 254 | ||
252 | EstateBan item = new EstateBan(); | 255 | } |
256 | if ((estateAccessType & 8) != 0) // User remove | ||
257 | { | ||
258 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
259 | { | ||
260 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | ||
261 | m_scene.RegionInfo.EstateSettings.Save(); | ||
253 | 262 | ||
254 | item.BannedUserID = user; | 263 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); |
255 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | 264 | } |
256 | item.BannedHostAddress = "0.0.0.0"; | 265 | else |
257 | item.BannedHostIPMask = "0.0.0.0"; | 266 | { |
267 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
268 | } | ||
269 | } | ||
270 | if ((estateAccessType & 16) != 0) // Group add | ||
271 | { | ||
272 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
273 | { | ||
274 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | ||
275 | m_scene.RegionInfo.EstateSettings.Save(); | ||
276 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
281 | } | ||
282 | } | ||
283 | if ((estateAccessType & 32) != 0) // Group remove | ||
284 | { | ||
285 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
286 | { | ||
287 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | ||
288 | m_scene.RegionInfo.EstateSettings.Save(); | ||
258 | 289 | ||
259 | m_scene.RegionInfo.EstateSettings.AddBan(item); | 290 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); |
260 | m_scene.RegionInfo.EstateSettings.Save(); | 291 | } |
292 | else | ||
293 | { | ||
294 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
295 | } | ||
296 | } | ||
297 | if ((estateAccessType & 64) != 0) // Ban add | ||
298 | { | ||
299 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
300 | { | ||
301 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
261 | 302 | ||
262 | ScenePresence s = m_scene.GetScenePresence(user); | 303 | bool alreadyInList = false; |
263 | if (s != null) | ||
264 | { | ||
265 | if (!s.IsChildAgent) | ||
266 | { | ||
267 | s.ControllingClient.SendTeleportLocationStart(); | ||
268 | m_scene.TeleportClientHome(user, s.ControllingClient); | ||
269 | } | ||
270 | } | ||
271 | 304 | ||
272 | } | 305 | for (int i = 0; i < banlistcheck.Length; i++) |
273 | else | 306 | { |
307 | if (user == banlistcheck[i].BannedUserID) | ||
274 | { | 308 | { |
275 | remote_client.SendAlertMessage("User is already on the region ban list"); | 309 | alreadyInList = true; |
310 | break; | ||
276 | } | 311 | } |
277 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 312 | |
278 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
279 | } | ||
280 | else | ||
281 | { | ||
282 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
283 | } | 313 | } |
284 | break; | 314 | if (!alreadyInList) |
285 | case 128: | ||
286 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
287 | { | 315 | { |
288 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
289 | 316 | ||
290 | bool alreadyInList = false; | 317 | EstateBan item = new EstateBan(); |
291 | EstateBan listitem = null; | 318 | |
319 | item.BannedUserID = user; | ||
320 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | ||
321 | item.BannedHostAddress = "0.0.0.0"; | ||
322 | item.BannedHostIPMask = "0.0.0.0"; | ||
292 | 323 | ||
293 | for (int i = 0; i < banlistcheck.Length; i++) | 324 | m_scene.RegionInfo.EstateSettings.AddBan(item); |
325 | m_scene.RegionInfo.EstateSettings.Save(); | ||
326 | |||
327 | ScenePresence s = m_scene.GetScenePresence(user); | ||
328 | if (s != null) | ||
294 | { | 329 | { |
295 | if (user == banlistcheck[i].BannedUserID) | 330 | if (!s.IsChildAgent) |
296 | { | 331 | { |
297 | alreadyInList = true; | 332 | s.ControllingClient.SendTeleportLocationStart(); |
298 | listitem = banlistcheck[i]; | 333 | m_scene.TeleportClientHome(user, s.ControllingClient); |
299 | break; | ||
300 | } | 334 | } |
301 | |||
302 | } | 335 | } |
303 | if (alreadyInList && listitem != null) | 336 | |
304 | { | ||
305 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | ||
306 | m_scene.RegionInfo.EstateSettings.Save(); | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | remote_client.SendAlertMessage("User is not on the region ban list"); | ||
311 | } | ||
312 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | ||
313 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
314 | } | 337 | } |
315 | else | 338 | else |
316 | { | 339 | { |
317 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 340 | remote_client.SendAlertMessage("User is already on the region ban list"); |
318 | } | 341 | } |
319 | break; | 342 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
320 | case 256: | 343 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); |
344 | } | ||
345 | else | ||
346 | { | ||
347 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
348 | } | ||
349 | } | ||
350 | if ((estateAccessType & 128) != 0) // Ban remove | ||
351 | { | ||
352 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
353 | { | ||
354 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
321 | 355 | ||
322 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 356 | bool alreadyInList = false; |
323 | { | 357 | EstateBan listitem = null; |
324 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 358 | |
325 | m_scene.RegionInfo.EstateSettings.Save(); | 359 | for (int i = 0; i < banlistcheck.Length; i++) |
326 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
327 | } | ||
328 | else | ||
329 | { | 360 | { |
330 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 361 | if (user == banlistcheck[i].BannedUserID) |
331 | } | 362 | { |
363 | alreadyInList = true; | ||
364 | listitem = banlistcheck[i]; | ||
365 | break; | ||
366 | } | ||
332 | 367 | ||
333 | break; | 368 | } |
334 | case 512: | 369 | if (alreadyInList && listitem != null) |
335 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
336 | { | 370 | { |
337 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 371 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
338 | m_scene.RegionInfo.EstateSettings.Save(); | 372 | m_scene.RegionInfo.EstateSettings.Save(); |
339 | |||
340 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
341 | } | 373 | } |
342 | else | 374 | else |
343 | { | 375 | { |
344 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 376 | remote_client.SendAlertMessage("User is not on the region ban list"); |
345 | } | 377 | } |
346 | break; | 378 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
347 | 379 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | |
348 | default: | 380 | } |
381 | else | ||
382 | { | ||
383 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
384 | } | ||
385 | } | ||
386 | if ((estateAccessType & 256) != 0) // Manager add | ||
387 | { | ||
388 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
389 | { | ||
390 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | ||
391 | m_scene.RegionInfo.EstateSettings.Save(); | ||
392 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
397 | } | ||
398 | } | ||
399 | if ((estateAccessType & 512) != 0) // Manager remove | ||
400 | { | ||
401 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
402 | { | ||
403 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | ||
404 | m_scene.RegionInfo.EstateSettings.Save(); | ||
349 | 405 | ||
350 | m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString()); | 406 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); |
351 | break; | 407 | } |
408 | else | ||
409 | { | ||
410 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
411 | } | ||
352 | } | 412 | } |
353 | } | 413 | } |
354 | 414 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 3d7516d..8fa0c65 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
607 | return objectOwnerMask; | 607 | return objectOwnerMask; |
608 | 608 | ||
609 | // Estate users should be able to edit anything in the sim | 609 | // Estate users should be able to edit anything in the sim |
610 | if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner)) | 610 | if (IsEstateManager(user) && m_RegionOwnerIsGod && (!IsAdministrator(objectOwner)) || objectOwner == user) |
611 | return objectOwnerMask; | 611 | return objectOwnerMask; |
612 | 612 | ||
613 | // Admin should be able to edit anything in the sim (including admin objects) | 613 | // Admin should be able to edit anything in the sim (including admin objects) |
@@ -899,6 +899,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
899 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 899 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
900 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 900 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
901 | 901 | ||
902 | if (IsEstateManager(user) && m_RegionOwnerIsGod) | ||
903 | return true; | ||
904 | |||
902 | return IsAdministrator(user); | 905 | return IsAdministrator(user); |
903 | } | 906 | } |
904 | 907 | ||