diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-29 18:59:06 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-29 18:59:06 +0000 |
| commit | 17336ef87876067d4a50e7526d294b3512bce85c (patch) | |
| tree | adf2e467a2a100a5abfc7b0fe9988bfbb3820b63 /roundcubemail/program | |
| parent | 6b60dff56f4fe9775094853f05c9fd3c2cce7df3 (diff) | |
- Add mail_domain to LDAP email entries without @ sign (#1485201)
git-svn-id: https://svn.roundcube.net/trunk@2892 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_ldap.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php index 3bb747b0d..762e6e371 100644 --- a/roundcubemail/program/include/rcube_ldap.php +++ b/roundcubemail/program/include/rcube_ldap.php @@ -570,6 +570,8 @@ class rcube_ldap extends rcube_addressbook */ function _ldap2result($rec) { + global $RCMAIL; + $out = array(); if ($rec['dn']) @@ -577,8 +579,12 @@ class rcube_ldap extends rcube_addressbook foreach ($this->fieldmap as $rf => $lf) { - if ($rec[$lf]['count']) - $out[$rf] = $rec[$lf][0]; + if ($rec[$lf]['count']) { + if ($rf == 'email' && !strpos($rec[$lf][0], '@')) + $out[$rf] = sprintf('%s@%s', $rec[$lf][0] , $RCMAIL->config->mail_domain($_SESSION['imap_host'])); + else + $out[$rf] = $rec[$lf][0]; + } } return $out; |
