[RCD] LDAP Addressbook and wildcard searches

Jon Rifkin jon.rifkin at uconn.edu
Tue Apr 13 20:07:38 CEST 2010

Attached is a patch to RoundCube 0.3.1 modify the LDAP search behavior 
in the address book.  The patch has been tested with Cyrus IMAP.

The patch consists of two independent parts.

1) Wildcard searches

Currently, there is no way to do a wildcard search.  For example,
   "j smith" nor
performs wildcard searches, rather they search for names containing a 
space or an asterisk.

The patch treats "j smith" as a wildcard search.  It substitutes all 
spaces for asterisks that LDAP then interprets as the wildcard character.

This config parameter 'ldap_blank_as_wildcard' turns this behavior on; 
thus this patch does not change the default behavior.

2) Intitial LDAP search

When an LDAP address book is configured in main.inc.php and the user 
first selects it - before they even enter a search string - a number of 
seemingly random addresses are displayed, which typically are useless to 
the user.

Suppress searches with empty search strings.

This patch changes the default behavior - the new default is to NOT do 
empty LDAP searches.  Set 'ldap_allow_search_all' to TRUE to reproduce 
the original default behavior.

Thanks.  Hope this is useful.

- Jon

 --- 8< --- detachments --- 8< ---
 The following attachments have been detached and are available for viewing.
 Only click these links if you trust the sender, as well as this message.
 --- 8< --- detachments --- 8< ---

-------------- next part --------------
List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list