Summary | Wrong LDap search created |
Queue | Turba |
Queue Version | 4.0.3 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | macleajb (at) ednet (dot) ns (dot) ca |
Created | 03/04/2013 (4506 days ago) |
Due | |
Updated | 03/06/2013 (4504 days ago) |
Assigned | 03/04/2013 (4506 days ago) |
Resolved | 03/06/2013 (4504 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
it for the AND adding an "$key === 'AND' ||" .
State ⇒ Resolved
commit 6aa424dc814ec8c95851c16b6cc89172d87f7369
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Mar 6 13:05:53 2013 -0500
Allow for more deeply nested search criteria.
Fixes
Bug: 12089for activesync based global address book searches.turba/lib/Driver/Ldap.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/6aa424dc814ec8c95851c16b6cc89172d87f7369
Priority ⇒ 1. Low
Assigned to Michael Rubinsky
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Wrong LDap search created
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
(&(givenname=Maclean)(sn=Maclean)(|(displayname=*Maclean*)(mail=*Maclean*)))
Which never succeeds. I expect the returned search to be more like:
(&(|(givenname=Maclean)(sn=Maclean))(|(displayname=*Maclean*)(mail=*Maclean*)))
Looking at turba/lib/Driver/Ldap.php in function _buildSearchQuery,
the passed criteria is placed in a foreach that does not pull out the
passed array keys. Changing :
foreach ($criteria as $vals) {
to
foreach ($criteria as $key => $vals) {
and then checking for the key value in addition to the OR already
tested for by changing :
if (!empty($vals['OR'])) {
to
if ($key === 'OR' || !empty($vals['OR'])) {
makes the returned search :
(&(|(givenname=Maclean)(sn=Maclean))(|(|(|(displayname=Maclean*)(displayname=*
Maclean*))(|(mail=Maclean*)(mail=* Maclean*)))))
which does return values.
Sorry for not including a patch, but I am not convinced I chased down
the correct solution.