From 02fd7751d9b89d838fc8ca2dc60fe11f4cfe93a8 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Sun, 23 Nov 2008 03:38:40 +0000
Subject: Mantis#2660. Thank you kindly, Ruud Lathrop for a patch that: This
patch adds the option of adding the email when you create a new user. This
works in Gridmode as none Gridmode. This option is also added to
RemoteAdminPlugin. With a new handler you can create a user with a email.
---
OpenSim/Region/Application/OpenSim.cs | 29 ++++++++++++++++++----
OpenSim/Region/Application/OpenSimBase.cs | 4 +--
.../Communications/Local/LocalLoginService.cs | 2 +-
.../Communications/Local/LocalUserServices.cs | 2 +-
.../Modules/InterGrid/OpenGridProtocolModule.cs | 2 +-
5 files changed, 29 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index e3aee9d..765c471 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -516,7 +516,14 @@ namespace OpenSim
switch (args[0])
{
case "user":
- CreateUser(args);
+ if (ConfigurationSettings.Standalone)
+ {
+ CreateUser(args);
+ }
+ else
+ {
+ m_console.Notice("Create user is not available in grid mode, use the user-server.");
+ }
break;
}
}
@@ -537,7 +544,14 @@ namespace OpenSim
switch (args[1])
{
case "password":
- ResetUserPassword(args);
+ if (ConfigurationSettings.Standalone)
+ {
+ ResetUserPassword(args);
+ }
+ else
+ {
+ m_console.Notice("Reset user password is not available in grid mode, use the user-server.");
+ }
break;
}
@@ -734,12 +748,13 @@ namespace OpenSim
///
/// Create a new user
///
- ///
+ /// string array with parameters: firstname, lastname, password, locationX, locationY, email
protected void CreateUser(string[] cmdparams)
{
string firstName;
string lastName;
string password;
+ string email;
uint regX = 1000;
uint regY = 1000;
@@ -751,7 +766,7 @@ namespace OpenSim
lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
else lastName = cmdparams[2];
- if ( cmdparams.Length < 4 )
+ if (cmdparams.Length < 4)
password = MainConsole.Instance.PasswdPrompt("Password");
else password = cmdparams[3];
@@ -763,9 +778,13 @@ namespace OpenSim
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
else regY = Convert.ToUInt32(cmdparams[5]);
+ if (cmdparams.Length < 7)
+ email = MainConsole.Instance.CmdPrompt("Email", "");
+ else email = cmdparams[6];
+
if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName))
{
- CreateUser(firstName, lastName, password, regX, regY);
+ CreateUser(firstName, lastName, password, email, regX, regY);
}
else
{
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index fc531f5..608de06 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -298,9 +298,9 @@ namespace OpenSim
m_assetCache = new AssetCache(assetServer);
}
- public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY)
+ public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, string email, uint regX, uint regY)
{
- return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, regX, regY);
+ return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, email, regX, regY);
}
///
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 9caeda4..81cbbb4 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Communications.Local
//no current user account so make one
m_log.Info("[LOGIN]: No user account found so creating a new one.");
- m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
+ m_userManager.AddUserProfile(firstname, lastname, "test", "", defaultHomeX, defaultHomeY);
profile = m_userManager.GetUserProfile(firstname, lastname);
if (profile != null)
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index c0887df..8649d61 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Communications.Local
}
Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account");
- AddUserProfile(firstName, lastName, password, m_defaultHomeX, m_defaultHomeY);
+ AddUserProfile(firstName, lastName, password, "", m_defaultHomeX, m_defaultHomeY);
profile = GetUserProfile(firstName, lastName);
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index 1c86c2f..e3e69b0 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -530,7 +530,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
// get seed capagentData.firstname = FirstName;agentData.lastname = LastName;
if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode)
{
- homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID);
+ homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), "", homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID);
UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID);
if (userProfile2 != null)
{
--
cgit v1.1