diff options
author | alecpl <alec@alec.pl> | 2009-08-24 19:18:47 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-08-24 19:18:47 +0000 |
commit | 7b865083e71471c2c6f9e039b42e6e8cc4ac5657 (patch) | |
tree | f2a2ef3480892e866060fb8a114f96f8193e39bc /plugins/password/drivers | |
parent | f4360201ee06953119da2b4e7801b01a2bf00853 (diff) |
- Password/LDAP: support %name, %domain in userdn (#1486055)
Diffstat (limited to 'plugins/password/drivers')
-rw-r--r-- | plugins/password/drivers/ldap.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index 108782624..e38f13f8c 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -21,6 +21,14 @@ function password_save($curpass, $passwd) // Building user DN $userDN = str_replace('%login', $_SESSION['username'], $rcmail->config->get('password_ldap_userDN_mask')); + + $parts = explode('@', $_SESSION['username']); + if (count($parts) == 2) + { + $userDN = str_replace('%name', $parts[0], $userDN); + $userDN = str_replace('%domain', $parts[1], $userDN); + } + if (empty($userDN)) {return PASSWORD_CONNECT_ERROR;} // Connection Method |