OpenSim/Services/UserAccountService/UserAccountService.cs
/// <summary>
/// Handle the create user command from the console.
/// </summary>
/// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
Handle the create user command from the console.
Handle the create user command from the console .
protected void HandleCreateUser(string module, string[] cmdparams)
        {
            string firstName;
            string lastName;
            string password;
            string email;
            string rawPrincipalId;
            List<char> excluded = new List<char>(new char[]{' '});
            if (cmdparams.Length < 3)
                firstName = MainConsole.Instance.CmdPrompt("First name", "Default", excluded);
            else firstName = cmdparams[2];
            if (cmdparams.Length < 4)
                lastName = MainConsole.Instance.CmdPrompt("Last name", "User", excluded);
            else lastName = cmdparams[3];
            if (cmdparams.Length < 5)
                password = MainConsole.Instance.PasswdPrompt("Password");
            else password = cmdparams[4];
            if (cmdparams.Length < 6)
                email = MainConsole.Instance.CmdPrompt("Email", "");
            else email = cmdparams[5];
            if (cmdparams.Length < 7)
                rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
            else
                rawPrincipalId = cmdparams[6];
            UUID principalId = UUID.Zero;
            if (!UUID.TryParse(rawPrincipalId, out principalId))
                throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId));
            CreateUser(UUID.Zero, principalId, firstName, lastName, password, email);
        }
protected void HandleCreateUser ( string module , string [ ] cmdparams ) { string firstName ; string lastName ; string password ; string email ; string rawPrincipalId ; List < char > excluded = new List < char > ( new char [ ] { ' ' } ) ; if ( cmdparams . Length < 3 ) firstName = MainConsole . Instance . CmdPrompt ( " " , " " , excluded ) ; else firstName = cmdparams [ 2 ] ; if ( cmdparams . Length < 4 ) lastName = MainConsole . Instance . CmdPrompt ( " " , " " , excluded ) ; else lastName = cmdparams [ 3 ] ; if ( cmdparams . Length < 5 ) password = MainConsole . Instance . PasswdPrompt ( " " ) ; else password = cmdparams [ 4 ] ; if ( cmdparams . Length < 6 ) email = MainConsole . Instance . CmdPrompt ( " " , " " ) ; else email = cmdparams [ 5 ] ; if ( cmdparams . Length < 7 ) rawPrincipalId = MainConsole . Instance . CmdPrompt ( " " , UUID . Random ( ) . ToString ( ) ) ; else rawPrincipalId = cmdparams [ 6 ] ; UUID principalId = UUID . Zero ; if ( ! UUID . TryParse ( rawPrincipalId , out principalId ) ) throw new Exception ( string . Format ( " " , rawPrincipalId ) ) ; CreateUser ( UUID . Zero , principalId , firstName , lastName , password , email ) ; }
Handle the create user command from the console.
Handle the create user command from the console .
module
string
cmdparams
string[]
string array with parameters: firstname, lastname, password, locationX, locationY, email
string array with parameters : firstname lastname password locationX locationY email