From 930d3745256ced37afb2d91817eba941d06a50b0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 16 Apr 2010 16:36:44 -0700 Subject: Expose Delete at IUserAccountData interface. It was there already. No changes in IUserAccountService, just the data layer. --- OpenSim/Data/IUserAccountData.cs | 1 + OpenSim/Data/Null/NullUserAccountData.cs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs index 6ee5995..906ba6c 100644 --- a/OpenSim/Data/IUserAccountData.cs +++ b/OpenSim/Data/IUserAccountData.cs @@ -48,6 +48,7 @@ namespace OpenSim.Data { UserAccountData[] Get(string[] fields, string[] values); bool Store(UserAccountData data); + bool Delete(string field, string val); UserAccountData[] GetUsers(UUID scopeID, string query); } } diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs index fc2c5d5..9eb94e6 100644 --- a/OpenSim/Data/Null/NullUserAccountData.cs +++ b/OpenSim/Data/Null/NullUserAccountData.cs @@ -135,5 +135,26 @@ namespace OpenSim.Data.Null return result; } + public bool Delete(string field, string val) + { + // Only delete by PrincipalID + if (field.Equals("PrincipalID")) + { + UUID uuid = UUID.Zero; + if (UUID.TryParse(val, out uuid) && m_DataByUUID.ContainsKey(uuid)) + { + UserAccountData account = m_DataByUUID[uuid]; + m_DataByUUID.Remove(uuid); + if (m_DataByName.ContainsKey(account.FirstName + " " + account.LastName)) + m_DataByName.Remove(account.FirstName + " " + account.LastName); + if (account.Data.ContainsKey("Email") && account.Data["Email"] != string.Empty && m_DataByEmail.ContainsKey(account.Data["Email"])) + m_DataByEmail.Remove(account.Data["Email"]); + + return true; + } + } + + return false; + } } } -- cgit v1.1