diff options
author | Melanie | 2009-12-31 01:34:03 +0000 |
---|---|---|
committer | Melanie | 2009-12-31 01:34:03 +0000 |
commit | 99ad7aac7f854eaae075e93880c39796183ba7e4 (patch) | |
tree | f433ba30315e528bc4c4df6619f2309afb45a29f | |
parent | Remove CreateUserAccount. Rename SetUserAccount to StoreUserAccount. (diff) | |
download | opensim-SC_OLD-99ad7aac7f854eaae075e93880c39796183ba7e4.zip opensim-SC_OLD-99ad7aac7f854eaae075e93880c39796183ba7e4.tar.gz opensim-SC_OLD-99ad7aac7f854eaae075e93880c39796183ba7e4.tar.bz2 opensim-SC_OLD-99ad7aac7f854eaae075e93880c39796183ba7e4.tar.xz |
Implement saving user account data
-rw-r--r-- | OpenSim/Data/IUserAccountData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLUserAccountData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserAccountData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 23 |
4 files changed, 26 insertions, 5 deletions
diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs index 5ebe7d3..e350a18 100644 --- a/OpenSim/Data/IUserAccountData.cs +++ b/OpenSim/Data/IUserAccountData.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Data | |||
38 | public UUID ScopeID; | 38 | public UUID ScopeID; |
39 | public string FirstName; | 39 | public string FirstName; |
40 | public string LastName; | 40 | public string LastName; |
41 | public Dictionary<string, object> Data; | 41 | public Dictionary<string, string> Data; |
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
@@ -47,6 +47,6 @@ namespace OpenSim.Data | |||
47 | public interface IUserAccountData | 47 | public interface IUserAccountData |
48 | { | 48 | { |
49 | UserAccountData[] Get(string[] fields, string[] values); | 49 | UserAccountData[] Get(string[] fields, string[] values); |
50 | bool Store(UserAccountData data, UUID principalID, string token); | 50 | bool Store(UserAccountData data); |
51 | } | 51 | } |
52 | } | 52 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs index 01750d8..ca09029 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Data.MSSQL | |||
65 | public UserAccountData Get(UUID principalID, UUID scopeID) | 65 | public UserAccountData Get(UUID principalID, UUID scopeID) |
66 | { | 66 | { |
67 | UserAccountData ret = new UserAccountData(); | 67 | UserAccountData ret = new UserAccountData(); |
68 | ret.Data = new Dictionary<string, object>(); | 68 | ret.Data = new Dictionary<string, string>(); |
69 | 69 | ||
70 | string sql = string.Format("select * from {0} where UUID = @principalID", m_Realm); | 70 | string sql = string.Format("select * from {0} where UUID = @principalID", m_Realm); |
71 | if (scopeID != UUID.Zero) | 71 | if (scopeID != UUID.Zero) |
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index e2ce6d1..ae7d5ca 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Data.MySQL | |||
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
45 | public bool Store(UserAccountData data, UUID principalID, string token) | 45 | public bool Store(UserAccountData data) |
46 | { | 46 | { |
47 | return Store(data); | 47 | return Store(data); |
48 | } | 48 | } |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 706da84..2954589 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -142,7 +142,28 @@ namespace OpenSim.Services.UserAccountService | |||
142 | 142 | ||
143 | public bool StoreUserAccount(UserAccount data) | 143 | public bool StoreUserAccount(UserAccount data) |
144 | { | 144 | { |
145 | return false; | 145 | UserAccountData d = new UserAccountData(); |
146 | |||
147 | d.FirstName = data.FirstName; | ||
148 | d.LastName = data.LastName; | ||
149 | d.PrincipalID = data.PrincipalID; | ||
150 | d.ScopeID = data.ScopeID; | ||
151 | d.Data = new Dictionary<string,string>(); | ||
152 | d.Data["Email"] = data.Email; | ||
153 | d.Data["Created"] = data.Created.ToString(); | ||
154 | |||
155 | List<string> parts = new List<string>(); | ||
156 | |||
157 | foreach (KeyValuePair<string,object> kvp in data.ServiceURLs) | ||
158 | { | ||
159 | string key = System.Web.HttpUtility.UrlEncode(kvp.Key); | ||
160 | string val = System.Web.HttpUtility.UrlEncode(kvp.Value.ToString()); | ||
161 | parts.Add(key + "=" + val); | ||
162 | } | ||
163 | |||
164 | d.Data["ServiceURLs"] = string.Join(" ", parts.ToArray()); | ||
165 | |||
166 | return m_Database.Store(d); | ||
146 | } | 167 | } |
147 | 168 | ||
148 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) | 169 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) |