From c2ee26399947be5e3c23ac3abc53f2ba907ff10f Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 15 Sep 2008 18:23:36 +0000
Subject: * refactor: Break out IUserServiceAdmin out of IUserService since
admin methods don't need to be implemented on Grid hosted region servers
---
.../Framework/Communications/CommunicationsManager.cs | 9 +++++++--
OpenSim/Framework/Communications/IUserService.cs | 17 -----------------
OpenSim/Framework/Communications/UserManagerBase.cs | 2 +-
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
.../Region/Communications/Local/CommunicationsLocal.cs | 2 ++
5 files changed, 11 insertions(+), 21 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 1ac5fe4..27cdd35 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -98,6 +98,11 @@ namespace OpenSim.Framework.Communications
get { return m_networkServersInfo; }
}
protected NetworkServersInfo m_networkServersInfo;
+
+ ///
+ /// Interface to administrative user service calls.
+ ///
+ protected IUserServiceAdmin m_userServiceAdmin;
///
/// 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
/// true if the update was successful, false otherwise
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
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index d52d1ea..64c6c68 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -40,8 +40,6 @@ namespace OpenSim.Framework.Communications
/// A user profile. Returns null if no profile is found
UserProfileData GetUserProfile(string firstName, string lastName);
- //UserProfileData GetUserProfile(string name);
-
///
/// Loads a user profile from a database by UUID
///
@@ -59,27 +57,12 @@ namespace OpenSim.Framework.Communications
UserProfileData SetupMasterUser(UUID userId);
///
- /// Add a new user profile
- ///
- ///
- UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY);
-
- ///
/// Update the user's profile.
///
/// UserProfileData object with updated data. Should be obtained
/// via a call to GetUserProfile().
/// true if the update could be applied, false if it could not be applied.
bool UpdateUserProfile(UserProfileData data);
-
- ///
- /// Reset a user password
- ///
- ///
- ///
- ///
- /// true if the update was successful, false otherwise
- bool ResetUserPassword(string firstName, string lastName, string newPassword);
///
/// Adds a new friend to the database for XUser
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 4fc2fea..f06a438 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications
///
/// Base class for user management (create, read, etc)
///
- public abstract class UserManagerBase : IUserService, IAvatarService
+ public abstract class UserManagerBase : IUserService, IUserServiceAdmin, IAvatarService
{
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 1029d90..4a02264 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -383,7 +383,7 @@ namespace OpenSim
LocalBackEndServices backendService = new LocalBackEndServices();
CommunicationsLocal localComms =
- new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService,
+ new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, userService,
inventoryService, backendService, backendService, m_dumpAssetsToFile);
m_commsManager = localComms;
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 6793889..c79979c 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -39,6 +39,7 @@ namespace OpenSim.Region.Communications.Local
BaseHttpServer httpServer,
AssetCache assetCache,
IUserService userService,
+ IUserServiceAdmin userServiceAdmin,
LocalInventoryService inventoryService,
IInterRegionCommunications interRegionService,
IGridServices gridService, bool dumpAssetsToFile)
@@ -48,6 +49,7 @@ namespace OpenSim.Region.Communications.Local
m_defaultInventoryHost = inventoryService.Host;
m_interServiceInventoryService = inventoryService;
m_userService = userService;
+ m_userServiceAdmin = userServiceAdmin;
m_avatarService = (IAvatarService)userService;
m_gridService = gridService;
m_interRegion = interRegionService;
--
cgit v1.1