X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FCLI%2Fpveum.pm;h=aef70899551c476c84d27a6274adc92cb8aad9b1;hp=772ba2949685b1c4f6eff4e532ee9009eb161217;hb=36dd9dbdb3e9e470f1787a5e98d5ba0a64ef9bbc;hpb=09281ad74465a7dbc92edfa02463b0d2332a6e98 diff --git a/PVE/CLI/pveum.pm b/PVE/CLI/pveum.pm index 772ba29..aef7089 100755 --- a/PVE/CLI/pveum.pm +++ b/PVE/CLI/pveum.pm @@ -21,6 +21,22 @@ use PVE::CLIHandler; use base qw(PVE::CLIHandler); +sub setup_environment { + PVE::RPCEnvironment->setup_default_cli_env(); +} + +sub read_password { + # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET}); + + my $term = new Term::ReadLine ('pveum'); + my $attribs = $term->Attribs; + $attribs->{redisplay_function} = $attribs->{shadow_redisplay}; + my $input = $term->readline('Enter new password: '); + my $conf = $term->readline('Retype new password: '); + die "Passwords do not match.\n" if ($input ne $conf); + return $input; +} + our $cmddef = { ticket => [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef, sub { @@ -47,19 +63,3 @@ our $cmddef = { }; 1; - -__END__ - -=head1 NAME - -pveum - PVE User Manager - -=head1 SYNOPSIS - -=include synopsis - -=head1 DESCRIPTION - -No description available. - -=include pve_copyright