|
|
@ -28,7 +28,6 @@ my $service = $c->get('ExpireAccounts') || |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
my $warn_delay = $service->prop('WarningDelay') || '30'; |
|
|
|
my $warn_delay = $service->prop('WarningDelay') || '30'; |
|
|
|
my $warn_users = $service->prop('WarnUsers') || 'no'; |
|
|
|
|
|
|
|
my $recipient = $service->prop('WarningRecipient') || 'root'; |
|
|
|
my $recipient = $service->prop('WarningRecipient') || 'root'; |
|
|
|
my $days_between_warn = $service->prop('DaysBetweenWarnings') || '5'; |
|
|
|
my $days_between_warn = $service->prop('DaysBetweenWarnings') || '5'; |
|
|
|
my $archive_compress = $service->prop('ArchiveCompression') || '/usr/bin/pbzip2'; |
|
|
|
my $archive_compress = $service->prop('ArchiveCompression') || '/usr/bin/pbzip2'; |
|
|
@ -148,6 +147,7 @@ my $send_warn_for = {}; |
|
|
|
foreach my $user (keys %$rem){ |
|
|
|
foreach my $user (keys %$rem){ |
|
|
|
my $rec = $a->get($user) || next; |
|
|
|
my $rec = $a->get($user) || next; |
|
|
|
my $last_notif = $rec->prop('ExpireLastNotifiedOn') || 'never'; |
|
|
|
my $last_notif = $rec->prop('ExpireLastNotifiedOn') || 'never'; |
|
|
|
|
|
|
|
my $warn_user = $rec->prop('ExpireWarnUser') || 'disabled'; |
|
|
|
if ($last_notif =~ m/^(\d{4})\-(\d{1,2})\-(\d{1,2})/){ |
|
|
|
if ($last_notif =~ m/^(\d{4})\-(\d{1,2})\-(\d{1,2})/){ |
|
|
|
$last_notif = DateTime->new( |
|
|
|
$last_notif = DateTime->new( |
|
|
|
year => $1, |
|
|
|
year => $1, |
|
|
@ -164,7 +164,7 @@ foreach my $user (keys %$rem){ |
|
|
|
# Use templates-custom version by preference if it exists |
|
|
|
# Use templates-custom version by preference if it exists |
|
|
|
-f "${templates}-custom${source}" and $templates .= "-custom"; |
|
|
|
-f "${templates}-custom${source}" and $templates .= "-custom"; |
|
|
|
|
|
|
|
|
|
|
|
if ($warn_users){ |
|
|
|
if ($warn_user =~ m/^enabled|yes|on|1$/){ |
|
|
|
my $t = new Text::Template(TYPE => 'FILE', |
|
|
|
my $t = new Text::Template(TYPE => 'FILE', |
|
|
|
SOURCE => "${templates}${source}"); |
|
|
|
SOURCE => "${templates}${source}"); |
|
|
|
|
|
|
|
|
|
|
|