From 5daac0584aed1a6764060b6c6a0a1f74360859f1 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 25 Jun 2011 00:08:14 +0100 Subject: [PATCH] Fix bug in reset user password where entering an invalid name would cause an exception. Also, convert this commands log output to console output. Console output is more appropriate for console commands. The log only gets one side of the conversation anyway (since it doesn't necessarily record command inputs). --- .../Services/UserAccountService/UserAccountService.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index a65c04b3fd..8b8a8f9fe8 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -383,16 +383,19 @@ namespace OpenSim.Services.UserAccountService UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); if (account == null) - m_log.ErrorFormat("[USER ACCOUNT SERVICE]: No such user"); + { + MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName); + return; + } 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); + MainConsole.Instance.OutputFormat("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); + MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); } protected void HandleSetUserLevel(string module, string[] cmdparams)