From f9c6658139ec522f174819a5222665c29637acd0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 3 Feb 2016 18:21:30 +0100 Subject: [PATCH] Delete the user record in the AccountDB --- root/sbin/e-smith/expire-accounts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root/sbin/e-smith/expire-accounts b/root/sbin/e-smith/expire-accounts index 4439fd7..0ea65ad 100644 --- a/root/sbin/e-smith/expire-accounts +++ b/root/sbin/e-smith/expire-accounts @@ -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; } } }