From 2e2f73bdd5034febfa67c230257289f75946d8ce Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 May 2010 20:12:06 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Services/PresenceService/PresenceService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 19f636a..601a69f 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -54,7 +54,8 @@ namespace OpenSim.Services.PresenceService public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) { - PresenceData[] d = m_Database.Get("UserID", userID); + //PresenceData[] d = m_Database.Get("UserID", userID); + m_Database.Get("UserID", userID); PresenceData data = new PresenceData(); -- cgit v1.1 From 505cb82dee27fc1b681fd7c4b6f904ef18315995 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 May 2010 21:14:15 +0100 Subject: fission UserAccountService.HandleCreateUser() into two methods, one which handles user command parsing and another which actually does the work --- .../Services/UserAccountService/UserAccountService.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 6923293..3f1744d 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -277,8 +277,9 @@ namespace OpenSim.Services.UserAccountService #endregion #region Console commands + /// - /// Create a new user + /// Handle the create user command from the console. /// /// string array with parameters: firstname, lastname, password, locationX, locationY, email protected void HandleCreateUser(string module, string[] cmdparams) @@ -304,6 +305,18 @@ namespace OpenSim.Services.UserAccountService email = MainConsole.Instance.CmdPrompt("Email", ""); else email = cmdparams[5]; + CreateUser(firstName, lastName, password, email); + } + + /// + /// Create a user + /// + /// + /// + /// + /// + public void CreateUser(string firstName, string lastName, string password, string email) + { UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); if (null == account) { @@ -338,7 +351,6 @@ namespace OpenSim.Services.UserAccountService else m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.", firstName, lastName); - } else m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.", @@ -350,7 +362,6 @@ namespace OpenSim.Services.UserAccountService m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", firstName, lastName); - m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName); } } @@ -358,7 +369,6 @@ namespace OpenSim.Services.UserAccountService { m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); } - } protected void HandleResetUserPassword(string module, string[] cmdparams) -- cgit v1.1 From 0ef41e62bc1721dc0f6807979d24c609a9d3df6e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 May 2010 21:18:55 +0100 Subject: minor: move a method so that the #regions make more sense --- .../UserAccountService/UserAccountService.cs | 71 +++++++++++----------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 3f1744d..eb588f0 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -308,6 +308,40 @@ namespace OpenSim.Services.UserAccountService CreateUser(firstName, lastName, password, email); } + protected void HandleResetUserPassword(string module, string[] cmdparams) + { + string firstName; + string lastName; + string newPassword; + + if (cmdparams.Length < 4) + firstName = MainConsole.Instance.CmdPrompt("First name"); + else firstName = cmdparams[3]; + + if (cmdparams.Length < 5) + lastName = MainConsole.Instance.CmdPrompt("Last name"); + else lastName = cmdparams[4]; + + if (cmdparams.Length < 6) + newPassword = MainConsole.Instance.PasswdPrompt("New password"); + else newPassword = cmdparams[5]; + + UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); + if (account == null) + m_log.ErrorFormat("[USER ACCOUNT SERVICE]: No such user"); + + bool success = false; + if (m_AuthenticationService != null) + success = m_AuthenticationService.SetPassword(account.PrincipalID, newPassword); + if (!success) + m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Unable to reset password for account {0} {1}.", + firstName, lastName); + else + m_log.InfoFormat("[USER ACCOUNT SERVICE]: Password reset for user {0} {1}", firstName, lastName); + } + + #endregion + /// /// Create a user /// @@ -369,41 +403,6 @@ namespace OpenSim.Services.UserAccountService { m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); } - } - - protected void HandleResetUserPassword(string module, string[] cmdparams) - { - string firstName; - string lastName; - string newPassword; - - if (cmdparams.Length < 4) - firstName = MainConsole.Instance.CmdPrompt("First name"); - else firstName = cmdparams[3]; - - if (cmdparams.Length < 5) - lastName = MainConsole.Instance.CmdPrompt("Last name"); - else lastName = cmdparams[4]; - - if (cmdparams.Length < 6) - newPassword = MainConsole.Instance.PasswdPrompt("New password"); - else newPassword = cmdparams[5]; - - UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); - if (account == null) - m_log.ErrorFormat("[USER ACCOUNT SERVICE]: No such user"); - - bool success = false; - if (m_AuthenticationService != null) - success = m_AuthenticationService.SetPassword(account.PrincipalID, newPassword); - if (!success) - m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Unable to reset password for account {0} {1}.", - firstName, lastName); - else - m_log.InfoFormat("[USER ACCOUNT SERVICE]: Password reset for user {0} {1}", firstName, lastName); - } - - #endregion - + } } } -- cgit v1.1