diff options
author | Justin Clark-Casey (justincc) | 2013-05-21 18:00:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-05-21 18:00:41 +0100 |
commit | 6edecd5d94949873411b0625928b4f0ad0e01f9a (patch) | |
tree | 68ec94aa65666ce3575e680ec204c77b3f9ba8de /OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |
parent | Log when "Unknown User" is sent to a user because the UMM had no binding for ... (diff) | |
download | opensim-SC_OLD-6edecd5d94949873411b0625928b4f0ad0e01f9a.zip opensim-SC_OLD-6edecd5d94949873411b0625928b4f0ad0e01f9a.tar.gz opensim-SC_OLD-6edecd5d94949873411b0625928b4f0ad0e01f9a.tar.bz2 opensim-SC_OLD-6edecd5d94949873411b0625928b4f0ad0e01f9a.tar.xz |
Add "show name" console command to make it possible to show a single binding of a UUID to a name.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 06f1712..48ec12f 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -568,6 +568,13 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
568 | protected void RegisterConsoleCmds() | 568 | protected void RegisterConsoleCmds() |
569 | { | 569 | { |
570 | MainConsole.Instance.Commands.AddCommand("Users", true, | 570 | MainConsole.Instance.Commands.AddCommand("Users", true, |
571 | "show name", | ||
572 | "show name <uuid>", | ||
573 | "Show the bindings between a single user UUID and a user name", | ||
574 | String.Empty, | ||
575 | HandleShowUser); | ||
576 | |||
577 | MainConsole.Instance.Commands.AddCommand("Users", true, | ||
571 | "show names", | 578 | "show names", |
572 | "show names", | 579 | "show names", |
573 | "Show the bindings between user UUIDs and user names", | 580 | "Show the bindings between user UUIDs and user names", |
@@ -575,6 +582,33 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
575 | HandleShowUsers); | 582 | HandleShowUsers); |
576 | } | 583 | } |
577 | 584 | ||
585 | private void HandleShowUser(string module, string[] cmd) | ||
586 | { | ||
587 | if (cmd.Length < 3) | ||
588 | { | ||
589 | MainConsole.Instance.OutputFormat("Usage: show name <uuid>"); | ||
590 | return; | ||
591 | } | ||
592 | |||
593 | UUID userId; | ||
594 | if (!ConsoleUtil.TryParseConsoleUuid(MainConsole.Instance, cmd[2], out userId)) | ||
595 | return; | ||
596 | |||
597 | string[] names; | ||
598 | if (!TryGetUserNames(userId, out names)) | ||
599 | { | ||
600 | MainConsole.Instance.OutputFormat("No name known for user with id {0}", userId); | ||
601 | return; | ||
602 | } | ||
603 | |||
604 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
605 | cdt.AddColumn("UUID", 36); | ||
606 | cdt.AddColumn("Name", 60); | ||
607 | cdt.AddRow(userId, string.Join(" ", names)); | ||
608 | |||
609 | MainConsole.Instance.Output(cdt.ToString()); | ||
610 | } | ||
611 | |||
578 | private void HandleShowUsers(string module, string[] cmd) | 612 | private void HandleShowUsers(string module, string[] cmd) |
579 | { | 613 | { |
580 | lock (m_UserCache) | 614 | lock (m_UserCache) |