aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2009-12-30 22:23:17 +0000
committerMelanie2009-12-30 22:23:17 +0000
commitb6097ae9a8a4566330d882213179feba6d05da62 (patch)
tree382dc5f27e9734076f2808b07c8804323cc27f38
parentMerge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/open... (diff)
downloadopensim-SC-b6097ae9a8a4566330d882213179feba6d05da62.zip
opensim-SC-b6097ae9a8a4566330d882213179feba6d05da62.tar.gz
opensim-SC-b6097ae9a8a4566330d882213179feba6d05da62.tar.bz2
opensim-SC-b6097ae9a8a4566330d882213179feba6d05da62.tar.xz
Some modifications to user service. Query by name is implemented now
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/IUserAccountData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserAccountData.cs5
-rw-r--r--OpenSim/Data/MySQL/MySQLUserAccountData.cs1
-rw-r--r--OpenSim/Services/Interfaces/IUserService.cs16
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs15
5 files changed, 30 insertions, 8 deletions
diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs
index 3d0dde4..5ebe7d3 100644
--- a/OpenSim/Data/IUserAccountData.cs
+++ b/OpenSim/Data/IUserAccountData.cs
@@ -46,6 +46,7 @@ namespace OpenSim.Data
46 /// </summary> 46 /// </summary>
47 public interface IUserAccountData 47 public interface IUserAccountData
48 { 48 {
49 UserAccountData[] Get(string[] fields, string[] values);
49 bool Store(UserAccountData data, UUID principalID, string token); 50 bool Store(UserAccountData data, UUID principalID, string token);
50 } 51 }
51} 52}
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
index 4db2777..01750d8 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
@@ -189,5 +189,10 @@ namespace OpenSim.Data.MSSQL
189 } 189 }
190 return false; 190 return false;
191 } 191 }
192
193 public UserAccountData[] Get(string[] keys, string[] vals)
194 {
195 return null;
196 }
192 } 197 }
193} 198}
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index c6eb44d..e2ce6d1 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -41,6 +41,7 @@ namespace OpenSim.Data.MySQL
41 : base(connectionString, realm, "UserAccount") 41 : base(connectionString, realm, "UserAccount")
42 { 42 {
43 } 43 }
44
44 public bool Store(UserAccountData data, UUID principalID, string token) 45 public bool Store(UserAccountData data, UUID principalID, string token)
45 { 46 {
46 return Store(data); 47 return Store(data);
diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs
index e4e4bec..1bdaaab 100644
--- a/OpenSim/Services/Interfaces/IUserService.cs
+++ b/OpenSim/Services/Interfaces/IUserService.cs
@@ -37,20 +37,20 @@ namespace OpenSim.Services.Interfaces
37 { 37 {
38 } 38 }
39 39
40 public UserAccount(UUID userID) 40 public UserAccount(UUID principalID)
41 { 41 {
42 UserID = userID; 42 PrincipalID = principalID;
43 } 43 }
44 44
45 public string FirstName; 45 public string FirstName;
46 public string LastName; 46 public string LastName;
47 public string Email; 47 public string Email;
48 public UUID UserID; 48 public UUID PrincipalID;
49 public UUID ScopeID; 49 public UUID ScopeID;
50 50
51 public Dictionary<string, object> ServiceURLs; 51 public Dictionary<string, object> ServiceURLs;
52 52
53 public DateTime Created; 53 public int Created;
54 54
55 public UserAccount(Dictionary<string, object> kvp) 55 public UserAccount(Dictionary<string, object> kvp)
56 { 56 {
@@ -60,12 +60,12 @@ namespace OpenSim.Services.Interfaces
60 LastName = kvp["LastName"].ToString(); 60 LastName = kvp["LastName"].ToString();
61 if (kvp.ContainsKey("Email")) 61 if (kvp.ContainsKey("Email"))
62 Email = kvp["Email"].ToString(); 62 Email = kvp["Email"].ToString();
63 if (kvp.ContainsKey("UserID")) 63 if (kvp.ContainsKey("PrincipalID"))
64 UUID.TryParse(kvp["UserID"].ToString(), out UserID); 64 UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID);
65 if (kvp.ContainsKey("ScopeID")) 65 if (kvp.ContainsKey("ScopeID"))
66 UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); 66 UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID);
67 if (kvp.ContainsKey("Created")) 67 if (kvp.ContainsKey("Created"))
68 DateTime.TryParse(kvp["Created"].ToString(), out Created); 68 Convert.ToInt32(kvp["Created"].ToString());
69 if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary<string, string>)) 69 if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary<string, string>))
70 ServiceURLs = (Dictionary<string, object>)kvp["ServiceURLs"]; 70 ServiceURLs = (Dictionary<string, object>)kvp["ServiceURLs"];
71 } 71 }
@@ -76,7 +76,7 @@ namespace OpenSim.Services.Interfaces
76 result["FirstName"] = FirstName; 76 result["FirstName"] = FirstName;
77 result["LastName"] = LastName; 77 result["LastName"] = LastName;
78 result["Email"] = Email; 78 result["Email"] = Email;
79 result["UserID"] = UserID.ToString(); 79 result["PrincipalID"] = PrincipalID.ToString();
80 result["ScopeID"] = ScopeID.ToString(); 80 result["ScopeID"] = ScopeID.ToString();
81 result["Created"] = Created.ToString(); 81 result["Created"] = Created.ToString();
82 result["ServiceURLs"] = ServiceURLs; 82 result["ServiceURLs"] = ServiceURLs;
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 2e6f7dc..ee9ea94 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -44,6 +44,21 @@ namespace OpenSim.Services.UserAccountService
44 public UserAccount GetUserAccount(UUID scopeID, string firstName, 44 public UserAccount GetUserAccount(UUID scopeID, string firstName,
45 string lastName) 45 string lastName)
46 { 46 {
47 UserAccountData[] d = m_Database.Get(
48 new string[] {"ScopeID", "FirstName", "LastName"},
49 new string[] {scopeID.ToString(), firstName, lastName});
50
51 if (d.Length < 1)
52 return null;
53
54 UserAccount u = new UserAccount();
55 u.FirstName = d[0].FirstName;
56 u.LastName = d[0].LastName;
57 u.PrincipalID = d[0].PrincipalID;
58 u.ScopeID = d[0].ScopeID;
59 u.Email = d[0].Data["Email"].ToString();
60 u.Created = Convert.ToInt32(d[0].Data["Created"].ToString());
61
47 return null; 62 return null;
48 } 63 }
49 64