Expose Delete at IUserAccountData interface. It was there already. No changes in IUserAccountService, just the data layer.

slimupdates
Diva Canto 2010-04-16 16:36:44 -07:00
parent 26e3884237
commit 930d374525
2 changed files with 22 additions and 0 deletions

View File

@ -48,6 +48,7 @@ namespace OpenSim.Data
{ {
UserAccountData[] Get(string[] fields, string[] values); UserAccountData[] Get(string[] fields, string[] values);
bool Store(UserAccountData data); bool Store(UserAccountData data);
bool Delete(string field, string val);
UserAccountData[] GetUsers(UUID scopeID, string query); UserAccountData[] GetUsers(UUID scopeID, string query);
} }
} }

View File

@ -135,5 +135,26 @@ namespace OpenSim.Data.Null
return result; 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;
}
} }
} }