set INFO.userPasswordStatusChange in personal module

This commit is contained in:
Roland Gruber 2016-11-06 10:08:36 +01:00
parent a050000879
commit a0dffd1f08
2 changed files with 15 additions and 2 deletions

View File

@ -7350,8 +7350,8 @@ OK (10 msec)</programlisting>
<listitem>
<para><emphasis
role="bold">$INFO.userPasswordStatusChange$:</emphasis> provides
additional information if the Unix password locking status was
changed, possible values: locked, unlocked, unchanged</para>
additional information if the Personal/Unix password locking status
was changed, possible values: locked, unlocked, unchanged</para>
</listitem>
<listitem>

View File

@ -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;
}