Expose Delete at IUserAccountData interface. It was there already. No changes in IUserAccountService, just the data layer.
parent
26e3884237
commit
930d374525
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue