From df59d098b319367394bdeb898d7fd7dacd7104ec Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Feb 2010 20:13:38 -0800 Subject: SQLite connector better, but access to tables still doesn't work. --- .../AuthenticationService/AuthenticationServiceBase.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services/AuthenticationService') 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 string passwordSalt = Util.Md5Hash(UUID.Random().ToString()); string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + passwordSalt); - AuthenticationData auth = new AuthenticationData(); - auth.PrincipalID = principalID; - auth.Data = new System.Collections.Generic.Dictionary(); + AuthenticationData auth = m_Database.Get(principalID); + if (auth == null) + { + auth = new AuthenticationData(); + auth.PrincipalID = principalID; + auth.Data = new System.Collections.Generic.Dictionary(); + auth.Data["accountType"] = "UserAccount"; + auth.Data["webLoginKey"] = UUID.Zero.ToString(); + } auth.Data["passwordHash"] = md5PasswdHash; auth.Data["passwordSalt"] = passwordSalt; - auth.Data["webLoginKey"] = UUID.Zero.ToString(); if (!m_Database.Store(auth)) { m_log.DebugFormat("[AUTHENTICATION DB]: Failed to store authentication data"); -- cgit v1.1