[turba] Contact View with ldap backend not working

Jan Schneider jan at horde.org
Tue Dec 12 16:40:28 UTC 2017


Zitat von Philipp Faeustlin <philipp.faeustlin at uni-hohenheim.de>:

> Am 07.12.2017 um 12:40 schrieb Jan Schneider:
>>
>> Zitat von Philipp Faeustlin <philipp.faeustlin at uni-hohenheim.de>:
>>
>>> Hi list,
>>>
>>> I try to setup an read-only ldap backend which is only searchable.  
>>> My turba backend configuration works to the point where I can  
>>> search for an entry and get some results displayed.
>>>
>>> When I try to view, copy or download vcard on one of the results,  
>>> I get an "Read error: (2) Protocol error"
>>>
>>> My Horde Turba Version is 4.2.21 from pear.
>>>
>>> My backend config look like this:
>>> $cfgSources['localldap'] = array(
>>>     'disabled' => false,
>>>     'title' => "Co-Workers",
>>>     'type' => 'ldap',
>>>     'params' => array(
>>>         'server' => 'ldaps://localhost',
>>>         'port' => 636,
>>>         'tls' => false,
>>>         'root' => 'o=localhost,c=DE',
>>>         'scope' => 'sub',
>>>         'charset' => 'utf-8',
>>>         'checkrequired' => false,
>>>         'checkrequired_string' => ' ',
>>>         'checksyntax' => false,
>>>         'version' => 3,
>>>         'sizelimit' => 3,
>>>     ),
>>>     'map' => array(
>>>         '__key' => 'dn',
>>>         'name' => 'cn',
>>>         'email' => 'mail',
>>>         'lastname' => 'sn',
>>>         'company' => 'ou',
>>>     ),
>>>     'tabs' => array(
>>>         'All' => array(
>>>             'name',
>>>             'email',
>>>             'lastname',
>>>             'company'
>>>         )
>>>     ),
>>>     'search' => array(
>>>         'name',
>>>         'email',
>>>         'lastname',
>>>         'company'
>>>     ),
>>>     'strict' => array(
>>>         'dn'
>>>     ),
>>>     'approximate' => array(
>>>         'cn', 'sn'
>>>     ),
>>>     'export' => false,
>>>     'browse' => false,
>>>     'use_shares' => false,
>>>     'all_shares' => false,
>>> );
>>>
>>> ---
>>>
>>> The horde global rights for this addressbook are show/view.
>>>
>>> Where is my mistake, what is missing?
>>>
>>> My horde.log is showing some PHP Error, perhaps they are related,  
>>> but I don't know their meaning, or how to solve them:
>>> -- horde.log --
>>> 2017-11-28T15:57:20+01:00 DEBUG: HORDE [turba] PHP ERROR:  
>>> Declaration of Horde_Form_Type_country::init() should be  
>>> compatible with Horde_Form_Type::init() [pid 13076 on line 0 of  
>>> "/usr/share/pear/Horde/Form/Type.php"]
>>> 2017-11-28T15:57:20+01:00 DEBUG: HORDE [turba] PHP ERROR:  
>>> Non-static method Horde_Form::getType() should not be called  
>>> statically, assuming $this from incompatible context [pid 13076 on  
>>> line 75 of "/var/www/webmail/turba/templates/browse/row.inc"]
>>> 2017-11-28T15:57:20+01:00 DEBUG: HORDE [turba] PHP ERROR: Only  
>>> variables should be passed by reference [pid 13076 on line 75 of  
>>> "/var/www/webmail/turba/templates/browse/row.inc"]
>>> -- --
>>>  Philipp Fäustlin
>>> Universität Hohenheim
>>
>> None of these messages from horde.log are relevant. Try checking  
>> the LDAP logs.
>>
> It tooks some time but I found the problem and a solution.
>
> The problem was an empty "$filter" variable in the _read function of  
> "turba/lib/Driver/Ldap.php".
> The $filter variable is used in the @ldap_read function, which  
> doesn't allow an empty filter.
> http://php.net/manual/en/function.ldap-read.php
>
> My solution is to use the 'objectclass' parameter in the backend  
> configuration, then it works fine.
>
> But I think it would be nice to set the $filter variable to  
> "objectClass=*" instead of "null" when missing the objectclass  
> params for the backend configuration.
> Or document the objectclass parameter as mandetory for the ldap backend.

Patch?

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the turba mailing list