[prev in list] [next in list] [prev in thread] [next in thread]
List: turba
Subject: Re: [turba] Contact View with ldap backend not working
From: Philipp Faeustlin <philipp.faeustlin () uni-hohenheim ! de>
Date: 2017-12-13 15:00:04
Message-ID: 06a0bafa-6c60-4b39-4007-d331b0e55d53 () uni-hohenheim ! de
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Am 12.12.2017 um 17:40 schrieb Jan Schneider:
>
> Zitat von Philipp Faeustlin <philipp.faeustlin@uni-hohenheim.de>:
>
>> Am 07.12.2017 um 12:40 schrieb Jan Schneider:
>>>
>>> Zitat von Philipp Faeustlin <philipp.faeustlin@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?
>
I can only offer a diff of the "./turba/lib/Driver/Ldap.php" against the
actual PEAR version.
["Ldap.php.patch" (text/x-patch)]
--- Ldap.php 2017-12-04 17:14:50.446290711 +0100
+++ Ldap.php.neu 2017-12-13 15:21:51.073600059 +0100
@@ -241,7 +241,7 @@
$this->_connect();
if (empty($this->_params['objectclass'])) {
- $filter = null;
+ $filter = "objectclass=*";
} else {
$filter = (string)Horde_Ldap_Filter::build(array('objectclass' => \
$this->_params['objectclass']), 'or'); }
["smime.p7s" (application/pkcs7-signature)]
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-unsubscribe@lists.horde.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic