From 1b5388eae4872587e48c59737cb3fe6bfe8806d2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 18 Jan 2016 18:55:10 +0100 Subject: [PATCH] Remove ExpiredOn during password-modify --- createlinks | 5 +++++ root/etc/e-smith/events/actions/user-reset-expired | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 createlinks create mode 100644 root/etc/e-smith/events/actions/user-reset-expired diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..c31fc1f --- /dev/null +++ b/createlinks @@ -0,0 +1,5 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +event_link("user-reset-expired", 'password-modify', "80"); diff --git a/root/etc/e-smith/events/actions/user-reset-expired b/root/etc/e-smith/events/actions/user-reset-expired new file mode 100644 index 0000000..7e22c62 --- /dev/null +++ b/root/etc/e-smith/events/actions/user-reset-expired @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w + +use strict; +use esmith::AccountsDB; + +my $a = esmith::AccountsDB->open || die "Couldn't open the AccountsDB\n"; + +my $event = $ARGV[0]; +my $user = $ARGV[1]; + +if (!$event){ + die "Event must be specified\n"; +} +if (!$user){ + die "User must be specified\n"; +} + +my $rec = $a->get($user) || die "user $user not found in AccountsDB\n"; +$rec->del_prop('ExpireLockedOn'); +