diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Services/UserAccountService | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Services/UserAccountService')
6 files changed, 330 insertions, 22 deletions
diff --git a/OpenSim/Services/UserAccountService/AgentPreferencesService.cs b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs new file mode 100644 index 0000000..1808ee5 --- /dev/null +++ b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Data; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | |||
38 | namespace OpenSim.Services.UserAccountService | ||
39 | { | ||
40 | public class AgentPreferencesService : AgentPreferencesServiceBase, IAgentPreferencesService | ||
41 | { | ||
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
44 | public AgentPreferencesService(IConfigSource config) : base(config) | ||
45 | { | ||
46 | m_log.Debug("[AGENT PREFERENCES SERVICE]: Starting agent preferences service"); | ||
47 | } | ||
48 | |||
49 | public AgentPrefs GetAgentPreferences(UUID principalID) | ||
50 | { | ||
51 | AgentPreferencesData d = m_Database.GetPrefs(principalID); | ||
52 | AgentPrefs prefs = (d == null) ? new AgentPrefs(principalID) : new AgentPrefs(d.Data); | ||
53 | return prefs; | ||
54 | } | ||
55 | |||
56 | public bool StoreAgentPreferences(AgentPrefs data) | ||
57 | { | ||
58 | AgentPreferencesData d = new AgentPreferencesData(); | ||
59 | d.Data = new Dictionary<string, string>(); | ||
60 | d.Data["PrincipalID"] = data.PrincipalID.ToString(); | ||
61 | d.Data["AccessPrefs"] = data.AccessPrefs; | ||
62 | d.Data["HoverHeight"] = data.HoverHeight.ToString(); | ||
63 | d.Data["Language"] = data.Language; | ||
64 | d.Data["LanguageIsPublic"] = (data.LanguageIsPublic ? "1" : "0"); | ||
65 | d.Data["PermEveryone"] = data.PermEveryone.ToString(); | ||
66 | d.Data["PermGroup"] = data.PermGroup.ToString(); | ||
67 | d.Data["PermNextOwner"] = data.PermNextOwner.ToString(); | ||
68 | return m_Database.Store(d); | ||
69 | } | ||
70 | |||
71 | public string GetLang(UUID principalID) | ||
72 | { | ||
73 | AgentPrefs data = GetAgentPreferences(principalID); | ||
74 | if (data != null) | ||
75 | { | ||
76 | if (data.LanguageIsPublic) | ||
77 | return data.Language; | ||
78 | } | ||
79 | return "en-us"; | ||
80 | } | ||
81 | } | ||
82 | } | ||
diff --git a/OpenSim/Services/UserAccountService/AgentPreferencesServiceBase.cs b/OpenSim/Services/UserAccountService/AgentPreferencesServiceBase.cs new file mode 100644 index 0000000..5974349 --- /dev/null +++ b/OpenSim/Services/UserAccountService/AgentPreferencesServiceBase.cs | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using Nini.Config; | ||
31 | using OpenSim.Data; | ||
32 | using OpenSim.Services.Interfaces; | ||
33 | using OpenSim.Services.Base; | ||
34 | |||
35 | namespace OpenSim.Services.UserAccountService | ||
36 | { | ||
37 | public class AgentPreferencesServiceBase: ServiceBase | ||
38 | { | ||
39 | protected IAgentPreferencesData m_Database = null; | ||
40 | |||
41 | public AgentPreferencesServiceBase(IConfigSource config) : base(config) | ||
42 | { | ||
43 | string dllName = String.Empty; | ||
44 | string connString = String.Empty; | ||
45 | string realm = "AgentPrefs"; | ||
46 | |||
47 | IConfig dbConfig = config.Configs["DatabaseService"]; | ||
48 | if (dbConfig != null) | ||
49 | { | ||
50 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | ||
51 | connString = dbConfig.GetString("ConnectionString", String.Empty); | ||
52 | } | ||
53 | |||
54 | IConfig userConfig = config.Configs["AgentPreferencesService"]; | ||
55 | if (userConfig == null) | ||
56 | throw new Exception("No AgentPreferencesService configuration"); | ||
57 | |||
58 | dllName = userConfig.GetString("StorageProvider", dllName); | ||
59 | |||
60 | if (dllName == String.Empty) | ||
61 | throw new Exception("No StorageProvider configured"); | ||
62 | |||
63 | connString = userConfig.GetString("ConnectionString", connString); | ||
64 | |||
65 | realm = userConfig.GetString("Realm", realm); | ||
66 | |||
67 | m_Database = LoadPlugin<IAgentPreferencesData>(dllName, new Object[] {connString, realm}); | ||
68 | |||
69 | if (m_Database == null) | ||
70 | throw new Exception("Could not find a storage interface in the given module"); | ||
71 | } | ||
72 | } | ||
73 | } | ||
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 43fa04b..80a9d9d 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs | |||
@@ -43,15 +43,117 @@ namespace OpenSim.Services.UserAccountService | |||
43 | public class GridUserService : GridUserServiceBase, IGridUserService | 43 | public class GridUserService : GridUserServiceBase, IGridUserService |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | private static bool m_Initialized; | ||
46 | 47 | ||
47 | public GridUserService(IConfigSource config) : base(config) | 48 | public GridUserService(IConfigSource config) : base(config) |
48 | { | 49 | { |
49 | m_log.Debug("[USER GRID SERVICE]: Starting user grid service"); | 50 | m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); |
51 | |||
52 | if (!m_Initialized) | ||
53 | { | ||
54 | m_Initialized = true; | ||
55 | |||
56 | MainConsole.Instance.Commands.AddCommand( | ||
57 | "Users", false, | ||
58 | "show grid user", | ||
59 | "show grid user <ID>", | ||
60 | "Show grid user entry or entries that match or start with the given ID. This will normally be a UUID.", | ||
61 | "This is for debug purposes to see what data is found for a particular user id.", | ||
62 | HandleShowGridUser); | ||
63 | |||
64 | MainConsole.Instance.Commands.AddCommand( | ||
65 | "Users", false, | ||
66 | "show grid users online", | ||
67 | "show grid users online", | ||
68 | "Show number of grid users registered as online.", | ||
69 | "This number may not be accurate as a region may crash or not be cleanly shutdown and leave grid users shown as online\n." | ||
70 | + "For this reason, users online for more than 5 days are not currently counted", | ||
71 | HandleShowGridUsersOnline); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | protected void HandleShowGridUser(string module, string[] cmdparams) | ||
76 | { | ||
77 | if (cmdparams.Length != 4) | ||
78 | { | ||
79 | MainConsole.Instance.Output("Usage: show grid user <UUID>"); | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | GridUserData[] data = m_Database.GetAll(cmdparams[3]); | ||
84 | |||
85 | foreach (GridUserData gu in data) | ||
86 | { | ||
87 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | ||
88 | |||
89 | cdl.AddRow("User ID", gu.UserID); | ||
90 | |||
91 | foreach (KeyValuePair<string,string> kvp in gu.Data) | ||
92 | cdl.AddRow(kvp.Key, kvp.Value); | ||
93 | |||
94 | MainConsole.Instance.Output(cdl.ToString()); | ||
95 | } | ||
96 | |||
97 | MainConsole.Instance.OutputFormat("Entries: {0}", data.Length); | ||
98 | } | ||
99 | |||
100 | protected void HandleShowGridUsersOnline(string module, string[] cmdparams) | ||
101 | { | ||
102 | // if (cmdparams.Length != 4) | ||
103 | // { | ||
104 | // MainConsole.Instance.Output("Usage: show grid users online"); | ||
105 | // return; | ||
106 | // } | ||
107 | |||
108 | // int onlineCount; | ||
109 | int onlineRecentlyCount = 0; | ||
110 | |||
111 | DateTime now = DateTime.UtcNow; | ||
112 | |||
113 | foreach (GridUserData gu in m_Database.GetAll("")) | ||
114 | { | ||
115 | if (bool.Parse(gu.Data["Online"])) | ||
116 | { | ||
117 | // onlineCount++; | ||
118 | |||
119 | int unixLoginTime = int.Parse(gu.Data["Login"]); | ||
120 | |||
121 | if ((now - Util.ToDateTime(unixLoginTime)).Days < 5) | ||
122 | onlineRecentlyCount++; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount); | ||
127 | } | ||
128 | |||
129 | private GridUserData GetGridUserData(string userID) | ||
130 | { | ||
131 | GridUserData d = null; | ||
132 | if (userID.Length > 36) // it's a UUI | ||
133 | { | ||
134 | d = m_Database.Get(userID); | ||
135 | } | ||
136 | else // it's a UUID | ||
137 | { | ||
138 | GridUserData[] ds = m_Database.GetAll(userID); | ||
139 | if (ds == null) | ||
140 | return null; | ||
141 | |||
142 | if (ds.Length > 0) | ||
143 | { | ||
144 | d = ds[0]; | ||
145 | foreach (GridUserData dd in ds) | ||
146 | if (dd.UserID.Length > d.UserID.Length) // find the longest | ||
147 | d = dd; | ||
148 | } | ||
149 | } | ||
150 | |||
151 | return d; | ||
50 | } | 152 | } |
51 | 153 | ||
52 | public virtual GridUserInfo GetGridUserInfo(string userID) | 154 | public virtual GridUserInfo GetGridUserInfo(string userID) |
53 | { | 155 | { |
54 | GridUserData d = m_Database.Get(userID); | 156 | GridUserData d = GetGridUserData(userID); |
55 | 157 | ||
56 | if (d == null) | 158 | if (d == null) |
57 | return null; | 159 | return null; |
@@ -73,7 +175,7 @@ namespace OpenSim.Services.UserAccountService | |||
73 | return info; | 175 | return info; |
74 | } | 176 | } |
75 | 177 | ||
76 | public GridUserInfo[] GetGridUserInfo(string[] userIDs) | 178 | public virtual GridUserInfo[] GetGridUserInfo(string[] userIDs) |
77 | { | 179 | { |
78 | List<GridUserInfo> ret = new List<GridUserInfo>(); | 180 | List<GridUserInfo> ret = new List<GridUserInfo>(); |
79 | 181 | ||
@@ -86,7 +188,8 @@ namespace OpenSim.Services.UserAccountService | |||
86 | public GridUserInfo LoggedIn(string userID) | 188 | public GridUserInfo LoggedIn(string userID) |
87 | { | 189 | { |
88 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID); | 190 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID); |
89 | GridUserData d = m_Database.Get(userID); | 191 | |
192 | GridUserData d = GetGridUserData(userID); | ||
90 | 193 | ||
91 | if (d == null) | 194 | if (d == null) |
92 | { | 195 | { |
@@ -104,8 +207,9 @@ namespace OpenSim.Services.UserAccountService | |||
104 | 207 | ||
105 | public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) | 208 | public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) |
106 | { | 209 | { |
107 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); | 210 | m_log.InfoFormat("[GRID USER SERVICE]: User {0} is offline", userID); |
108 | GridUserData d = m_Database.Get(userID); | 211 | |
212 | GridUserData d = GetGridUserData(userID); | ||
109 | 213 | ||
110 | if (d == null) | 214 | if (d == null) |
111 | { | 215 | { |
@@ -124,7 +228,8 @@ namespace OpenSim.Services.UserAccountService | |||
124 | 228 | ||
125 | public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) | 229 | public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) |
126 | { | 230 | { |
127 | GridUserData d = m_Database.Get(userID); | 231 | GridUserData d = GetGridUserData(userID); |
232 | |||
128 | if (d == null) | 233 | if (d == null) |
129 | { | 234 | { |
130 | d = new GridUserData(); | 235 | d = new GridUserData(); |
@@ -140,8 +245,10 @@ namespace OpenSim.Services.UserAccountService | |||
140 | 245 | ||
141 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) | 246 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) |
142 | { | 247 | { |
143 | //m_log.DebugFormat("[Grid User Service]: SetLastPosition for {0}", userID); | 248 | // m_log.DebugFormat("[GRID USER SERVICE]: SetLastPosition for {0}", userID); |
144 | GridUserData d = m_Database.Get(userID); | 249 | |
250 | GridUserData d = GetGridUserData(userID); | ||
251 | |||
145 | if (d == null) | 252 | if (d == null) |
146 | { | 253 | { |
147 | d = new GridUserData(); | 254 | d = new GridUserData(); |
@@ -155,4 +262,4 @@ namespace OpenSim.Services.UserAccountService | |||
155 | return m_Database.Store(d); | 262 | return m_Database.Store(d); |
156 | } | 263 | } |
157 | } | 264 | } |
158 | } | 265 | } \ No newline at end of file |
diff --git a/OpenSim/Services/UserAccountService/GridUserServiceBase.cs b/OpenSim/Services/UserAccountService/GridUserServiceBase.cs index 990cb63..8c5f5df 100644 --- a/OpenSim/Services/UserAccountService/GridUserServiceBase.cs +++ b/OpenSim/Services/UserAccountService/GridUserServiceBase.cs | |||
@@ -60,12 +60,12 @@ namespace OpenSim.Services.UserAccountService | |||
60 | // | 60 | // |
61 | // [GridUsetService] section overrides [DatabaseService], if it exists | 61 | // [GridUsetService] section overrides [DatabaseService], if it exists |
62 | // | 62 | // |
63 | IConfig presenceConfig = config.Configs["GridUserService"]; | 63 | IConfig usersConfig = config.Configs["GridUserService"]; |
64 | if (presenceConfig != null) | 64 | if (usersConfig != null) |
65 | { | 65 | { |
66 | dllName = presenceConfig.GetString("StorageProvider", dllName); | 66 | dllName = usersConfig.GetString("StorageProvider", dllName); |
67 | connString = presenceConfig.GetString("ConnectionString", connString); | 67 | connString = usersConfig.GetString("ConnectionString", connString); |
68 | realm = presenceConfig.GetString("Realm", realm); | 68 | realm = usersConfig.GetString("Realm", realm); |
69 | } | 69 | } |
70 | 70 | ||
71 | // | 71 | // |
diff --git a/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs index 24e1d16..6ca07a6 100644 --- a/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs +++ b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.8.3.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 5b4d040..2e19ece 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -36,6 +36,7 @@ using OpenSim.Framework; | |||
36 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
37 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
38 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 38 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
39 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
39 | 40 | ||
40 | namespace OpenSim.Services.UserAccountService | 41 | namespace OpenSim.Services.UserAccountService |
41 | { | 42 | { |
@@ -97,7 +98,12 @@ namespace OpenSim.Services.UserAccountService | |||
97 | MainConsole.Instance.Commands.AddCommand("Users", false, | 98 | MainConsole.Instance.Commands.AddCommand("Users", false, |
98 | "reset user password", | 99 | "reset user password", |
99 | "reset user password [<first> [<last> [<password>]]]", | 100 | "reset user password [<first> [<last> [<password>]]]", |
100 | "Reset a user password", HandleResetUserPassword); | 101 | "Reset a user password", HandleResetUserPassword); |
102 | |||
103 | MainConsole.Instance.Commands.AddCommand("Users", false, | ||
104 | "reset user email", | ||
105 | "reset user email [<first> [<last> [<email>]]]", | ||
106 | "Reset a user email address", HandleResetUserEmail); | ||
101 | 107 | ||
102 | MainConsole.Instance.Commands.AddCommand("Users", false, | 108 | MainConsole.Instance.Commands.AddCommand("Users", false, |
103 | "set user level", | 109 | "set user level", |
@@ -255,6 +261,10 @@ namespace OpenSim.Services.UserAccountService | |||
255 | return MakeUserAccount(d[0]); | 261 | return MakeUserAccount(d[0]); |
256 | } | 262 | } |
257 | 263 | ||
264 | public void InvalidateCache(UUID userID) | ||
265 | { | ||
266 | } | ||
267 | |||
258 | public bool StoreUserAccount(UserAccount data) | 268 | public bool StoreUserAccount(UserAccount data) |
259 | { | 269 | { |
260 | // m_log.DebugFormat( | 270 | // m_log.DebugFormat( |
@@ -415,6 +425,43 @@ namespace OpenSim.Services.UserAccountService | |||
415 | MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); | 425 | MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); |
416 | } | 426 | } |
417 | 427 | ||
428 | protected void HandleResetUserEmail(string module, string[] cmdparams) | ||
429 | { | ||
430 | string firstName; | ||
431 | string lastName; | ||
432 | string newEmail; | ||
433 | |||
434 | if (cmdparams.Length < 4) | ||
435 | firstName = MainConsole.Instance.CmdPrompt("First name"); | ||
436 | else firstName = cmdparams[3]; | ||
437 | |||
438 | if (cmdparams.Length < 5) | ||
439 | lastName = MainConsole.Instance.CmdPrompt("Last name"); | ||
440 | else lastName = cmdparams[4]; | ||
441 | |||
442 | if (cmdparams.Length < 6) | ||
443 | newEmail = MainConsole.Instance.PasswdPrompt("New Email"); | ||
444 | else newEmail = cmdparams[5]; | ||
445 | |||
446 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); | ||
447 | if (account == null) | ||
448 | { | ||
449 | MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName); | ||
450 | return; | ||
451 | } | ||
452 | |||
453 | bool success = false; | ||
454 | |||
455 | account.Email = newEmail; | ||
456 | |||
457 | success = StoreUserAccount(account); | ||
458 | if (!success) | ||
459 | MainConsole.Instance.OutputFormat("Unable to set Email for account {0} {1}.", firstName, lastName); | ||
460 | else | ||
461 | MainConsole.Instance.OutputFormat("User Email set for user {0} {1} to {2}", firstName, lastName, account.Email); | ||
462 | } | ||
463 | |||
464 | |||
418 | protected void HandleSetUserLevel(string module, string[] cmdparams) | 465 | protected void HandleSetUserLevel(string module, string[] cmdparams) |
419 | { | 466 | { |
420 | string firstName; | 467 | string firstName; |
@@ -475,7 +522,6 @@ namespace OpenSim.Services.UserAccountService | |||
475 | { | 522 | { |
476 | account.ServiceURLs = new Dictionary<string, object>(); | 523 | account.ServiceURLs = new Dictionary<string, object>(); |
477 | account.ServiceURLs["HomeURI"] = string.Empty; | 524 | account.ServiceURLs["HomeURI"] = string.Empty; |
478 | account.ServiceURLs["GatekeeperURI"] = string.Empty; | ||
479 | account.ServiceURLs["InventoryServerURI"] = string.Empty; | 525 | account.ServiceURLs["InventoryServerURI"] = string.Empty; |
480 | account.ServiceURLs["AssetServerURI"] = string.Empty; | 526 | account.ServiceURLs["AssetServerURI"] = string.Empty; |
481 | } | 527 | } |
@@ -549,7 +595,7 @@ namespace OpenSim.Services.UserAccountService | |||
549 | { | 595 | { |
550 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); | 596 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); |
551 | 597 | ||
552 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Bodypart); | 598 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart); |
553 | 599 | ||
554 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); | 600 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); |
555 | eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); | 601 | eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); |
@@ -611,7 +657,7 @@ namespace OpenSim.Services.UserAccountService | |||
611 | hair.Flags = (uint)WearableType.Hair; | 657 | hair.Flags = (uint)WearableType.Hair; |
612 | m_InventoryService.AddItem(hair); | 658 | m_InventoryService.AddItem(hair); |
613 | 659 | ||
614 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Clothing); | 660 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing); |
615 | 661 | ||
616 | InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); | 662 | InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); |
617 | shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; | 663 | shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; |
@@ -665,4 +711,4 @@ namespace OpenSim.Services.UserAccountService | |||
665 | } | 711 | } |
666 | } | 712 | } |
667 | } | 713 | } |
668 | } \ No newline at end of file | 714 | } |