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).
bulletsim
Justin Clark-Casey (justincc) 2011-06-25 00:08:14 +01:00
parent 296774495b
commit 5daac0584a
1 changed files with 7 additions and 4 deletions

View File

@ -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)