mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
* Add "reset user password" command to standalone region console
* Grid user server implementation to follow shortly
This commit is contained in:
@@ -256,6 +256,18 @@ namespace OpenSim.Framework.Communications
|
||||
return userProf.ID;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset a user password
|
||||
/// </summary>
|
||||
/// <param name="firstName"></param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
/// <returns>true if the update was successful, false otherwise</returns>
|
||||
public bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
||||
{
|
||||
return m_userService.ResetUserPassword(firstName, lastName, newPassword);
|
||||
}
|
||||
|
||||
#region Friend Methods
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenSim.Framework.Communications
|
||||
UserProfileData SetupMasterUser(UUID userId);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Add a new user profile
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY);
|
||||
@@ -71,6 +71,15 @@ namespace OpenSim.Framework.Communications
|
||||
/// via a call to GetUserProfile().</param>
|
||||
/// <returns>true if the update could be applied, false if it could not be applied.</returns>
|
||||
bool UpdateUserProfile(UserProfileData data);
|
||||
|
||||
/// <summary>
|
||||
/// Reset a user password
|
||||
/// </summary>
|
||||
/// <param name="firstName"></param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
/// <returns>true if the update was successful, false otherwise</returns>
|
||||
bool ResetUserPassword(string firstName, string lastName, string newPassword);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new friend to the database for XUser
|
||||
|
||||
@@ -361,8 +361,6 @@ namespace OpenSim.Framework.Communications
|
||||
/// <param name="request">The users loginrequest</param>
|
||||
public void CreateAgent(UserProfileData profile, XmlRpcRequest request)
|
||||
{
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
|
||||
UserAgentData agent = new UserAgentData();
|
||||
|
||||
// User connection
|
||||
@@ -574,6 +572,33 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
return user.ID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset a user password
|
||||
/// </summary>
|
||||
/// <param name="firstName"></param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
/// <returns>true if the update was successful, false otherwise</returns>
|
||||
public bool ResetUserPassword(string firstName, string lastName, string newPassword)
|
||||
{
|
||||
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(newPassword) + ":" + String.Empty);
|
||||
|
||||
UserProfileData profile = GetUserProfile(firstName, lastName);
|
||||
|
||||
if (null == profile)
|
||||
{
|
||||
m_log.ErrorFormat("[USERSTORAGE]: Could not find user {0} {1}", firstName, lastName);
|
||||
return false;
|
||||
}
|
||||
|
||||
profile.PasswordHash = md5PasswdHash;
|
||||
profile.PasswordSalt = String.Empty;
|
||||
|
||||
UpdateUserProfile(profile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool UpdateUserProfileProperties(UserProfileData UserProfile)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user