Delete the user record in the AccountDB

This commit is contained in:
Daniel Berteaud 2016-02-03 18:21:30 +01:00
parent c7c231887c
commit f9c6658139
1 changed files with 3 additions and 1 deletions

View File

@ -109,6 +109,7 @@ foreach my $u (@lock){
event_signal('user-expire-account', $u);
}
# Accounts to be deleted
foreach my $u (@delete){
my $user = $a->get($u);
if (!$user || !$user->prop('type') || $user->prop('type') ne 'user'){
@ -133,10 +134,11 @@ foreach my $u (@delete){
getpwnam($u)->dir
);
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');
event_signal('user-delete', $u);
$a = esmith::AccountsDB->open || die "Couldn't open AccountsDB\n";
$a->get($u)->delete;
}
}
}