Delete the user record in the AccountDB

tags/smeserver-expire-accounts-0.1.7-1
Daniel Berteaud 9 years ago
parent c7c231887c
commit f9c6658139
  1. 4
      root/sbin/e-smith/expire-accounts

@ -109,6 +109,7 @@ foreach my $u (@lock){
event_signal('user-expire-account', $u); event_signal('user-expire-account', $u);
} }
# Accounts to be deleted
foreach my $u (@delete){ foreach my $u (@delete){
my $user = $a->get($u); my $user = $a->get($u);
if (!$user || !$user->prop('type') || $user->prop('type') ne 'user'){ if (!$user || !$user->prop('type') || $user->prop('type') ne 'user'){
@ -133,10 +134,11 @@ foreach my $u (@delete){
getpwnam($u)->dir getpwnam($u)->dir
); );
if ($res == 0){ if ($res == 0){
print $u . ": Data archived as $tar, the user account will now be deleted\n" if ($debug); print $u . ": Data archived as $tar. The user account will now be deleted\n" if ($debug);
$user->set_prop(type => 'user-deleted'); $user->set_prop(type => 'user-deleted');
event_signal('user-delete', $u); event_signal('user-delete', $u);
$a = esmith::AccountsDB->open || die "Couldn't open AccountsDB\n"; $a = esmith::AccountsDB->open || die "Couldn't open AccountsDB\n";
$a->get($u)->delete;
} }
} }
} }

Loading…
Cancel
Save