aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService
diff options
context:
space:
mode:
authorMelanie2011-10-12 01:30:14 +0100
committerMelanie2011-10-12 01:30:14 +0100
commit6af388ded9958b889700d8c3fc1d9f266cdf8759 (patch)
tree18289983c7f20e63e2ae8894b00324888515e202 /OpenSim/Services/UserAccountService
parentMerge commit '413e299045112d4a1553929eb042e87587cb3d2e' into bigmerge (diff)
parentWhen creating a new user on the comand line, give the option of allowing a UU... (diff)
downloadopensim-SC_OLD-6af388ded9958b889700d8c3fc1d9f266cdf8759.zip
opensim-SC_OLD-6af388ded9958b889700d8c3fc1d9f266cdf8759.tar.gz
opensim-SC_OLD-6af388ded9958b889700d8c3fc1d9f266cdf8759.tar.bz2
opensim-SC_OLD-6af388ded9958b889700d8c3fc1d9f266cdf8759.tar.xz
Merge commit 'b907a66f394b279d3ca2b1ac620bc7bb13cc6dd2' into bigmerge
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 4c6122d..59098f0 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Services.UserAccountService
93 { 93 {
94 MainConsole.Instance.Commands.AddCommand("UserService", false, 94 MainConsole.Instance.Commands.AddCommand("UserService", false,
95 "create user", 95 "create user",
96 "create user [<first> [<last> [<pass> [<email>]]]]", 96 "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]",
97 "Create a new user", HandleCreateUser); 97 "Create a new user", HandleCreateUser);
98 98
99 MainConsole.Instance.Commands.AddCommand("UserService", false, 99 MainConsole.Instance.Commands.AddCommand("UserService", false,
@@ -340,6 +340,7 @@ namespace OpenSim.Services.UserAccountService
340 string lastName; 340 string lastName;
341 string password; 341 string password;
342 string email; 342 string email;
343 string rawPrincipalId;
343 344
344 List<char> excluded = new List<char>(new char[]{' '}); 345 List<char> excluded = new List<char>(new char[]{' '});
345 346
@@ -359,7 +360,16 @@ namespace OpenSim.Services.UserAccountService
359 email = MainConsole.Instance.CmdPrompt("Email", ""); 360 email = MainConsole.Instance.CmdPrompt("Email", "");
360 else email = cmdparams[5]; 361 else email = cmdparams[5];
361 362
362 CreateUser(UUID.Zero, firstName, lastName, password, email); 363 if (cmdparams.Length < 7)
364 rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
365 else
366 rawPrincipalId = cmdparams[6];
367
368 UUID principalId = UUID.Zero;
369 if (!UUID.TryParse(rawPrincipalId, out principalId))
370 throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId));
371
372 CreateUser(UUID.Zero, principalId, firstName, lastName, password, email);
363 } 373 }
364 374
365 protected void HandleShowAccount(string module, string[] cmdparams) 375 protected void HandleShowAccount(string module, string[] cmdparams)
@@ -472,16 +482,17 @@ namespace OpenSim.Services.UserAccountService
472 /// Create a user 482 /// Create a user
473 /// </summary> 483 /// </summary>
474 /// <param name="scopeID">Allows hosting of multiple grids in a single database. Normally left as UUID.Zero</param> 484 /// <param name="scopeID">Allows hosting of multiple grids in a single database. Normally left as UUID.Zero</param>
485 /// <param name="principalID">ID of the user</param>
475 /// <param name="firstName"></param> 486 /// <param name="firstName"></param>
476 /// <param name="lastName"></param> 487 /// <param name="lastName"></param>
477 /// <param name="password"></param> 488 /// <param name="password"></param>
478 /// <param name="email"></param> 489 /// <param name="email"></param>
479 public UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) 490 public UserAccount CreateUser(UUID scopeID, UUID principalID, string firstName, string lastName, string password, string email)
480 { 491 {
481 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); 492 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
482 if (null == account) 493 if (null == account)
483 { 494 {
484 account = new UserAccount(UUID.Zero, firstName, lastName, email); 495 account = new UserAccount(UUID.Zero, principalID, firstName, lastName, email);
485 if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) 496 if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
486 { 497 {
487 account.ServiceURLs = new Dictionary<string, object>(); 498 account.ServiceURLs = new Dictionary<string, object>();