On Fri, 19 Mar 2010 10:08:51 -0500, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
Here is a simple patch to prevent LDAP auto-complete from doing leading wildcard searches. eg a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd
or
bRANdenburg. This will mimic the results of popular email clients like, mail.app, thunderbird, gmail, outlook, and others. I also recommend the change offered by aberglund to patch your SQL addressbook:
http://www.roundcubeforum.net/5-release-support/16-requests/5693-address-aut...
in [RC root]/program/include/
--- rcube_ldap.php.orig 2010-03-17 15:48:38.000000000 -0500 +++ rcube_ldap.php 2010-03-17 15:50:26.000000000 -0500 @@ -325,13 +325,13 @@ if (is_array($this->prop['search_fields'])) { foreach ($this->prop['search_fields'] as $k => $field)
$filter .= "($field=$wc" . rcube_ldap::quote_string($value) .
"$wc)";
$filter .= "($field=" . rcube_ldap::quote_string($value) .
"$wc)";
} else { foreach ((array)$fields as $field) if ($f = $this->_map_field($field))
$filter .= "($f=$wc" . rcube_ldap::quote_string($value) .
"$wc)";
$filter .= "($f=" . rcube_ldap::quote_string($value) .
"$wc)";
} $filter .= ')';
Great work, Ryan. Works perfectly. Thanks for sharing!
-- Arne Berglund System Administrator, Internet Services Lane Education Service District Eugene, OR ______________
List info: http://lists.roundcube.net/users/