aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2011-10-12 01:30:14 +0100
committerMelanie2011-10-12 01:30:14 +0100
commit6af388ded9958b889700d8c3fc1d9f266cdf8759 (patch)
tree18289983c7f20e63e2ae8894b00324888515e202
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
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs11
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs4
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs19
4 files changed, 28 insertions, 8 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 94ab4da..76ff68b 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -3222,7 +3222,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
3222 UserAccount account = userAccountService.GetUserAccount(scopeID, firstName, lastName); 3222 UserAccount account = userAccountService.GetUserAccount(scopeID, firstName, lastName);
3223 if (null == account) 3223 if (null == account)
3224 { 3224 {
3225 account = new UserAccount(scopeID, firstName, lastName, email); 3225 account = new UserAccount(scopeID, UUID.Random(), firstName, lastName, email);
3226 if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) 3226 if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
3227 { 3227 {
3228 account.ServiceURLs = new Dictionary<string, object>(); 3228 account.ServiceURLs = new Dictionary<string, object>();
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 77f38ed..3e58287 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -540,9 +540,18 @@ namespace OpenSim
540 string password = MainConsole.Instance.PasswdPrompt("Password"); 540 string password = MainConsole.Instance.PasswdPrompt("Password");
541 string email = MainConsole.Instance.CmdPrompt("Email", ""); 541 string email = MainConsole.Instance.CmdPrompt("Email", "");
542 542
543 string rawPrincipalId = MainConsole.Instance.CmdPrompt("ID", UUID.Random().ToString());
544
545 UUID principalId = UUID.Zero;
546 if (!UUID.TryParse(rawPrincipalId, out principalId))
547 {
548 m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId);
549 return;
550 }
551
543 account 552 account
544 = ((UserAccountService)scene.UserAccountService).CreateUser( 553 = ((UserAccountService)scene.UserAccountService).CreateUser(
545 regionInfo.ScopeID, first, last, password, email); 554 regionInfo.ScopeID, principalId, first, last, password, email);
546 } 555 }
547// } 556// }
548 } 557 }
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>();