29 using System.Collections.Generic;
32 using OpenSim.Framework;
34 namespace OpenSim.Services.Interfaces
44 PrincipalID = principalID;
64 public UserAccount(UUID scopeID,
string firstName,
string lastName,
string email)
66 PrincipalID = UUID.Random();
68 FirstName = firstName;
71 ServiceURLs =
new Dictionary<string, object>();
72 Created = Util.UnixTimeSinceEpoch();
75 public UserAccount(UUID scopeID, UUID principalID,
string firstName,
string lastName,
string email)
77 PrincipalID = principalID;
79 FirstName = firstName;
82 ServiceURLs =
new Dictionary<string, object>();
83 Created = Util.UnixTimeSinceEpoch();
95 public Boolean LocalToGrid =
true;
103 get {
return FirstName +
" " + LastName; }
108 if (kvp.ContainsKey(
"FirstName"))
109 FirstName = kvp[
"FirstName"].ToString();
110 if (kvp.ContainsKey(
"LastName"))
111 LastName = kvp[
"LastName"].ToString();
112 if (kvp.ContainsKey(
"Email"))
113 Email = kvp[
"Email"].ToString();
114 if (kvp.ContainsKey(
"PrincipalID"))
115 UUID.TryParse(kvp[
"PrincipalID"].ToString(), out PrincipalID);
116 if (kvp.ContainsKey(
"ScopeID"))
117 UUID.TryParse(kvp[
"ScopeID"].ToString(), out ScopeID);
118 if (kvp.ContainsKey(
"UserLevel"))
119 UserLevel = Convert.ToInt32(kvp[
"UserLevel"].ToString());
120 if (kvp.ContainsKey(
"UserFlags"))
121 UserFlags = Convert.ToInt32(kvp[
"UserFlags"].ToString());
122 if (kvp.ContainsKey(
"UserTitle"))
123 UserTitle = kvp[
"UserTitle"].ToString();
124 if (kvp.ContainsKey(
"UserCountry"))
125 UserCountry = kvp[
"UserCountry"].ToString();
126 if (kvp.ContainsKey(
"LocalToGrid"))
127 Boolean.TryParse(kvp[
"LocalToGrid"].ToString(), out LocalToGrid);
129 if (kvp.ContainsKey(
"Created"))
130 Created = Convert.ToInt32(kvp[
"Created"].ToString());
131 if (kvp.ContainsKey(
"ServiceURLs") && kvp[
"ServiceURLs"] != null)
133 ServiceURLs =
new Dictionary<string, object>();
134 string str = kvp[
"ServiceURLs"].ToString();
135 if (str !=
string.Empty)
137 string[] parts = str.Split(
new char[] {
';' });
139 foreach (
string s
in parts)
141 string[] parts2 = s.Split(
new char[] {
'*' });
142 if (parts2.Length == 2)
143 ServiceURLs[parts2[0]] = parts2[1];
151 Dictionary<string, object> result =
new Dictionary<string, object>();
152 result[
"FirstName"] = FirstName;
153 result[
"LastName"] = LastName;
154 result[
"Email"] = Email;
155 result[
"PrincipalID"] = PrincipalID.ToString();
156 result[
"ScopeID"] = ScopeID.ToString();
157 result[
"Created"] = Created.ToString();
158 result[
"UserLevel"] = UserLevel.ToString();
159 result[
"UserFlags"] = UserFlags.ToString();
160 result[
"UserTitle"] = UserTitle;
161 result[
"UserCountry"] = UserCountry;
162 result[
"LocalToGrid"] = LocalToGrid.ToString();
164 string str = string.Empty;
165 foreach (KeyValuePair<string, object> kvp
in ServiceURLs)
167 str += kvp.Key +
"*" + (kvp.Value == null ?
"" : kvp.Value) +
";";
169 result[
"ServiceURLs"] = str;
178 UserAccount GetUserAccount(UUID scopeID, UUID userID);
179 UserAccount GetUserAccount(UUID scopeID,
string FirstName,
string LastName);
180 UserAccount GetUserAccount(UUID scopeID,
string Email);
188 List<UserAccount> GetUserAccounts(UUID scopeID,
string query);
189 List<UserAccount> GetUserAccountsWhere(UUID scopeID,
string where);
198 void InvalidateCache(UUID userID);
UserAccount(UUID scopeID, UUID principalID, string firstName, string lastName, string email)
UserAccount(UUID principalID)
Dictionary< string, object > ToKeyValuePairs()
UserAccount(UUID scopeID, string firstName, string lastName, string email)
Initializes a new instance of the OpenSim.Services.Interfaces.UserAccount class. This method is used ...
Dictionary< string, object > ServiceURLs
UserAccount(Dictionary< string, object > kvp)