diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-30 07:02:52 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-30 07:02:52 +0000 |
| commit | af9701630d5a04924e5f28d34f5346f20e7875e2 (patch) | |
| tree | 65cd9adf5119af7ccf4d1bd5086009e322c4eeae /plugins/password/drivers/ldap.php | |
| parent | 03e6e60988ea2b51aaa972e39d143ab705fa5386 (diff) | |
- Added password_ldap_lchattr option (#1486927)
git-svn-id: https://svn.roundcube.net/trunk@4019 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/drivers/ldap.php')
| -rw-r--r-- | plugins/password/drivers/ldap.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index f86abd7f4..c5cb2328a 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -80,12 +80,21 @@ function password_save($curpass, $passwd) if (!$userEntry->replace(array($pwattr => $newCryptedPassword), $force)) { return PASSWORD_CONNECT_ERROR; } + + // Updating PasswordLastChange Attribute if desired + if ($lchattr = $rcmail->config->get('password_ldap_lchattr')) { + $current_day = (int)(time() / 86400); + if (!$userEntry->replace(array($lchattr => $current_day), $force)) { + return PASSWORD_CONNECT_ERROR; + } + } + if (Net_LDAP2::isError($userEntry->update())) { return PASSWORD_CONNECT_ERROR; } // All done, no error - return PASSWORD_SUCCESS; + return PASSWORD_SUCCESS; } /** @@ -269,5 +278,3 @@ function randomSalt( $length ) return $str; } - -?> |
