Implement saving user account data
parent
3507005d9d
commit
99ad7aac7f
|
@ -38,7 +38,7 @@ namespace OpenSim.Data
|
||||||
public UUID ScopeID;
|
public UUID ScopeID;
|
||||||
public string FirstName;
|
public string FirstName;
|
||||||
public string LastName;
|
public string LastName;
|
||||||
public Dictionary<string, object> Data;
|
public Dictionary<string, string> Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -47,6 +47,6 @@ namespace OpenSim.Data
|
||||||
public interface IUserAccountData
|
public interface IUserAccountData
|
||||||
{
|
{
|
||||||
UserAccountData[] Get(string[] fields, string[] values);
|
UserAccountData[] Get(string[] fields, string[] values);
|
||||||
bool Store(UserAccountData data, UUID principalID, string token);
|
bool Store(UserAccountData data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
public UserAccountData Get(UUID principalID, UUID scopeID)
|
public UserAccountData Get(UUID principalID, UUID scopeID)
|
||||||
{
|
{
|
||||||
UserAccountData ret = new UserAccountData();
|
UserAccountData ret = new UserAccountData();
|
||||||
ret.Data = new Dictionary<string, object>();
|
ret.Data = new Dictionary<string, string>();
|
||||||
|
|
||||||
string sql = string.Format("select * from {0} where UUID = @principalID", m_Realm);
|
string sql = string.Format("select * from {0} where UUID = @principalID", m_Realm);
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Store(UserAccountData data, UUID principalID, string token)
|
public bool Store(UserAccountData data)
|
||||||
{
|
{
|
||||||
return Store(data);
|
return Store(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,28 @@ namespace OpenSim.Services.UserAccountService
|
||||||
|
|
||||||
public bool StoreUserAccount(UserAccount data)
|
public bool StoreUserAccount(UserAccount data)
|
||||||
{
|
{
|
||||||
return false;
|
UserAccountData d = new UserAccountData();
|
||||||
|
|
||||||
|
d.FirstName = data.FirstName;
|
||||||
|
d.LastName = data.LastName;
|
||||||
|
d.PrincipalID = data.PrincipalID;
|
||||||
|
d.ScopeID = data.ScopeID;
|
||||||
|
d.Data = new Dictionary<string,string>();
|
||||||
|
d.Data["Email"] = data.Email;
|
||||||
|
d.Data["Created"] = data.Created.ToString();
|
||||||
|
|
||||||
|
List<string> parts = new List<string>();
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string,object> kvp in data.ServiceURLs)
|
||||||
|
{
|
||||||
|
string key = System.Web.HttpUtility.UrlEncode(kvp.Key);
|
||||||
|
string val = System.Web.HttpUtility.UrlEncode(kvp.Value.ToString());
|
||||||
|
parts.Add(key + "=" + val);
|
||||||
|
}
|
||||||
|
|
||||||
|
d.Data["ServiceURLs"] = string.Join(" ", parts.ToArray());
|
||||||
|
|
||||||
|
return m_Database.Store(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
|
public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
|
||||||
|
|
Loading…
Reference in New Issue