diff options
author | Justin Clarke Casey | 2008-09-15 17:29:11 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-15 17:29:11 +0000 |
commit | 6d289c3ae00b8d0f745d3345e8148b8d39b5206f (patch) | |
tree | 0a2f99813573fa61936202a2949532ac1f1685a1 /OpenSim/Framework | |
parent | Add the option to use Allow_osFunction = false for each OS function (diff) | |
download | opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.zip opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.gz opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.bz2 opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.xz |
* Add "reset user password" command to standalone region console
* Grid user server implementation to follow shortly
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/CommunicationsManager.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/IUserService.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 29 |
3 files changed, 49 insertions, 3 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 969bdd8..1ac5fe4 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -256,6 +256,18 @@ namespace OpenSim.Framework.Communications | |||
256 | return userProf.ID; | 256 | return userProf.ID; |
257 | } | 257 | } |
258 | } | 258 | } |
259 | |||
260 | /// <summary> | ||
261 | /// Reset a user password | ||
262 | /// </summary> | ||
263 | /// <param name="firstName"></param> | ||
264 | /// <param name="lastName"></param> | ||
265 | /// <param name="newPassword"></param> | ||
266 | /// <returns>true if the update was successful, false otherwise</returns> | ||
267 | public bool ResetUserPassword(string firstName, string lastName, string newPassword) | ||
268 | { | ||
269 | return m_userService.ResetUserPassword(firstName, lastName, newPassword); | ||
270 | } | ||
259 | 271 | ||
260 | #region Friend Methods | 272 | #region Friend Methods |
261 | 273 | ||
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 7e3c77b..d52d1ea 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Framework.Communications | |||
59 | UserProfileData SetupMasterUser(UUID userId); | 59 | UserProfileData SetupMasterUser(UUID userId); |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// | 62 | /// Add a new user profile |
63 | /// </summary> | 63 | /// </summary> |
64 | /// <param name="user"></param> | 64 | /// <param name="user"></param> |
65 | UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); | 65 | UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); |
@@ -71,6 +71,15 @@ namespace OpenSim.Framework.Communications | |||
71 | /// via a call to GetUserProfile().</param> | 71 | /// via a call to GetUserProfile().</param> |
72 | /// <returns>true if the update could be applied, false if it could not be applied.</returns> | 72 | /// <returns>true if the update could be applied, false if it could not be applied.</returns> |
73 | bool UpdateUserProfile(UserProfileData data); | 73 | bool UpdateUserProfile(UserProfileData data); |
74 | |||
75 | /// <summary> | ||
76 | /// Reset a user password | ||
77 | /// </summary> | ||
78 | /// <param name="firstName"></param> | ||
79 | /// <param name="lastName"></param> | ||
80 | /// <param name="newPassword"></param> | ||
81 | /// <returns>true if the update was successful, false otherwise</returns> | ||
82 | bool ResetUserPassword(string firstName, string lastName, string newPassword); | ||
74 | 83 | ||
75 | /// <summary> | 84 | /// <summary> |
76 | /// Adds a new friend to the database for XUser | 85 | /// Adds a new friend to the database for XUser |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 75c4dc1..4fc2fea 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -361,8 +361,6 @@ namespace OpenSim.Framework.Communications | |||
361 | /// <param name="request">The users loginrequest</param> | 361 | /// <param name="request">The users loginrequest</param> |
362 | public void CreateAgent(UserProfileData profile, XmlRpcRequest request) | 362 | public void CreateAgent(UserProfileData profile, XmlRpcRequest request) |
363 | { | 363 | { |
364 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
365 | |||
366 | UserAgentData agent = new UserAgentData(); | 364 | UserAgentData agent = new UserAgentData(); |
367 | 365 | ||
368 | // User connection | 366 | // User connection |
@@ -574,6 +572,33 @@ namespace OpenSim.Framework.Communications | |||
574 | 572 | ||
575 | return user.ID; | 573 | return user.ID; |
576 | } | 574 | } |
575 | |||
576 | /// <summary> | ||
577 | /// Reset a user password | ||
578 | /// </summary> | ||
579 | /// <param name="firstName"></param> | ||
580 | /// <param name="lastName"></param> | ||
581 | /// <param name="newPassword"></param> | ||
582 | /// <returns>true if the update was successful, false otherwise</returns> | ||
583 | public bool ResetUserPassword(string firstName, string lastName, string newPassword) | ||
584 | { | ||
585 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty); | ||
586 | |||
587 | UserProfileData profile = GetUserProfile(firstName, lastName); | ||
588 | |||
589 | if (null == profile) | ||
590 | { | ||
591 | m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName); | ||
592 | return false; | ||
593 | } | ||
594 | |||
595 | profile.PasswordHash = md5PasswdHash; | ||
596 | profile.PasswordSalt = String.Empty; | ||
597 | |||
598 | UpdateUserProfile(profile); | ||
599 | |||
600 | return true; | ||
601 | } | ||
577 | 602 | ||
578 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) | 603 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) |
579 | { | 604 | { |