Fixed mixed-case use in UserAccounts table. Plus some more sanity checks on filling out the UserAccount data.

slimupdates
Diva Canto 2010-01-13 14:16:05 -08:00
parent e09c9fbe14
commit 24ab3e2d5f
2 changed files with 21 additions and 13 deletions

View File

@ -122,13 +122,18 @@ namespace OpenSim.Services.UserAccountService
u.LastName = d.LastName; u.LastName = d.LastName;
u.PrincipalID = d.PrincipalID; u.PrincipalID = d.PrincipalID;
u.ScopeID = d.ScopeID; u.ScopeID = d.ScopeID;
if (d.Data.ContainsKey("Email") && d.Data["Email"] != null)
u.Email = d.Data["Email"].ToString(); u.Email = d.Data["Email"].ToString();
else
u.Email = string.Empty;
u.Created = Convert.ToInt32(d.Data["Created"].ToString()); u.Created = Convert.ToInt32(d.Data["Created"].ToString());
if (d.Data["UserTitle"] != null) if (d.Data.ContainsKey("UserTitle") && d.Data["UserTitle"] != null)
u.UserTitle = d.Data["UserTitle"].ToString(); u.UserTitle = d.Data["UserTitle"].ToString();
else else
u.UserTitle = string.Empty; u.UserTitle = string.Empty;
if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
{
string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' }); string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' });
u.ServiceURLs = new Dictionary<string, object>(); u.ServiceURLs = new Dictionary<string, object>();
@ -144,6 +149,9 @@ namespace OpenSim.Services.UserAccountService
u.ServiceURLs[name] = val; u.ServiceURLs[name] = val;
} }
}
else
u.ServiceURLs = new Dictionary<string, object>();
return u; return u;
} }

View File

@ -42,7 +42,7 @@ namespace OpenSim.Services.UserAccountService
{ {
string dllName = String.Empty; string dllName = String.Empty;
string connString = String.Empty; string connString = String.Empty;
string realm = "useraccounts"; string realm = "UserAccounts";
IConfig dbConfig = config.Configs["DatabaseService"]; IConfig dbConfig = config.Configs["DatabaseService"];
if (dbConfig != null) if (dbConfig != null)