* refactor: Break out IUserServiceAdmin out of IUserService since admin methods don't need to be implemented on Grid hosted region servers

This commit is contained in:
Justin Clarke Casey
2008-09-15 18:23:36 +00:00
parent 9170361bee
commit c2ee263999
5 changed files with 11 additions and 21 deletions

View File

@@ -98,6 +98,11 @@ namespace OpenSim.Framework.Communications
get { return m_networkServersInfo; }
}
protected NetworkServersInfo m_networkServersInfo;
/// <summary>
/// Interface to administrative user service calls.
/// </summary>
protected IUserServiceAdmin m_userServiceAdmin;
/// <summary>
/// Constructor
@@ -243,7 +248,7 @@ namespace OpenSim.Framework.Communications
{
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
m_userService.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY);
m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY);
UserProfileData userProf = UserService.GetUserProfile(firstName, lastName);
if (userProf == null)
{
@@ -266,7 +271,7 @@ namespace OpenSim.Framework.Communications
/// <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);
return m_userServiceAdmin.ResetUserPassword(firstName, lastName, newPassword);
}
#region Friend Methods

View File

@@ -40,8 +40,6 @@ namespace OpenSim.Framework.Communications
/// <returns>A user profile. Returns null if no profile is found</returns>
UserProfileData GetUserProfile(string firstName, string lastName);
//UserProfileData GetUserProfile(string name);
/// <summary>
/// Loads a user profile from a database by UUID
/// </summary>
@@ -58,12 +56,6 @@ namespace OpenSim.Framework.Communications
UserProfileData SetupMasterUser(string firstName, string lastName, string password);
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);
/// <summary>
/// Update the user's profile.
/// </summary>
@@ -71,15 +63,6 @@ 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

View File

@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications
/// <summary>
/// Base class for user management (create, read, etc)
/// </summary>
public abstract class UserManagerBase : IUserService, IAvatarService
public abstract class UserManagerBase : IUserService, IUserServiceAdmin, IAvatarService
{
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);