diff options
author | thomascube <thomas@roundcube.net> | 2011-09-05 08:05:40 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-09-05 08:05:40 +0000 |
commit | 94a5a24fc2a8040b22d4012773ebb6879957cfdf (patch) | |
tree | c57813c6898d1328782af06c740bb4a0059c245f /program/include/rcube_ldap.php | |
parent | 4c4fe693d7d3e892e28fb99bd6f1cc65a3e66ccc (diff) |
Fallback to mail_domain in LDAP variable replacements; add 'host' to 'user_create' hook arguments (#1488024)
Diffstat (limited to 'program/include/rcube_ldap.php')
-rw-r--r-- | program/include/rcube_ldap.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php index bf978a7ff..699691d87 100644 --- a/program/include/rcube_ldap.php +++ b/program/include/rcube_ldap.php @@ -181,8 +181,11 @@ class rcube_ldap extends rcube_addressbook } // Get the pieces needed for variable replacement. - $fu = $RCMAIL->user->get_username(); - list($u, $d) = explode('@', $fu); + if ($fu = $RCMAIL->user->get_username()) + list($u, $d) = explode('@', $fu); + else + $d = $this->mail_domain; + $dc = 'dc='.strtr($d, array('.' => ',dc=')); // hierarchal domain string $replaces = array('%dc' => $dc, '%d' => $d, '%fu' => $fu, '%u' => $u); |