aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorDiva Canto2010-01-13 14:16:05 -0800
committerDiva Canto2010-01-13 14:16:05 -0800
commit24ab3e2d5ff913a2f35c320f3a3092052bd80e0d (patch)
tree935917149fa9b0216bfb29cbb94251f9f565cc04 /OpenSim/Services
parentBug fix: if user doesn't have an avatar in storage, create one upon first login. (diff)
downloadopensim-SC_OLD-24ab3e2d5ff913a2f35c320f3a3092052bd80e0d.zip
opensim-SC_OLD-24ab3e2d5ff913a2f35c320f3a3092052bd80e0d.tar.gz
opensim-SC_OLD-24ab3e2d5ff913a2f35c320f3a3092052bd80e0d.tar.bz2
opensim-SC_OLD-24ab3e2d5ff913a2f35c320f3a3092052bd80e0d.tar.xz
Fixed mixed-case use in UserAccounts table. Plus some more sanity checks on filling out the UserAccount data.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs32
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountServiceBase.cs2
2 files changed, 21 insertions, 13 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index c55013f..ffb9cca 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -122,28 +122,36 @@ namespace OpenSim.Services.UserAccountService
122 u.LastName = d.LastName; 122 u.LastName = d.LastName;
123 u.PrincipalID = d.PrincipalID; 123 u.PrincipalID = d.PrincipalID;
124 u.ScopeID = d.ScopeID; 124 u.ScopeID = d.ScopeID;
125 u.Email = d.Data["Email"].ToString(); 125 if (d.Data.ContainsKey("Email") && d.Data["Email"] != null)
126 u.Email = d.Data["Email"].ToString();
127 else
128 u.Email = string.Empty;
126 u.Created = Convert.ToInt32(d.Data["Created"].ToString()); 129 u.Created = Convert.ToInt32(d.Data["Created"].ToString());
127 if (d.Data["UserTitle"] != null) 130 if (d.Data.ContainsKey("UserTitle") && d.Data["UserTitle"] != null)
128 u.UserTitle = d.Data["UserTitle"].ToString(); 131 u.UserTitle = d.Data["UserTitle"].ToString();
129 else 132 else
130 u.UserTitle = string.Empty; 133 u.UserTitle = string.Empty;
131 134
132 string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' }); 135 if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
133 u.ServiceURLs = new Dictionary<string, object>();
134
135 foreach (string url in URLs)
136 { 136 {
137 string[] parts = url.Split(new char[] { '=' }); 137 string[] URLs = d.Data["ServiceURLs"].ToString().Split(new char[] { ' ' });
138 u.ServiceURLs = new Dictionary<string, object>();
139
140 foreach (string url in URLs)
141 {
142 string[] parts = url.Split(new char[] { '=' });
138 143
139 if (parts.Length != 2) 144 if (parts.Length != 2)
140 continue; 145 continue;
141 146
142 string name = System.Web.HttpUtility.UrlDecode(parts[0]); 147 string name = System.Web.HttpUtility.UrlDecode(parts[0]);
143 string val = System.Web.HttpUtility.UrlDecode(parts[1]); 148 string val = System.Web.HttpUtility.UrlDecode(parts[1]);
144 149
145 u.ServiceURLs[name] = val; 150 u.ServiceURLs[name] = val;
151 }
146 } 152 }
153 else
154 u.ServiceURLs = new Dictionary<string, object>();
147 155
148 return u; 156 return u;
149 } 157 }
diff --git a/OpenSim/Services/UserAccountService/UserAccountServiceBase.cs b/OpenSim/Services/UserAccountService/UserAccountServiceBase.cs
index 70ed594..c1a7b76 100644
--- a/OpenSim/Services/UserAccountService/UserAccountServiceBase.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountServiceBase.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Services.UserAccountService
42 { 42 {
43 string dllName = String.Empty; 43 string dllName = String.Empty;
44 string connString = String.Empty; 44 string connString = String.Empty;
45 string realm = "useraccounts"; 45 string realm = "UserAccounts";
46 46
47 IConfig dbConfig = config.Configs["DatabaseService"]; 47 IConfig dbConfig = config.Configs["DatabaseService"];
48 if (dbConfig != null) 48 if (dbConfig != null)