private OSDMap GetGridUserInfo(OSDMap map)
{
string uuid = String.Empty;
uuid = map["UUID"].AsString();
IUserAccountService accountService = m_registry.RequestModuleInterface<IUserAccountService>();
UserAccount user = accountService.GetUserAccount(null, map["UUID"].AsUUID());
IAgentInfoService agentService = m_registry.RequestModuleInterface<IAgentInfoService>();
UserInfo userinfo;
OSDMap resp = new OSDMap();
bool verified = user != null;
resp["Verified"] = OSD.FromBoolean(verified);
if (verified)
{
userinfo = agentService.GetUserInfo(uuid);
IGridService gs = m_registry.RequestModuleInterface<IGridService>();
GridRegion gr = null;
if (userinfo != null)
{
gr = gs.GetRegionByUUID(null, userinfo.HomeRegionID);
}
resp["UUID"] = OSD.FromUUID(user.PrincipalID);
resp["HomeUUID"] = OSD.FromUUID((userinfo == null) ? UUID.Zero : userinfo.HomeRegionID);
resp["HomeName"] = OSD.FromString((userinfo == null) ? "" : gr.RegionName);
resp["Online"] = OSD.FromBoolean((userinfo == null) ? false : userinfo.IsOnline);
resp["Email"] = OSD.FromString(user.Email);
resp["Name"] = OSD.FromString(user.Name);
resp["FirstName"] = OSD.FromString(user.FirstName);
resp["LastName"] = OSD.FromString(user.LastName);
}
return resp;
}