[horde] ActiveSync GAL setup help - search returns no contacts

Michael J Rubinsky mrubinsk at horde.org
Wed Feb 20 16:15:12 UTC 2013


Quoting James MacLean <macleajb at ednet.ns.ca>:

> On 02/20/2013 02:20 AM, Michael J Rubinsky wrote:
>>
>> Quoting "James B. MacLean" <macleajb at ednet.ns.ca>:
>>
>>> On 2013-02-07 2:06 AM, Michael J Rubinsky wrote:
>>>>
>>>> Quoting "James B. MacLean" <macleajb at ednet.ns.ca>:
>>>>
>>>>> So, no, I do not know if the LDAP server is being queried from  
>>>>> the GAL function properly and I would like to trace that back,  
>>>>> but, alas, my php skills for traversing where  
>>>>> this->_registry->contacts->search() goes is beyond my skill :(.
>>>>> Would you mind pointing out where that function is that is being  
>>>>> called and I will keep digging in to it.
>>>>
>>>> This calls Turba_Api::search() (so, it's in turba/lib/Api.php).  
>>>> The actual logic for the search that is called from  
>>>> Turba_Api::search() is in a combination of Turba_Driver::search()  
>>>> (so, in turba/lib/Driver.php) and Turba_Driver_Ldap::_search()  
>>>> (in turba/lib/Driver/Ldap.php).
>>>>
>>> Ok, getting somewhere now. When you search within Horde in the  
>>> "Global Address Book" the filter is :
>>>
>>> (|(givenname=Maclean, james)(sn=Maclean,  
>>> james)(|(displayname=*Maclean, james*)(mail=*Maclean, james*)))
>>>
>>> Which ties in well with the use of 'strict' settings in  
>>> turba/config/backends.local.php . When I do a search in  
>>> ActiveSync, it looks like :
>>>
>>> (&(givenname=Maclean)(sn=Maclean)(|(displayname=*Maclean*)(mail=*Maclean*))) which will never match for me. The AND appears to be coming from  
>>> :
>>>
>>> horde/turba/lib/Driver.php
>>>
>>> in
>>>
>>> public function makeSearch
>>>
>>> inside this if around line 460:
>>>
>>> if (count($strict_search) && count($search)) {
>>>
>>> changing that AND to OR gets things moving.
>>
>> That doesn't seem like the right fix.
>>
>> Can you see what the value of $query that is passed in to  
>> Horde/Core/ActiveSync/Driver.php in the _searchGal() method? I'm  
>> thinking I'm building that query incorrectly.
>>
>>
>
> Added :
>
> error_log("Q=" . print_r($query,true));
>
> Searching for Macle :
>
>
> Q=Array\n(\n    [query] => Macle\n    [range] => 0-50\n)\n
>
> Was that what you wanted?

Yup. Thanks.
-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6062 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/horde/attachments/20130220/94552e00/attachment-0001.bin>


More information about the horde mailing list