diff options
author | Dan Lake | 2011-10-04 16:59:35 -0700 |
---|---|---|
committer | Dan Lake | 2011-10-04 16:59:35 -0700 |
commit | 38d205502a83ed334d9827f43862579cec305639 (patch) | |
tree | 31358ac05557104e6e821309a9c68dd7b3151032 /OpenSim/Services | |
parent | Removed redundant IClientAPI calls from TreePopulatorModule. Removing tree ob... (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-38d205502a83ed334d9827f43862579cec305639.zip opensim-SC-38d205502a83ed334d9827f43862579cec305639.tar.gz opensim-SC-38d205502a83ed334d9827f43862579cec305639.tar.bz2 opensim-SC-38d205502a83ed334d9827f43862579cec305639.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-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 9c992e0..20414f6 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 e071b94..923be7e 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, |
@@ -321,6 +321,7 @@ namespace OpenSim.Services.UserAccountService | |||
321 | string lastName; | 321 | string lastName; |
322 | string password; | 322 | string password; |
323 | string email; | 323 | string email; |
324 | string rawPrincipalId; | ||
324 | 325 | ||
325 | List<char> excluded = new List<char>(new char[]{' '}); | 326 | List<char> excluded = new List<char>(new char[]{' '}); |
326 | 327 | ||
@@ -340,7 +341,16 @@ namespace OpenSim.Services.UserAccountService | |||
340 | email = MainConsole.Instance.CmdPrompt("Email", ""); | 341 | email = MainConsole.Instance.CmdPrompt("Email", ""); |
341 | else email = cmdparams[5]; | 342 | else email = cmdparams[5]; |
342 | 343 | ||
343 | CreateUser(UUID.Zero, firstName, lastName, password, email); | 344 | if (cmdparams.Length < 7) |
345 | rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString()); | ||
346 | else | ||
347 | rawPrincipalId = cmdparams[6]; | ||
348 | |||
349 | UUID principalId = UUID.Zero; | ||
350 | if (!UUID.TryParse(rawPrincipalId, out principalId)) | ||
351 | throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId)); | ||
352 | |||
353 | CreateUser(UUID.Zero, principalId, firstName, lastName, password, email); | ||
344 | } | 354 | } |
345 | 355 | ||
346 | protected void HandleShowAccount(string module, string[] cmdparams) | 356 | protected void HandleShowAccount(string module, string[] cmdparams) |
@@ -453,16 +463,17 @@ namespace OpenSim.Services.UserAccountService | |||
453 | /// Create a user | 463 | /// Create a user |
454 | /// </summary> | 464 | /// </summary> |
455 | /// <param name="scopeID">Allows hosting of multiple grids in a single database. Normally left as UUID.Zero</param> | 465 | /// <param name="scopeID">Allows hosting of multiple grids in a single database. Normally left as UUID.Zero</param> |
466 | /// <param name="principalID">ID of the user</param> | ||
456 | /// <param name="firstName"></param> | 467 | /// <param name="firstName"></param> |
457 | /// <param name="lastName"></param> | 468 | /// <param name="lastName"></param> |
458 | /// <param name="password"></param> | 469 | /// <param name="password"></param> |
459 | /// <param name="email"></param> | 470 | /// <param name="email"></param> |
460 | public UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) | 471 | public UserAccount CreateUser(UUID scopeID, UUID principalID, string firstName, string lastName, string password, string email) |
461 | { | 472 | { |
462 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); | 473 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); |
463 | if (null == account) | 474 | if (null == account) |
464 | { | 475 | { |
465 | account = new UserAccount(UUID.Zero, firstName, lastName, email); | 476 | account = new UserAccount(UUID.Zero, principalID, firstName, lastName, email); |
466 | if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) | 477 | if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) |
467 | { | 478 | { |
468 | account.ServiceURLs = new Dictionary<string, object>(); | 479 | account.ServiceURLs = new Dictionary<string, object>(); |