[Svn] r2892 - in trunk/roundcubemail: . program/include

trac at roundcube.net trac at roundcube.net
Sat Aug 29 20:59:06 CEST 2009


Author: alec
Date: 2009-08-29 13:59:06 -0500 (Sat, 29 Aug 2009)
New Revision: 2892

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/include/rcube_ldap.php
Log:
- Add mail_domain to LDAP email entries without @ sign (#1485201)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2009-08-29 18:56:48 UTC (rev 2891)
+++ trunk/roundcubemail/CHANGELOG	2009-08-29 18:59:06 UTC (rev 2892)
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Add mail_domain to LDAP email entries without @ sign (#1485201)
 - Fix saving empty values in LDAP contact data (#1485781)
 - Fix LDAP contact update when RDN field is changed (#1485788)
 - Fix LDAP attributes case senitivity problems (#1485830)

Modified: trunk/roundcubemail/program/include/rcube_ldap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_ldap.php	2009-08-29 18:56:48 UTC (rev 2891)
+++ trunk/roundcubemail/program/include/rcube_ldap.php	2009-08-29 18:59:06 UTC (rev 2892)
@@ -570,6 +570,8 @@
    */
   function _ldap2result($rec)
   {
+    global $RCMAIL;
+
     $out = array();
     
     if ($rec['dn'])
@@ -577,8 +579,12 @@
     
     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;

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list