private OSDMap ConfirmUserEmailName(OSDMap map)
{
string Name = map["Name"].AsString();
string Email = map["Email"].AsString();
OSDMap resp = new OSDMap();
IUserAccountService accountService = m_registry.RequestModuleInterface<IUserAccountService>();
UserAccount user = accountService.GetUserAccount(null, Name);
bool verified = user != null;
resp["Verified"] = OSD.FromBoolean(verified);
if (verified)
{
resp["UUID"] = OSD.FromUUID(user.PrincipalID);
if (user.UserLevel >= 0)
{
if (user.Email.ToLower() != Email.ToLower())
{
MainConsole.Instance.TraceFormat("User email for account \"{0}\" is \"{1}\" but \"{2}\" was specified.", Name, user.Email.ToString(), Email);
resp["Error"] = OSD.FromString("Email does not match the user name.");
resp["ErrorCode"] = OSD.FromInteger(3);
}
}
else
{
resp["Error"] = OSD.FromString("This account is disabled.");
resp["ErrorCode"] = OSD.FromInteger(2);
}
}
else
{
resp["Error"] = OSD.FromString("No such user.");
resp["ErrorCode"] = OSD.FromInteger(1);
}
return resp;
}