aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService/UserAccountService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/UserAccountService/UserAccountService.cs')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs56
1 files changed, 51 insertions, 5 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 5b4d040..2e19ece 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework;
36using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
37using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion; 38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using PermissionMask = OpenSim.Framework.PermissionMask;
39 40
40namespace OpenSim.Services.UserAccountService 41namespace OpenSim.Services.UserAccountService
41{ 42{
@@ -97,7 +98,12 @@ namespace OpenSim.Services.UserAccountService
97 MainConsole.Instance.Commands.AddCommand("Users", false, 98 MainConsole.Instance.Commands.AddCommand("Users", false,
98 "reset user password", 99 "reset user password",
99 "reset user password [<first> [<last> [<password>]]]", 100 "reset user password [<first> [<last> [<password>]]]",
100 "Reset a user password", HandleResetUserPassword); 101 "Reset a user password", HandleResetUserPassword);
102
103 MainConsole.Instance.Commands.AddCommand("Users", false,
104 "reset user email",
105 "reset user email [<first> [<last> [<email>]]]",
106 "Reset a user email address", HandleResetUserEmail);
101 107
102 MainConsole.Instance.Commands.AddCommand("Users", false, 108 MainConsole.Instance.Commands.AddCommand("Users", false,
103 "set user level", 109 "set user level",
@@ -255,6 +261,10 @@ namespace OpenSim.Services.UserAccountService
255 return MakeUserAccount(d[0]); 261 return MakeUserAccount(d[0]);
256 } 262 }
257 263
264 public void InvalidateCache(UUID userID)
265 {
266 }
267
258 public bool StoreUserAccount(UserAccount data) 268 public bool StoreUserAccount(UserAccount data)
259 { 269 {
260// m_log.DebugFormat( 270// m_log.DebugFormat(
@@ -415,6 +425,43 @@ namespace OpenSim.Services.UserAccountService
415 MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName); 425 MainConsole.Instance.OutputFormat("Password reset for user {0} {1}", firstName, lastName);
416 } 426 }
417 427
428 protected void HandleResetUserEmail(string module, string[] cmdparams)
429 {
430 string firstName;
431 string lastName;
432 string newEmail;
433
434 if (cmdparams.Length < 4)
435 firstName = MainConsole.Instance.CmdPrompt("First name");
436 else firstName = cmdparams[3];
437
438 if (cmdparams.Length < 5)
439 lastName = MainConsole.Instance.CmdPrompt("Last name");
440 else lastName = cmdparams[4];
441
442 if (cmdparams.Length < 6)
443 newEmail = MainConsole.Instance.PasswdPrompt("New Email");
444 else newEmail = cmdparams[5];
445
446 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
447 if (account == null)
448 {
449 MainConsole.Instance.OutputFormat("No such user as {0} {1}", firstName, lastName);
450 return;
451 }
452
453 bool success = false;
454
455 account.Email = newEmail;
456
457 success = StoreUserAccount(account);
458 if (!success)
459 MainConsole.Instance.OutputFormat("Unable to set Email for account {0} {1}.", firstName, lastName);
460 else
461 MainConsole.Instance.OutputFormat("User Email set for user {0} {1} to {2}", firstName, lastName, account.Email);
462 }
463
464
418 protected void HandleSetUserLevel(string module, string[] cmdparams) 465 protected void HandleSetUserLevel(string module, string[] cmdparams)
419 { 466 {
420 string firstName; 467 string firstName;
@@ -475,7 +522,6 @@ namespace OpenSim.Services.UserAccountService
475 { 522 {
476 account.ServiceURLs = new Dictionary<string, object>(); 523 account.ServiceURLs = new Dictionary<string, object>();
477 account.ServiceURLs["HomeURI"] = string.Empty; 524 account.ServiceURLs["HomeURI"] = string.Empty;
478 account.ServiceURLs["GatekeeperURI"] = string.Empty;
479 account.ServiceURLs["InventoryServerURI"] = string.Empty; 525 account.ServiceURLs["InventoryServerURI"] = string.Empty;
480 account.ServiceURLs["AssetServerURI"] = string.Empty; 526 account.ServiceURLs["AssetServerURI"] = string.Empty;
481 } 527 }
@@ -549,7 +595,7 @@ namespace OpenSim.Services.UserAccountService
549 { 595 {
550 m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); 596 m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID);
551 597
552 InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Bodypart); 598 InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart);
553 599
554 InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); 600 InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID);
555 eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); 601 eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7");
@@ -611,7 +657,7 @@ namespace OpenSim.Services.UserAccountService
611 hair.Flags = (uint)WearableType.Hair; 657 hair.Flags = (uint)WearableType.Hair;
612 m_InventoryService.AddItem(hair); 658 m_InventoryService.AddItem(hair);
613 659
614 InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Clothing); 660 InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing);
615 661
616 InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); 662 InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID);
617 shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; 663 shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET;
@@ -665,4 +711,4 @@ namespace OpenSim.Services.UserAccountService
665 } 711 }
666 } 712 }
667 } 713 }
668} \ No newline at end of file 714}