diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index ec6118b..4705445 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -98,7 +98,12 @@ namespace OpenSim.Services.UserAccountService | |||
98 | MainConsole.Instance.Commands.AddCommand("Users", false, | 98 | MainConsole.Instance.Commands.AddCommand("Users", false, |
99 | "reset user password", | 99 | "reset user password", |
100 | "reset user password [<first> [<last> [<password>]]]", | 100 | "reset user password [<first> [<last> [<password>]]]", |
101 | "Reset a user password", HandleResetUserPassword); | 101 | "Reset a user password", HandleResetUserPassword); |
102 | |||
103 | MainConsole.Instance.Commands.AddCommand("Users", false, | ||
104 | "reset user email", | ||
105 | "reset user email [<first> [<last> [<email>]]]", | ||
106 | "Reset a user email address", HandleResetUserEmail); | ||
102 | 107 | ||
103 | MainConsole.Instance.Commands.AddCommand("Users", false, | 108 | MainConsole.Instance.Commands.AddCommand("Users", false, |
104 | "set user level", | 109 | "set user level", |
@@ -420,6 +425,43 @@ namespace OpenSim.Services.UserAccountService | |||
420 | MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); | 425 | MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); |
421 | } | 426 | } |
422 | 427 | ||
428 | protected void HandleResetUserEmail(string module, string[] cmdparams) | ||
429 | { | ||
430 | string firstName; | ||
431 | string lastName; | ||
432 | string newEmail; | ||
433 | |||
434 | if (cmdparams.Length < 4) | ||
435 | firstName = MainConsole.Instance.CmdPrompt("First name"); | ||
436 | else firstName = cmdparams[3]; | ||
437 | |||
438 | if (cmdparams.Length < 5) | ||
439 | lastName = MainConsole.Instance.CmdPrompt("Last name"); | ||
440 | else lastName = cmdparams[4]; | ||
441 | |||
442 | if (cmdparams.Length < 6) | ||
443 | newEmail = MainConsole.Instance.PasswdPrompt("New Email"); | ||
444 | else newEmail = cmdparams[5]; | ||
445 | |||
446 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); | ||
447 | if (account == null) | ||
448 | { | ||
449 | MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName); | ||
450 | return; | ||
451 | } | ||
452 | |||
453 | bool success = false; | ||
454 | |||
455 | account.Email = newEmail; | ||
456 | |||
457 | success = StoreUserAccount(account); | ||
458 | if (!success) | ||
459 | MainConsole.Instance.OutputFormat("Unable to set Email for account {0} {1}.", firstName, lastName); | ||
460 | else | ||
461 | MainConsole.Instance.OutputFormat("User Email set for user {0} {1} to {2}", firstName, lastName, account.Email); | ||
462 | } | ||
463 | |||
464 | |||
423 | protected void HandleSetUserLevel(string module, string[] cmdparams) | 465 | protected void HandleSetUserLevel(string module, string[] cmdparams) |
424 | { | 466 | { |
425 | string firstName; | 467 | string firstName; |