Add new password encodage ('ad') in ldap password drivers (#1489349)

pull/130/merge
Aleksander Machniak 11 years ago
parent 0b17aae0cd
commit 6776d31cee

@ -201,7 +201,7 @@ $config['password_ldap_search_filter'] = '(uid=%login)';
// LDAP password hash type // LDAP password hash type
// Standard LDAP encryption type which must be one of: crypt, // Standard LDAP encryption type which must be one of: crypt,
// ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear. // ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, ad or clear.
// Please note that most encodage types require external libraries // Please note that most encodage types require external libraries
// to be included in your PHP installation, see function hashPassword in drivers/ldap.php for more info. // to be included in your PHP installation, see function hashPassword in drivers/ldap.php for more info.
// Default: 'crypt' // Default: 'crypt'

@ -279,6 +279,10 @@ class rcube_ldap_password
} }
break; break;
case 'ad':
$cryptedPassword = rcube_charset::convert('"' . $passwordClear . '"', RCUBE_CHARSET, 'UTF-16LE');
break;
case 'clear': case 'clear':
default: default:
$cryptedPassword = $passwordClear; $cryptedPassword = $passwordClear;

@ -247,6 +247,9 @@ class rcube_ldap_simple_password
return false; return false;
} }
break; break;
case 'ad':
$crypted_password = rcube_charset::convert('"' . $password_clear . '"', RCUBE_CHARSET, 'UTF-16LE');
break;
case 'clear': case 'clear':
default: default:
$crypted_password = $password_clear; $crypted_password = $password_clear;

Loading…
Cancel
Save