diff options
author | Justin Clarke Casey | 2008-09-15 17:29:11 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-15 17:29:11 +0000 |
commit | 6d289c3ae00b8d0f745d3345e8148b8d39b5206f (patch) | |
tree | 0a2f99813573fa61936202a2949532ac1f1685a1 /OpenSim/Region/Application/OpenSim.cs | |
parent | Add the option to use Allow_osFunction = false for each OS function (diff) | |
download | opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.zip opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.gz opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.bz2 opensim-SC-6d289c3ae00b8d0f745d3345e8148b8d39b5206f.tar.xz |
* Add "reset user password" command to standalone region console
* Grid user server implementation to follow shortly
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4cf34bc..12ef129 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -283,6 +283,7 @@ namespace OpenSim | |||
283 | { | 283 | { |
284 | m_console.Notice(""); | 284 | m_console.Notice(""); |
285 | m_console.Notice("create user - adds a new user."); | 285 | m_console.Notice("create user - adds a new user."); |
286 | m_console.Notice("reset user password - reset a user's password."); | ||
286 | } | 287 | } |
287 | 288 | ||
288 | break; | 289 | break; |
@@ -493,6 +494,10 @@ namespace OpenSim | |||
493 | m_commsManager.AddInventoryService(cmdparams[0]); | 494 | m_commsManager.AddInventoryService(cmdparams[0]); |
494 | } | 495 | } |
495 | break; | 496 | break; |
497 | |||
498 | case "reset": | ||
499 | Reset(cmdparams); | ||
500 | break; | ||
496 | 501 | ||
497 | default: | 502 | default: |
498 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; | 503 | string[] tmpPluginArgs = new string[cmdparams.Length + 1]; |
@@ -543,6 +548,30 @@ namespace OpenSim | |||
543 | break; | 548 | break; |
544 | } | 549 | } |
545 | } | 550 | } |
551 | |||
552 | /// <summary> | ||
553 | /// Execute switch for some of the reset commands | ||
554 | /// </summary> | ||
555 | /// <param name="args"></param> | ||
556 | protected void Reset(string[] args) | ||
557 | { | ||
558 | if (args.Length == 0) | ||
559 | return; | ||
560 | |||
561 | switch (args[0]) | ||
562 | { | ||
563 | case "user": | ||
564 | |||
565 | switch (args[1]) | ||
566 | { | ||
567 | case "password": | ||
568 | ResetUserPassword(args); | ||
569 | break; | ||
570 | } | ||
571 | |||
572 | break; | ||
573 | } | ||
574 | } | ||
546 | 575 | ||
547 | /// <summary> | 576 | /// <summary> |
548 | /// Turn on some debugging values for OpenSim. | 577 | /// Turn on some debugging values for OpenSim. |
@@ -650,6 +679,7 @@ namespace OpenSim | |||
650 | { | 679 | { |
651 | m_console.Notice(""); | 680 | m_console.Notice(""); |
652 | m_console.Notice("create user - adds a new user."); | 681 | m_console.Notice("create user - adds a new user."); |
682 | m_console.Notice("reset user password - reset a user's password."); | ||
653 | } | 683 | } |
654 | } | 684 | } |
655 | 685 | ||
@@ -769,6 +799,31 @@ namespace OpenSim | |||
769 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); | 799 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); |
770 | } | 800 | } |
771 | } | 801 | } |
802 | |||
803 | /// <summary> | ||
804 | /// Reset a user password. | ||
805 | /// </summary> | ||
806 | /// <param name="cmdparams"></param> | ||
807 | private void ResetUserPassword(string[] cmdparams) | ||
808 | { | ||
809 | string firstName; | ||
810 | string lastName; | ||
811 | string newPassword; | ||
812 | |||
813 | if (cmdparams.Length < 3) | ||
814 | firstName = MainConsole.Instance.CmdPrompt("First name"); | ||
815 | else firstName = cmdparams[2]; | ||
816 | |||
817 | if ( cmdparams.Length < 4 ) | ||
818 | lastName = MainConsole.Instance.CmdPrompt("Last name"); | ||
819 | else lastName = cmdparams[3]; | ||
820 | |||
821 | if ( cmdparams.Length < 5 ) | ||
822 | newPassword = MainConsole.Instance.PasswdPrompt("New password"); | ||
823 | else newPassword = cmdparams[4]; | ||
824 | |||
825 | m_commsManager.ResetUserPassword(firstName, lastName, newPassword); | ||
826 | } | ||
772 | 827 | ||
773 | protected void SaveXml(string[] cmdparams) | 828 | protected void SaveXml(string[] cmdparams) |
774 | { | 829 | { |