From 02fd7751d9b89d838fc8ca2dc60fe11f4cfe93a8 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 23 Nov 2008 03:38:40 +0000 Subject: Mantis#2660. Thank you kindly, Ruud Lathrop for a patch that: This patch adds the option of adding the email when you create a new user. This works in Gridmode as none Gridmode. This option is also added to RemoteAdminPlugin. With a new handler you can create a user with a email. --- .../Communications/CommunicationsManager.cs | 20 ++++++++++++--- OpenSim/Framework/Communications/IUserService.cs | 17 +++++++------ .../Framework/Communications/IUserServiceAdmin.cs | 26 +++++++++++++++---- .../Framework/Communications/UserManagerBase.cs | 29 ++++++++++++++++++---- 4 files changed, 70 insertions(+), 22 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index bb4a853..3f46776 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -255,14 +255,15 @@ namespace OpenSim.Framework.Communications /// /// /// + /// /// /// /// The UUID of the added user. Returns UUID.Zero if the add was unsuccessful - public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY) + public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); + m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY); UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); if (userProf == null) { @@ -276,11 +277,22 @@ namespace OpenSim.Framework.Communications } } - public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY, UUID SetUUID) + /// + /// Adds the user. + /// + /// The first name. + /// The last name. + /// The password. + /// The email. + /// The reg X. + /// The reg Y. + /// The set UUID. + /// + public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY, SetUUID); + m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY, SetUUID); UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); if (userProf == null) { diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 50c9917..178b5a0 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -35,15 +35,15 @@ namespace OpenSim.Framework.Communications /// /// Loads a user profile by name /// - /// First name - /// Last name + /// First name + /// Last name /// A user profile. Returns null if no profile is found UserProfileData GetUserProfile(string firstName, string lastName); /// /// Loads a user profile from a database by UUID /// - /// The target UUID + /// The target UUID /// A user profile. Returns null if no user profile is found. UserProfileData GetUserProfile(UUID userId); @@ -90,8 +90,8 @@ namespace OpenSim.Framework.Communications /// /// Logs off a user on the user server /// - /// UUID of the user - /// UUID of the Region + /// UUID of the user + /// UUID of the Region /// regionhandle /// final position /// final lookat @@ -100,8 +100,8 @@ namespace OpenSim.Framework.Communications /// /// Logs off a user on the user server (deprecated as of 2008-08-27) /// - /// UUID of the user - /// UUID of the Region + /// UUID of the user + /// UUID of the Region /// regionhandle /// final position x /// final position y @@ -118,7 +118,8 @@ namespace OpenSim.Framework.Communications /// Updates the current region the User is in /// /// User Region the Avatar is IN - /// User Region the Avatar is IN + /// User Region the Avatar is IN + /// User region handle void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle); /// diff --git a/OpenSim/Framework/Communications/IUserServiceAdmin.cs b/OpenSim/Framework/Communications/IUserServiceAdmin.cs index 169385f..a120add 100644 --- a/OpenSim/Framework/Communications/IUserServiceAdmin.cs +++ b/OpenSim/Framework/Communications/IUserServiceAdmin.cs @@ -30,15 +30,31 @@ using OpenMetaverse; namespace OpenSim.Framework.Communications { public interface IUserServiceAdmin - { + { /// /// Add a new user profile /// - /// - UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); + /// The first name. + /// The last name. + /// password of avatar + /// email of user + /// region X. + /// region Y. + /// + UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY); - // Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances! - UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID setUUID); + /// + /// Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances! + /// + /// The first name. + /// The last name. + /// password of avatar + /// email of user + /// region X. + /// region Y. + /// The set UUID. + /// + UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID setUUID); /// /// Reset a user password diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 4b5d2bb..bc1a593 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -54,6 +54,7 @@ namespace OpenSim.Framework.Communications /// Adds a new user server plugin - user servers will be requested in the order they were loaded. /// /// The filename to the user server plugin DLL + /// public void AddPlugin(string provider, string connect) { PluginLoader loader = @@ -580,15 +581,32 @@ namespace OpenSim.Framework.Communications #endregion /// - /// + /// Add a new user profile /// - /// - public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) + /// first name. + /// last name. + /// password + /// email. + /// location X. + /// location Y. + /// + public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY) { - return AddUserProfile(firstName, lastName, pass, regX, regY, UUID.Random()); + return AddUserProfile(firstName, lastName, pass, email, regX, regY, UUID.Random()); } - public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID SetUUID) + /// + /// Adds the user profile. + /// + /// first name. + /// last name. + /// password + /// email. + /// location X. + /// location Y. + /// UUID of avatar. + /// + public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID SetUUID) { UserProfileData user = new UserProfileData(); user.HomeLocation = new Vector3(128, 128, 100); @@ -601,6 +619,7 @@ namespace OpenSim.Framework.Communications user.HomeLookAt = new Vector3(100, 100, 100); user.HomeRegionX = regX; user.HomeRegionY = regY; + user.Email = email; foreach (IUserDataPlugin plugin in _plugins) { -- cgit v1.1