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.
PROBLEM Currently, there is no way to do a wildcard search. For example, neither "j smith" nor "j*smith" performs wildcard searches, rather they search for names containing a space or an asterisk.
SOLUTION The patch treats "j smith" as a wildcard search. It substitutes all spaces for asterisks that LDAP then interprets as the wildcard character.
CONFIG This config parameter 'ldap_blank_as_wildcard' turns this behavior on; thus this patch does not change the default behavior.
PROBLEM 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.
SOLUTION Suppress searches with empty search strings.
CONFIG 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.
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/sy/fkGvDhtx/rc_ldap.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/