diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-28 12:48:56 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-28 12:48:56 +0000 |
| commit | 9bf8303050e83100925f997fedb909c3e3d79dbf (patch) | |
| tree | feacc5bffb06bbde348878f77bbd8e39c5f80087 /plugins/password/drivers/ldap.php | |
| parent | 69253c318dc928e4abc8a7e0b1c086e6e497de94 (diff) | |
- ldap/ldap_simple drivers: support Samba password change
git-svn-id: https://svn.roundcube.net/trunk@4375 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/drivers/ldap.php')
| -rw-r--r-- | plugins/password/drivers/ldap.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index 98b6636be..e4d91fe1b 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -92,7 +92,15 @@ function password_save($curpass, $passwd) if (Net_LDAP2::isError($userEntry->update())) { return PASSWORD_CONNECT_ERROR; } - + + // Update Samba password fields, ignore errors if attributes are not found + if ($rcmail->config->get('password_ldap_samba')) { + $sambaNTPassword = hash('md4', rcube_charset_convert($passwd, RCMAIL_CHARSET, 'UTF-16LE')); + $userEntry->replace(array('sambaNTPassword' => $sambaNTPassword), $force); + $userEntry->replace(array('sambaPwdLastSet' => time()), $force); + $userEntry->update(); + } + // All done, no error return PASSWORD_SUCCESS; } |
