]>
git.proxmox.com Git - pve-access-control.git/blob - pveum
6 use PVE
::Tools
qw(run_command);
9 use PVE
::AccessControl
;
10 use File
::Path
qw(make_path remove_tree);
13 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 my $read_password = sub {
34 # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET});
36 my $term = new Term
::ReadLine
('pveum');
37 my $attribs = $term->Attribs;
38 $attribs->{redisplay_function
} = $attribs->{shadow_redisplay
};
39 my $input = $term->readline('Enter new password: ');
40 my $conf = $term->readline('Retype new password: ');
41 die "Passwords do not match.\n" if ($input ne $conf);
46 ticket
=> [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef,
49 print "$res->{ticket}\n";
52 passwd
=> [ 'PVE::API2::AccessControl', 'change_passsword', ['userid'] ],
54 useradd
=> [ 'PVE::API2::User', 'create_user', ['userid'] ],
55 usermod
=> [ 'PVE::API2::User', 'update_user', ['userid'] ],
56 userdel
=> [ 'PVE::API2::User', 'delete_user', ['userid'] ],
58 groupadd
=> [ 'PVE::API2::Group', 'create_group', ['groupid'] ],
59 groupmod
=> [ 'PVE::API2::Group', 'update_group', ['groupid'] ],
60 groupdel
=> [ 'PVE::API2::Group', 'delete_group', ['groupid'] ],
62 roleadd
=> [ 'PVE::API2::Role', 'create_role', ['roleid'] ],
63 rolemod
=> [ 'PVE::API2::Role', 'update_role', ['roleid'] ],
64 roledel
=> [ 'PVE::API2::Role', 'delete_role', ['roleid'] ],
66 aclmod
=> [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 0 }],
67 acldel
=> [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 1 }],
72 if (defined($cmd) && $cmd ne 'verifyapi' && $cmd ne 'printmanpod') {
73 die "please run as root\n" if $> != 0;
75 PVE
::INotify
::inotify_init
();
77 my $rpcenv = PVE
::RPCEnvironment-
>init('cli');
79 $rpcenv->init_request();
80 $rpcenv->set_language($ENV{LANG
});
81 $rpcenv->set_user('root@pam');
83 # autmatically generate the private key if it does not already exists
84 PVE
::Cluster
::gen_auth_key
();
87 PVE
::CLIHandler
::handle_cmd
($cmddef, "pveum", $cmd, \
@ARGV, $read_password, $0);
95 pveum - PVE User Manager
103 No description available.
105 =include pve_copyright