aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorMelanie2010-01-09 14:17:44 +0000
committerMelanie2010-01-09 14:17:44 +0000
commit063f106cbbc2a805dc210fe16c30741ab24876cb (patch)
tree5c338b086d342c21ee7ce26663bd92195d91a139 /OpenSim/Region/CoreModules/World
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-063f106cbbc2a805dc210fe16c30741ab24876cb.zip
opensim-SC_OLD-063f106cbbc2a805dc210fe16c30741ab24876cb.tar.gz
opensim-SC_OLD-063f106cbbc2a805dc210fe16c30741ab24876cb.tar.bz2
opensim-SC_OLD-063f106cbbc2a805dc210fe16c30741ab24876cb.tar.xz
Add functionality to estate "Allowed Users" and "Allowed Groups". Allowed users
will be honored now, while allowed groups will not. This requires additional groups module integration work
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs244
1 files changed, 152 insertions, 92 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index b1dcb14..deade6b 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.EstateAccess, 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.EstateAccess, 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