diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0eecf06642..063dd91835 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -48,6 +48,10 @@ namespace OpenSim.Data.MySQL /// private MySQLManager database; + private bool rollbackStore = false; + private bool opengridmode = false; + private string rollbackDir = ""; + public void Initialise() { m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); @@ -82,6 +86,10 @@ namespace OpenSim.Data.MySQL string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); + rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir"); + rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; + opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; + database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); @@ -851,16 +859,25 @@ namespace OpenSim.Data.MySQL { List subFolders = getFolderHierarchy(folderID); - //Delete all sub-folders - foreach (InventoryFolderBase f in subFolders) + // Dont delete in OGM - makes for easier restores if someone sends a malcious command. (just restore the folder entry) + if (opengridmode == false) { - deleteOneFolder(f.ID); - deleteItemsInFolder(f.ID); + //Delete all sub-folders + foreach (InventoryFolderBase f in subFolders) + { + deleteOneFolder(f.ID); + deleteItemsInFolder(f.ID); + } } //Delete the actual row deleteOneFolder(folderID); - deleteItemsInFolder(folderID); + + // Just delete the folder context in OGM + if (opengridmode == false) + { + deleteItemsInFolder(folderID); + } } public List fetchActiveGestures(UUID avatarID)