Exemplo n.º 1
0
        public void createUser()
        {
            Console.WriteLine("\n********** Create User **********\n");

            string username;
            string password;
            string role;

            // Get username
            Console.WriteLine("Enter username: "******"Enter password for " + username + ":");
                password = Console.ReadLine();

                // Get role
                Console.WriteLine("Enter a role for " + username + ":");
                role = Console.ReadLine();

                string[] roles = { role };
                client.CreateUser(null, username, password, roles);

                Console.WriteLine("\nINFO: User created!");
            }
        }
Exemplo n.º 2
0
        private void SaveUser()
        {
            string        user;
            string        password;
            List <string> roles;

            switch (editType)
            {
            case EditType.CREATE:
                user     = userBox.Text.Trim();
                password = VerifyPassword();
                roles    = GetRoles();
                client.CreateUser(null, user, password, roles);
                break;

            case EditType.EDIT:
                user  = userBox.Text.Trim();
                roles = GetRoles();
                ReplaceRoles(user, roles);
                break;
            }
        }