]> git.proxmox.com Git - pve-access-control.git/blame - test/auth-test.pl
create correct man page and .pod
[pve-access-control.git] / test / auth-test.pl
CommitLineData
2c3a6c0a
DM
1#!/usr/bin/perl -w
2
3use strict;
4use Term::ReadLine;
5use PVE::AccessControl;
6
7my $username = shift;
8die "Username missing" if !$username;
9sub read_password {
10
11 my $term = new Term::ReadLine ('pveum');
12 my $attribs = $term->Attribs;
13 $attribs->{redisplay_function} = $attribs->{shadow_redisplay};
14 my $input = $term->readline('password: ');
15 return $input;
16}
17
18my $password = read_password();
19PVE::AccessControl::authenticate_user($username,$password);
20
21print "Authentication Successful!!\n";
22
23exit (0);