Commit a67cf955 authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '5744-add-supann-2018-account-life-cyle-support-in-user-reminder' into '1.3-dev'

Resolve "Add SupAnn 2018 account life cyle support in user-reminder"

See merge request argonaut/argonaut!113
parents 3a133bb9 ae3dcb4c
......@@ -48,12 +48,13 @@ $config->{'fd_rdn'} = 'ou=fusiondirectory';
my $verbose = 0;
my $posix = 1;
my $ppolicy = 1;
my $supann = 0;
sub print_usage
{
my ($help) = @_;
print "Usage : argonaut-user-reminder [--help] [--verbose] [--posix|--ppolicy|--both (default)]\n";
print "Usage : argonaut-user-reminder [--help] [--verbose] [--posix|--ppolicy|--both (default)|--supann]\n";
if ($help) {
print << "EOF";
......@@ -61,7 +62,8 @@ sub print_usage
--verbose : be verbose
--posix : check POSIX account expiration
--ppolicy : check ppolicy password expiration
--both : check both (default)
--both : check both POSIX and ppolicy (default)
--supann : check supannRessourceEtatDate
EOF
exit(0);
} else {
......@@ -260,6 +262,27 @@ sub check_expired_users
}
}
}
if ($supann) {
# SupAnn expiration
# Consider supannRessourceEtatDate end date to be an expiration date if state is A
my $mesg = $ldap->search(
base => $config->{'ldap_base'},
filter => '(&(objectClass=person)(supannRessourceEtatDate={COMPTE}A:*))',
scope => 'subtree'
);
die_on_ldap_errors($mesg);
foreach my $entry ($mesg->entries()) {
my $cn = $entry->get_value('cn');
my ($labelstate, $substate, $start, $end) = split(':', $entry->get_value('supannRessourceEtatDate'));
if ($end < $now) {
print "$cn has an invalid supannRessourceEtatDate value\n" if $verbose;
} elsif ($end <= $next_alert_date) {
alert_user_if_needed($ldap,$entry,$now,0);
}
}
}
}
sub get_mail_from_entry
......
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