From b46de6e025f1179f13841e1a8ccb1031b598895b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Dec 2010 03:09:00 +0000 Subject: Remove the restriction that you have to be logged in when loading/saving iars This is pointless as we're supplying the password on the command line --- .../Inventory/Archiver/InventoryArchiverModule.cs | 128 ++++++++++----------- .../Archiver/Tests/InventoryArchiverTests.cs | 14 +-- 2 files changed, 70 insertions(+), 72 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index b33c2b1..1e18095 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// Enable or disable checking whether the iar user is actually logged in /// - public bool DisablePresenceChecks { get; set; } +// public bool DisablePresenceChecks { get; set; } public event InventoryArchiveSaved OnInventoryArchiveSaved; @@ -95,10 +95,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public InventoryArchiverModule() {} - public InventoryArchiverModule(bool disablePresenceChecks) - { - DisablePresenceChecks = disablePresenceChecks; - } +// public InventoryArchiverModule(bool disablePresenceChecks) +// { +// DisablePresenceChecks = disablePresenceChecks; +// } public void Initialise(Scene scene, IConfigSource source) { @@ -172,8 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { try { new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService); @@ -189,13 +189,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -212,8 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { try { new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService); @@ -229,13 +229,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -257,9 +257,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { - +// if (CheckPresence(userInfo.PrincipalID)) +// { InventoryArchiveReadRequest request; bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); @@ -280,13 +279,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } else m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found", @@ -306,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { InventoryArchiveReadRequest request; bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); @@ -328,13 +327,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -529,28 +528,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } } - /// - /// Check if the given user is present in any of the scenes. - /// - /// The user to check - /// true if the user is in any of the scenes, false otherwise - protected bool CheckPresence(UUID userId) - { - if (DisablePresenceChecks) - return true; - - foreach (Scene scene in m_scenes.Values) - { - ScenePresence p; - if ((p = scene.GetScenePresence(userId)) != null) - { - p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); - return true; - } - } - - return false; - } - +// /// +// /// Check if the given user is present in any of the scenes. +// /// +// /// The user to check +// /// true if the user is in any of the scenes, false otherwise +// protected bool CheckPresence(UUID userId) +// { +// if (DisablePresenceChecks) +// return true; +// +// foreach (Scene scene in m_scenes.Values) +// { +// ScenePresence p; +// if ((p = scene.GetScenePresence(userId)) != null) +// { +// p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); +// return true; +// } +// } +// +// return false; +// } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 2747e15..76d0b85 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests TestHelper.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests TestHelper.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // log4net.Config.XmlConfigurator.Configure(); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("inventory"); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); @@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests //log4net.Config.XmlConfigurator.Configure(); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene Scene scene = SceneSetupHelpers.SetupScene("inventory"); @@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string humanEscapedItemName = @"You & you are a mean\/man\/"; string userPassword = "meowfood"; - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene Scene scene = SceneSetupHelpers.SetupScene("inventory"); @@ -619,7 +619,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); // SerialiserModule serialiserModule = new SerialiserModule(); - // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + // InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Scene scene = SceneSetupHelpers.SetupScene(); -- cgit v1.1