summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/ldap_simple.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-12-28 12:48:56 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-12-28 12:48:56 +0000
commit9bf8303050e83100925f997fedb909c3e3d79dbf (patch)
treefeacc5bffb06bbde348878f77bbd8e39c5f80087 /plugins/password/drivers/ldap_simple.php
parent69253c318dc928e4abc8a7e0b1c086e6e497de94 (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_simple.php')
-rw-r--r--plugins/password/drivers/ldap_simple.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/password/drivers/ldap_simple.php b/plugins/password/drivers/ldap_simple.php
index 38db9f129..67f53d091 100644
--- a/plugins/password/drivers/ldap_simple.php
+++ b/plugins/password/drivers/ldap_simple.php
@@ -66,19 +66,25 @@ function password_save($curpass, $passwd)
}
/* Crypting new password */
- $passwd = ldap_simple_hash_password($passwd, $rcmail->config->get('password_ldap_encodage'));
- if (!$passwd) {
+ $crypted_pass = ldap_simple_hash_password($passwd, $rcmail->config->get('password_ldap_encodage'));
+ if (!$crypted_pass) {
ldap_unbind($ds);
return PASSWORD_CRYPT_ERROR;
}
- $entree[$rcmail->config->get('password_ldap_pwattr')] = $passwd;
+ $entree[$rcmail->config->get('password_ldap_pwattr')] = $crypted_pass;
/* Updating PasswordLastChange Attribute if desired */
if ($lchattr = $rcmail->config->get('password_ldap_lchattr')) {
$entree[$lchattr] = (int)(time() / 86400);
}
+ /* Update Samba password fields */
+ if ($smbattr = $rcmail->config->get('password_ldap_samba')) {
+ $sambaNTPassword = hash('md4', rcube_charset_convert($passwd, RCMAIL_CHARSET, 'UTF-16LE'));
+ $entree['sambaNTPassword'] = $sambaNTPassword;
+ $entree['sambaPwdLastSet'] = time();
+ }
if (!ldap_modify($ds, $user_dn, $entree)) {
ldap_unbind($ds);