5 use PVE
::Tools
qw(run_command);
8 use PVE
::AccessControl
;
9 use File
::Path
qw(make_path remove_tree);
12 use PVE
::RPCEnvironment
;
18 use PVE
::API2
::AccessControl
;
19 use PVE
::JSONSchema
qw(get_standard_option);
22 use base
qw(PVE::CLIHandler);
24 use Data
::Dumper
; # fixme: remove
26 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
32 die "please run as root\n" if $> != 0;
34 PVE
::INotify
::inotify_init
();
36 my $rpcenv = PVE
::RPCEnvironment-
>init('cli');
38 $rpcenv->init_request();
39 $rpcenv->set_language($ENV{LANG
});
40 $rpcenv->set_user('root@pam');
42 # autmatically generate the private key if it does not already exists
43 PVE
::Cluster
::gen_auth_key
();
45 my $read_password = sub {
47 # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET});
49 my $term = new Term
::ReadLine
('pveum');
50 my $attribs = $term->Attribs;
51 $attribs->{redisplay_function
} = $attribs->{shadow_redisplay
};
52 my $input = $term->readline('Enter new password: ');
53 my $conf = $term->readline('Retype new password: ');
54 die "Passwords do not match.\n" if ($input ne $conf);
59 ticket
=> [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef,
62 print "$res->{ticket}\n";
64 useradd
=> [ 'PVE::API2::User', 'create_user', ['userid'] ],
65 usermod
=> [ 'PVE::API2::User', 'update_user', ['userid'] ],
66 userdel
=> [ 'PVE::API2::User', 'delete_user', ['userid'] ],
68 groupadd
=> [ 'PVE::API2::Group', 'create_group', ['groupid'] ],
69 groupmod
=> [ 'PVE::API2::Group', 'update_group', ['groupid'] ],
70 groupdel
=> [ 'PVE::API2::Group', 'delete_group', ['groupid'] ],
72 roleadd
=> [ 'PVE::API2::Role', 'create_role', ['roleid'] ],
73 rolemod
=> [ 'PVE::API2::Role', 'update_role', ['roleid'] ],
74 roledel
=> [ 'PVE::API2::Role', 'delete_role', ['roleid'] ],
76 pooladd
=> [ 'PVE::API2::Pool', 'create_pool', ['poolid'] ],
77 poolmod
=> [ 'PVE::API2::Pool', 'update_pool', ['poolid'] ],
78 pooldel
=> [ 'PVE::API2::Pool', 'delete_pool', ['poolid'] ],
80 aclmod
=> [ 'PVE::API2::ACL', 'update_acl', ['path', 'roles'], { delete => 0 }],
81 acldel
=> [ 'PVE::API2::ACL', 'update_acl', ['path', 'roles'], { delete => 1 }],
86 PVE
::CLIHandler
::handle_cmd
($cmddef, "pveum", $cmd, \
@ARGV, $read_password, $0);
94 pveum - PVE User Manager
102 No description available.
104 =include pve_copyright