aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AuthenticationService
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
index f6dd085..9af61a9 100644
--- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
+++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
@@ -106,12 +106,17 @@ namespace OpenSim.Services.AuthenticationService
106 string passwordSalt = Util.Md5Hash(UUID.Random().ToString()); 106 string passwordSalt = Util.Md5Hash(UUID.Random().ToString());
107 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + passwordSalt); 107 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + passwordSalt);
108 108
109 AuthenticationData auth = new AuthenticationData(); 109 AuthenticationData auth = m_Database.Get(principalID);
110 auth.PrincipalID = principalID; 110 if (auth == null)
111 auth.Data = new System.Collections.Generic.Dictionary<string, object>(); 111 {
112 auth = new AuthenticationData();
113 auth.PrincipalID = principalID;
114 auth.Data = new System.Collections.Generic.Dictionary<string, object>();
115 auth.Data["accountType"] = "UserAccount";
116 auth.Data["webLoginKey"] = UUID.Zero.ToString();
117 }
112 auth.Data["passwordHash"] = md5PasswdHash; 118 auth.Data["passwordHash"] = md5PasswdHash;
113 auth.Data["passwordSalt"] = passwordSalt; 119 auth.Data["passwordSalt"] = passwordSalt;
114 auth.Data["webLoginKey"] = UUID.Zero.ToString();
115 if (!m_Database.Store(auth)) 120 if (!m_Database.Store(auth))
116 { 121 {
117 m_log.DebugFormat("[AUTHENTICATION DB]: Failed to store authentication data"); 122 m_log.DebugFormat("[AUTHENTICATION DB]: Failed to store authentication data");