Skip to content

Commit

Permalink
attempting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Mar 14, 2012
1 parent 09d61a3 commit 73f8a43
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions AuroraService/addon-modules/AuroraWebUI/Modules/WebUIHandler.cs
Expand Up @@ -695,22 +695,22 @@ private OSDMap Login(OSDMap map, bool asAdmin)
string Name = map["Name"].AsString();
string Password = map["Password"].AsString();

ILoginService loginService = m_registry.RequestModuleInterface<ILoginService>();
UUID secureSessionID;
ILoginService loginService = m_registry.RequestModuleInterface<ILoginService>();
IUserAccountService accountService = m_registry.RequestModuleInterface<IUserAccountService>();
UserAccount account = null;
OSDMap resp = new OSDMap ();
resp["Verified"] = OSD.FromBoolean(false);

if(CheckIfUserExists(map)["Verified"] != true){
resp["Verified"] = OSD.FromBoolean(false);

if (accountService == null || CheckIfUserExists(map)["Verified"] != true)
{
return resp;
}
}

account = m_registry.RequestModuleInterface<IUserAccountService>().GetUserAccount(UUID.Zero, Name);

LoginResponse loginresp = loginService.VerifyClient(Name, "UserAccount", Password, UUID.Zero, false, "", "", "", out secureSessionID);
//Null means it went through without an error
Verified = loginresp == null;
if (Verified)
//Null means it went through without an errorz
if (loginService.VerifyClient(account.PrincipalID, Name, "", Password, account.ScopeID))
{
account = m_registry.RequestModuleInterface<IUserAccountService> ().GetUserAccount (UUID.Zero, Name);
if (asAdmin)
{
IAgentInfo agent = Aurora.DataManager.DataManager.RequestPlugin<IAgentConnector>().GetAgent(account.PrincipalID);
Expand Down Expand Up @@ -822,19 +822,23 @@ private OSDMap ConfirmUserEmailName(OSDMap map)
private OSDMap ChangePassword(OSDMap map)
{
string Password = map["Password"].AsString();
string newPassword = map["NewPassword"].AsString();

ILoginService loginService = m_registry.RequestModuleInterface<ILoginService>();
string newPassword = map["NewPassword"].AsString();

ILoginService loginService = m_registry.RequestModuleInterface<ILoginService>();
IUserAccountService accountService = m_registry.RequestModuleInterface<IUserAccountService>();
UUID secureSessionID;
UUID userID = map["UUID"].AsUUID();



UserAccount account = m_registry.RequestModuleInterface<IUserAccountService>().GetUserAccount(UUID.Zero, userID);


IAuthenticationService auths = m_registry.RequestModuleInterface<IAuthenticationService>();

LoginResponse loginresp = loginService.VerifyClient (userID, "UserAccount", Password, UUID.Zero, false, "", "", "", out secureSessionID);
OSDMap resp = new OSDMap();
//Null means it went through without an error
bool Verified = loginresp == null;
//Null means it went through without an error
bool Verified = loginService.VerifyClient(account.PrincipalID, account.Name, "", Password, account.ScopeID);
resp["Verified"] = OSD.FromBoolean(Verified);

if ((auths.Authenticate(userID, "UserAccount", Util.Md5Hash(Password), 100) != string.Empty) && (Verified))
Expand Down

0 comments on commit 73f8a43

Please sign in to comment.