diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Interfaces/IUserAccountService.cs | 4 | ||||
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 19 |
2 files changed, 17 insertions, 6 deletions
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index a91aa0f..7a1ea7d 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs | |||
@@ -44,9 +44,9 @@ namespace OpenSim.Services.Interfaces | |||
44 | PrincipalID = principalID; | 44 | PrincipalID = principalID; |
45 | } | 45 | } |
46 | 46 | ||
47 | public UserAccount(UUID scopeID, string firstName, string lastName, string email) | 47 | public UserAccount(UUID scopeID, UUID principalID, string firstName, string lastName, string email) |
48 | { | 48 | { |
49 | PrincipalID = UUID.Random(); | 49 | PrincipalID = principalID; |
50 | ScopeID = scopeID; | 50 | ScopeID = scopeID; |
51 | FirstName = firstName; | 51 | FirstName = firstName; |
52 | LastName = lastName; | 52 | LastName = lastName; |
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>(); |