diff options
author | Justin Clark-Casey (justincc) | 2011-06-24 23:54:37 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-24 23:54:37 +0100 |
commit | 56dcc5109486e6ef721f065135b8c87c3501d8e2 (patch) | |
tree | 07522118cb185e2d1a3124c06a798fbe12bccb22 /OpenSim/Services | |
parent | Changed actual default values of 'ServiceConnectorModule' and 'MessagingModul... (diff) | |
download | opensim-SC-56dcc5109486e6ef721f065135b8c87c3501d8e2.zip opensim-SC-56dcc5109486e6ef721f065135b8c87c3501d8e2.tar.gz opensim-SC-56dcc5109486e6ef721f065135b8c87c3501d8e2.tar.bz2 opensim-SC-56dcc5109486e6ef721f065135b8c87c3501d8e2.tar.xz |
Add a command "show account <first-name> <last-Name>" to the user account service that will show the given user details
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index f376cf8..3525912 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -83,9 +83,16 @@ namespace OpenSim.Services.UserAccountService | |||
83 | "create user", | 83 | "create user", |
84 | "create user [<first> [<last> [<pass> [<email>]]]]", | 84 | "create user [<first> [<last> [<pass> [<email>]]]]", |
85 | "Create a new user", HandleCreateUser); | 85 | "Create a new user", HandleCreateUser); |
86 | MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password", | 86 | |
87 | MainConsole.Instance.Commands.AddCommand("UserService", false, | ||
88 | "reset user password", | ||
87 | "reset user password [<first> [<last> [<password>]]]", | 89 | "reset user password [<first> [<last> [<password>]]]", |
88 | "Reset a user password", HandleResetUserPassword); | 90 | "Reset a user password", HandleResetUserPassword); |
91 | |||
92 | MainConsole.Instance.Commands.AddCommand("UserService", false, | ||
93 | "show account", | ||
94 | "show account <first> <last>", | ||
95 | "Show account details for the given user", HandleShowAccount); | ||
89 | } | 96 | } |
90 | 97 | ||
91 | } | 98 | } |
@@ -318,6 +325,36 @@ namespace OpenSim.Services.UserAccountService | |||
318 | CreateUser(firstName, lastName, password, email); | 325 | CreateUser(firstName, lastName, password, email); |
319 | } | 326 | } |
320 | 327 | ||
328 | protected void HandleShowAccount(string module, string[] cmdparams) | ||
329 | { | ||
330 | if (cmdparams.Length != 4) | ||
331 | { | ||
332 | MainConsole.Instance.Output("Usage: show account <first-name> <last-name>"); | ||
333 | return; | ||
334 | } | ||
335 | |||
336 | string firstName = cmdparams[2]; | ||
337 | string lastName = cmdparams[3]; | ||
338 | |||
339 | UserAccount ua = GetUserAccount(UUID.Zero, firstName, lastName); | ||
340 | |||
341 | if (ua == null) | ||
342 | { | ||
343 | MainConsole.Instance.OutputFormat("No user named {0} {1}", firstName, lastName); | ||
344 | return; | ||
345 | } | ||
346 | |||
347 | MainConsole.Instance.OutputFormat("Name: {0}", ua.Name); | ||
348 | MainConsole.Instance.OutputFormat("ID: {0}", ua.PrincipalID); | ||
349 | MainConsole.Instance.OutputFormat("Title: {0}", ua.UserTitle); | ||
350 | MainConsole.Instance.OutputFormat("E-mail: {0}", ua.Email); | ||
351 | MainConsole.Instance.OutputFormat("Created: {0}", Utils.UnixTimeToDateTime(ua.Created)); | ||
352 | MainConsole.Instance.OutputFormat("Level: {0}", ua.UserLevel); | ||
353 | MainConsole.Instance.OutputFormat("Flags: {0}", ua.UserFlags); | ||
354 | foreach (KeyValuePair<string, Object> kvp in ua.ServiceURLs) | ||
355 | MainConsole.Instance.OutputFormat("{0}: {1}", kvp.Key, kvp.Value); | ||
356 | } | ||
357 | |||
321 | protected void HandleResetUserPassword(string module, string[] cmdparams) | 358 | protected void HandleResetUserPassword(string module, string[] cmdparams) |
322 | { | 359 | { |
323 | string firstName; | 360 | string firstName; |