mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
* Added SetPassword to IAuthenticationService.
* Added create user command to UserAccountService. Works. * Deleted create user command from OpenSim.
This commit is contained in:
@@ -349,9 +349,6 @@ namespace OpenSim
|
||||
|
||||
if (ConfigurationSettings.Standalone)
|
||||
{
|
||||
m_console.Commands.AddCommand("region", false, "create user",
|
||||
"create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
|
||||
"Create a new user", HandleCreateUser);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "reset user password",
|
||||
"reset user password [<first> [<last> [<password>]]]",
|
||||
@@ -812,22 +809,6 @@ namespace OpenSim
|
||||
m_console.ConsoleScene = m_sceneManager.CurrentScene;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute switch for some of the create commands
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
private void HandleCreateUser(string module, string[] cmd)
|
||||
{
|
||||
if (ConfigurationSettings.Standalone)
|
||||
{
|
||||
CreateUser(cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("Create user is not available in grid mode, use the user server.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute switch for some of the reset commands
|
||||
/// </summary>
|
||||
@@ -1075,61 +1056,6 @@ namespace OpenSim
|
||||
return report;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new user
|
||||
/// </summary>
|
||||
/// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
|
||||
protected void CreateUser(string[] cmdparams)
|
||||
{
|
||||
string firstName;
|
||||
string lastName;
|
||||
string password;
|
||||
string email;
|
||||
uint regX = 1000;
|
||||
uint regY = 1000;
|
||||
|
||||
IConfig standalone;
|
||||
if ((standalone = m_config.Source.Configs["StandAlone"]) != null)
|
||||
{
|
||||
regX = (uint)standalone.GetInt("default_location_x", (int)regX);
|
||||
regY = (uint)standalone.GetInt("default_location_y", (int)regY);
|
||||
}
|
||||
|
||||
|
||||
if (cmdparams.Length < 3)
|
||||
firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
|
||||
else firstName = cmdparams[2];
|
||||
|
||||
if (cmdparams.Length < 4)
|
||||
lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
|
||||
else lastName = cmdparams[3];
|
||||
|
||||
if (cmdparams.Length < 5)
|
||||
password = MainConsole.Instance.PasswdPrompt("Password");
|
||||
else password = cmdparams[4];
|
||||
|
||||
if (cmdparams.Length < 6)
|
||||
regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
|
||||
else regX = Convert.ToUInt32(cmdparams[5]);
|
||||
|
||||
if (cmdparams.Length < 7)
|
||||
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
|
||||
else regY = Convert.ToUInt32(cmdparams[6]);
|
||||
|
||||
if (cmdparams.Length < 8)
|
||||
email = MainConsole.Instance.CmdPrompt("Email", "");
|
||||
else email = cmdparams[7];
|
||||
|
||||
if (null == m_commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName))
|
||||
{
|
||||
m_commsManager.UserAdminService.AddUser(firstName, lastName, password, email, regX, regY);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset a user password.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user