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,28 +122,36 @@ 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;
u.Email = d.Data["Email"].ToString(); if (d.Data.ContainsKey("Email") && d.Data["Email"] != null)
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;
string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' }); if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
u.ServiceURLs = new Dictionary<string, object>();
foreach (string url in URLs)
{ {
string[] parts = url.Split(new char[] { '=' }); string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' });
u.ServiceURLs = new Dictionary<string, object>();
if (parts.Length != 2) foreach (string url in URLs)
continue; {
string[] parts = url.Split(new char[] { '=' });
string name = System.Web.HttpUtility.UrlDecode(parts[0]); if (parts.Length != 2)
string val = System.Web.HttpUtility.UrlDecode(parts[1]); continue;
u.ServiceURLs[name] = val; string name = System.Web.HttpUtility.UrlDecode(parts[0]);
string val = System.Web.HttpUtility.UrlDecode(parts[1]);
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)