search for string in cn, sn and mail fields
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 28 Dec 2005 17:47:07 +0000 (17:47 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 28 Dec 2005 17:47:07 +0000 (17:47 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10511 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/abook_ldap_server.php

index 42839e05afb8657ddc00c40aaaef48a1fef07a08..1b16a4c0bcd8e623c1e2cf49359e94637e4d09c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -512,6 +512,8 @@ Version 1.5.1 -- CVS
     Issue is specific to sqBodyWrap() and string function wrappers introduced in 
     1.5.1.
   - MagicHTML fix for comments in styles.
     Issue is specific to sqBodyWrap() and string function wrappers introduced in 
     1.5.1.
   - MagicHTML fix for comments in styles.
+  - Added 'mail' and 'sn' attributes to address book LDAP backend search
+    expression (#1368154).
 
 Version 1.5.0 - 2 February 2004
 -------------------------------
 
 Version 1.5.0 - 2 February 2004
 -------------------------------
index c668d791f59f75b08d2d6161e06f4ee8de07dd41..027a5727e57a348c2ce8fb71ca723a2eb36136f2 100644 (file)
@@ -496,12 +496,14 @@ class abook_ldap_server extends addressbook_backend {
             /* Convert search from user's charset to the one used in ldap */
             $expr = $this->charset_encode($expr);
 
             /* Convert search from user's charset to the one used in ldap */
             $expr = $this->charset_encode($expr);
 
-            /* Make sure that search does not contain ldap special chars */
-            $expression = '(cn=*' . $this->ldapspecialchars($expr) . '*)';
+            /* sanitize search string */
+            $expr = $this->ldapspecialchars($expr);
+
+            /* Search for same string in cn, main and sn */
+            $expression = '(|(cn=*'.$expr.'*)(mail=*'.$expr.'*)(sn=*'.$expr.'*))';
 
             /* Undo sanitizing of * symbol */
             $expression = str_replace('\2a','*',$expression);
 
             /* Undo sanitizing of * symbol */
             $expression = str_replace('\2a','*',$expression);
-            /* TODO: implement any single character (?) matching */
         }
 
         /* Add search filtering */
         }
 
         /* Add search filtering */