Commit 2f6ea3d3 authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(user-reminder) Fix user-reminder parameter parsing

Code for supann could not be run

issue #5744
parent a67cf955
......@@ -46,15 +46,15 @@ $config = argonaut_read_config;
$config->{'fd_rdn'} = 'ou=fusiondirectory';
my $verbose = 0;
my $posix = 1;
my $ppolicy = 1;
my $posix = 0;
my $ppolicy = 0;
my $supann = 0;
sub print_usage
{
my ($help) = @_;
print "Usage : argonaut-user-reminder [--help] [--verbose] [--posix|--ppolicy|--both (default)|--supann]\n";
print "Usage : argonaut-user-reminder [--help] [--verbose] [--posix] [--ppolicy] [--supann] [--all]\n";
if ($help) {
print << "EOF";
......@@ -62,8 +62,8 @@ sub print_usage
--verbose : be verbose
--posix : check POSIX account expiration
--ppolicy : check ppolicy password expiration
--both : check both POSIX and ppolicy (default)
--supann : check supannRessourceEtatDate
--all : check POSIX, ppolicy and supannRessourceEtatDate
EOF
exit(0);
} else {
......@@ -76,13 +76,14 @@ foreach my $arg ( @ARGV ) {
$verbose = 1;
} elsif (lc($arg) eq "--posix") {
$posix = 1;
$ppolicy = 0;
} elsif (lc($arg) eq "--ppolicy") {
$posix = 0;
$ppolicy = 1;
} elsif (lc($arg) eq "--both") {
} elsif (lc($arg) eq "--supann") {
$supann = 1;
} elsif (lc($arg) eq "--all") {
$posix = 1;
$ppolicy = 1;
$supann = 1;
} elsif ((lc($arg) eq "--help") || (lc($arg) eq "-h")) {
print_usage(1);
} else {
......@@ -90,6 +91,13 @@ foreach my $arg ( @ARGV ) {
}
}
if (!$posix && !$ppolicy && !$supann) {
# Defaults to --all
$posix = 1;
$ppolicy = 1;
$supann = 1;
}
check_expired_users();
exit 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment