diff options
-rw-r--r-- | OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index df797a5..3de2330 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -248,7 +248,10 @@ namespace OpenSim.Services.HypergridService | |||
248 | InventoryCollection coll = null; | 248 | InventoryCollection coll = null; |
249 | 249 | ||
250 | if (!IsWithinSuitcaseTree(principalID, folderID)) | 250 | if (!IsWithinSuitcaseTree(principalID, folderID)) |
251 | { | ||
252 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderContent: folder {0} is not within Suitcase tree", folderID); | ||
251 | return new InventoryCollection(); | 253 | return new InventoryCollection(); |
254 | } | ||
252 | 255 | ||
253 | coll = base.GetFolderContent(principalID, folderID); | 256 | coll = base.GetFolderContent(principalID, folderID); |
254 | 257 | ||
@@ -265,7 +268,10 @@ namespace OpenSim.Services.HypergridService | |||
265 | // Let's do a bit of sanity checking, more than the base service does | 268 | // Let's do a bit of sanity checking, more than the base service does |
266 | // make sure the given folder exists under the suitcase tree of this user | 269 | // make sure the given folder exists under the suitcase tree of this user |
267 | if (!IsWithinSuitcaseTree(principalID, folderID)) | 270 | if (!IsWithinSuitcaseTree(principalID, folderID)) |
271 | { | ||
272 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderItems: folder {0} is not within Suitcase tree", folderID); | ||
268 | return new List<InventoryItemBase>(); | 273 | return new List<InventoryItemBase>(); |
274 | } | ||
269 | 275 | ||
270 | return base.GetFolderItems(principalID, folderID); | 276 | return base.GetFolderItems(principalID, folderID); |
271 | } | 277 | } |
@@ -277,7 +283,10 @@ namespace OpenSim.Services.HypergridService | |||
277 | // make sure the given folder's parent folder exists under the suitcase tree of this user | 283 | // make sure the given folder's parent folder exists under the suitcase tree of this user |
278 | 284 | ||
279 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID)) | 285 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID)) |
286 | { | ||
287 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder: folder {0} is not within Suitcase tree", folder.ParentID); | ||
280 | return false; | 288 | return false; |
289 | } | ||
281 | 290 | ||
282 | // OK, it's legit | 291 | // OK, it's legit |
283 | if (base.AddFolder(folder)) | 292 | if (base.AddFolder(folder)) |
@@ -297,7 +306,7 @@ namespace OpenSim.Services.HypergridService | |||
297 | //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); | 306 | //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); |
298 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) | 307 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) |
299 | { | 308 | { |
300 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name); | 309 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateFolder: folder {0}/{1} is not within Suitcase tree", folder.Name, folder.ID); |
301 | return false; | 310 | return false; |
302 | } | 311 | } |
303 | 312 | ||
@@ -307,9 +316,17 @@ namespace OpenSim.Services.HypergridService | |||
307 | 316 | ||
308 | public override bool MoveFolder(InventoryFolderBase folder) | 317 | public override bool MoveFolder(InventoryFolderBase folder) |
309 | { | 318 | { |
310 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID) || | 319 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) |
311 | !IsWithinSuitcaseTree(folder.Owner, folder.ParentID)) | 320 | { |
321 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ID); | ||
312 | return false; | 322 | return false; |
323 | } | ||
324 | |||
325 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID)) | ||
326 | { | ||
327 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ParentID); | ||
328 | return false; | ||
329 | } | ||
313 | 330 | ||
314 | return base.MoveFolder(folder); | 331 | return base.MoveFolder(folder); |
315 | } | 332 | } |
@@ -331,7 +348,10 @@ namespace OpenSim.Services.HypergridService | |||
331 | // Let's do a bit of sanity checking, more than the base service does | 348 | // Let's do a bit of sanity checking, more than the base service does |
332 | // make sure the given folder's parent folder exists under the suitcase tree of this user | 349 | // make sure the given folder's parent folder exists under the suitcase tree of this user |
333 | if (!IsWithinSuitcaseTree(item.Owner, item.Folder)) | 350 | if (!IsWithinSuitcaseTree(item.Owner, item.Folder)) |
351 | { | ||
352 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddItem: folder {0} is not within Suitcase tree", item.Folder); | ||
334 | return false; | 353 | return false; |
354 | } | ||
335 | 355 | ||
336 | // OK, it's legit | 356 | // OK, it's legit |
337 | return base.AddItem(item); | 357 | return base.AddItem(item); |
@@ -341,7 +361,10 @@ namespace OpenSim.Services.HypergridService | |||
341 | public override bool UpdateItem(InventoryItemBase item) | 361 | public override bool UpdateItem(InventoryItemBase item) |
342 | { | 362 | { |
343 | if (!IsWithinSuitcaseTree(item.Owner, item.Folder)) | 363 | if (!IsWithinSuitcaseTree(item.Owner, item.Folder)) |
364 | { | ||
365 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateItem: folder {0} is not within Suitcase tree", item.Folder); | ||
344 | return false; | 366 | return false; |
367 | } | ||
345 | 368 | ||
346 | return base.UpdateItem(item); | 369 | return base.UpdateItem(item); |
347 | } | 370 | } |
@@ -350,11 +373,28 @@ namespace OpenSim.Services.HypergridService | |||
350 | { | 373 | { |
351 | // Principal is b0rked. *sigh* | 374 | // Principal is b0rked. *sigh* |
352 | 375 | ||
353 | if (!IsWithinSuitcaseTree(items[0].Owner, items[0].Folder)) | 376 | // Check the items' destination folders |
354 | return false; | 377 | foreach (InventoryItemBase item in items) |
378 | { | ||
379 | if (!IsWithinSuitcaseTree(item.Owner, item.Folder)) | ||
380 | { | ||
381 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", item.Folder); | ||
382 | return false; | ||
383 | } | ||
384 | } | ||
355 | 385 | ||
356 | return base.MoveItems(principalID, items); | 386 | // Check the items' current folders |
387 | foreach (InventoryItemBase item in items) | ||
388 | { | ||
389 | InventoryItemBase originalItem = base.GetItem(item); | ||
390 | if (!IsWithinSuitcaseTree(originalItem.Owner, originalItem.Folder)) | ||
391 | { | ||
392 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", originalItem.Folder); | ||
393 | return false; | ||
394 | } | ||
395 | } | ||
357 | 396 | ||
397 | return base.MoveItems(principalID, items); | ||
358 | } | 398 | } |
359 | 399 | ||
360 | public override bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 400 | public override bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
@@ -374,8 +414,8 @@ namespace OpenSim.Services.HypergridService | |||
374 | 414 | ||
375 | if (!IsWithinSuitcaseTree(it.Owner, it.Folder) && !IsPartOfAppearance(it.Owner, it.ID)) | 415 | if (!IsWithinSuitcaseTree(it.Owner, it.Folder) && !IsPartOfAppearance(it.Owner, it.ID)) |
376 | { | 416 | { |
377 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0} (folder {1}) is not within Suitcase", | 417 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0}/{1} (folder {2}) is not within Suitcase tree or Appearance", |
378 | it.Name, it.Folder); | 418 | it.Name, it.ID, it.Folder); |
379 | return null; | 419 | return null; |
380 | } | 420 | } |
381 | 421 | ||
@@ -396,7 +436,11 @@ namespace OpenSim.Services.HypergridService | |||
396 | if (f != null) | 436 | if (f != null) |
397 | { | 437 | { |
398 | if (!IsWithinSuitcaseTree(f.Owner, f.ID)) | 438 | if (!IsWithinSuitcaseTree(f.Owner, f.ID)) |
439 | { | ||
440 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Folder {0}/{1} is not within Suitcase tree", | ||
441 | f.Name, f.ID); | ||
399 | return null; | 442 | return null; |
443 | } | ||
400 | } | 444 | } |
401 | 445 | ||
402 | return f; | 446 | return f; |