5 use PVE::Tools qw(run_command);
8 use PVE::AccessControl;
9 use File::Path qw(make_path remove_tree);
12 use PVE::RPCEnvironment;
17 use PVE::API2::AccessControl;
18 use PVE::JSONSchema qw(get_standard_option);
21 use base qw(PVE::CLIHandler);
23 use Data::Dumper; # fixme: remove
25 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
31 die "please run as root\n" if $> != 0;
33 PVE::INotify::inotify_init();
35 my $rpcenv = PVE::RPCEnvironment->init('cli');
37 $rpcenv->init_request();
38 $rpcenv->set_language($ENV{LANG});
39 $rpcenv->set_user('root@pam');
41 # autmatically generate the private key if it does not already exists
42 PVE::Cluster::gen_auth_key();
44 my $read_password = sub {
46 # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET});
48 my $term = new Term::ReadLine ('pveum');
49 my $attribs = $term->Attribs;
50 $attribs->{redisplay_function} = $attribs->{shadow_redisplay};
51 my $input = $term->readline('Enter new password: ');
52 my $conf = $term->readline('Retype new password: ');
53 die "Passwords do not match.\n" if ($input ne $conf);
58 ticket => [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef,
61 print "$res->{ticket}\n";
63 useradd => [ 'PVE::API2::User', 'create_user', ['userid'] ],
64 usermod => [ 'PVE::API2::User', 'update_user', ['userid'] ],
65 userdel => [ 'PVE::API2::User', 'delete_user', ['userid'] ],
67 groupadd => [ 'PVE::API2::Group', 'create_group', ['groupid'] ],
68 groupmod => [ 'PVE::API2::Group', 'update_group', ['groupid'] ],
69 groupdel => [ 'PVE::API2::Group', 'delete_group', ['groupid'] ],
71 roleadd => [ 'PVE::API2::Role', 'create_role', ['roleid'] ],
72 rolemod => [ 'PVE::API2::Role', 'update_role', ['roleid'] ],
73 roledel => [ 'PVE::API2::Role', 'delete_role', ['roleid'] ],
75 aclmod => [ 'PVE::API2::ACL', 'update_acl', ['path', 'roles'], { delete => 0 }],
76 acldel => [ 'PVE::API2::ACL', 'update_acl', ['path', 'roles'], { delete => 1 }],
81 PVE::CLIHandler::handle_cmd($cmddef, "pveum", $cmd, \@ARGV, $read_password, $0);
89 pveum - PVE User Manager
97 No description available.
99 =include pve_copyright