From a0dffd1f08eb88d490c199b0512f89537dd2c55d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 6 Nov 2016 10:08:36 +0100 Subject: [PATCH] set INFO.userPasswordStatusChange in personal module --- lam/docs/manual-sources/howto.xml | 4 ++-- lam/lib/modules/inetOrgPerson.inc | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lam/docs/manual-sources/howto.xml b/lam/docs/manual-sources/howto.xml index a31059d8..96af3570 100644 --- a/lam/docs/manual-sources/howto.xml +++ b/lam/docs/manual-sources/howto.xml @@ -7350,8 +7350,8 @@ OK (10 msec) $INFO.userPasswordStatusChange$: provides - additional information if the Unix password locking status was - changed, possible values: locked, unlocked, unchanged + additional information if the Personal/Unix password locking status + was changed, possible values: locked, unlocked, unchanged diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index d527879a..5e124534 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -977,6 +977,19 @@ class inetOrgPerson extends baseModule implements passwordService { if ($this->clearTextPassword != null) { $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordClearText'][0] = $this->clearTextPassword; } + // password status change + if (!$this->isUnixActive()) { + if ((pwd_is_enabled($this->orig['userPassword'][0]) && pwd_is_enabled($this->attributes['userPassword'][0])) + || (!pwd_is_enabled($this->orig['userPassword'][0]) && !pwd_is_enabled($this->attributes['userPassword'][0]))) { + $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'unchanged'; + } + elseif (pwd_is_enabled($this->orig['userPassword'][0])) { + $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'locked'; + } + else { + $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'unlocked'; + } + } return $return; }