[Tickets #11888] Re: Add possibility for composite RDNs in LDAP

noreply at bugs.horde.org noreply at bugs.horde.org
Fri Jun 13 09:07:07 UTC 2014


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11888
------------------------------------------------------------------------------
  Ticket             | 11888
  Updated By         | horde at iotti.biz
  Summary            | Add possibility for composite RDNs in LDAP
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Enhancement
  State              | Resolved
  Priority           | 2. Medium
  Milestone          |
  Patch              | 1
  Owners             | Jan Schneider
------------------------------------------------------------------------------


horde at iotti.biz (2014-06-13 09:07) wrote:

Hi Jan

I am trying your version of the patch, which came in 2.1.0, but when I  
call it from turba (see #11889) it does not work.

I did some testing: in turba/lib/Driver/Ldap.php in _makeRDN() there  
is the call to Horde_Ldap::quoteDN(). Exactly:
return Horde_Ldap::quoteDN(self::_makeRDNhelper($attributes,  
$this->_params['dn']));

It is called with these arguments (the value returned by  
self::_makeRDNhelper($attributes, $this->_params['dn']):

2014-06-13T10:24:14+02:00 DEBUG: Variable information:
array(1) {
   [0]=>
   array(3) {
     [0]=>
     array(2) {
       [0]=>
       string(2) "cn"
       [1]=>
       string(3) "Lux"
     }
     [1]=>
     array(2) {
       [0]=>
       string(2) "sn"
       [1]=>
       string(3) "Ten"
     }
     [2]=>
     array(2) {
       [0]=>
       string(1) "o"
       [1]=>
       string(18) "Ifoa Sede Centrale"
     }
   }
}

Backtrace:
1. Turba_Form_AddContact->execute() /usr/share/horde/turba/add.php:68
2. Turba_Driver->add() /usr/share/horde/turba/lib/Form/AddContact.php:76
3. Turba_Driver_Ldap->_makeKey() /usr/share/horde/turba/lib/Driver.php:880
4. Turba_Driver_Ldap->_makeRDN()  
/usr/share/horde/turba/lib/Driver/Ldap.php:508
5. Horde::debug() /usr/share/horde/turba/lib/Driver/Ldap.php:490


With my version, the result of calling Horde_Ldap::quoteDN is:

2014-06-13T10:22:35+02:00 DEBUG: Variable information:
string(34) "cn=Lux+sn=Ten+o=Acme Sede Centrale"

Backtrace:
1. Turba_Form_AddContact->execute() /usr/share/horde/turba/add.php:68
2. Turba_Driver->add() /usr/share/horde/turba/lib/Form/AddContact.php:76
3. Turba_Driver_Ldap->_makeKey() /usr/share/horde/turba/lib/Driver.php:880
4. Turba_Driver_Ldap->_makeRDN()  
/usr/share/horde/turba/lib/Driver/Ldap.php:508
5. Horde::debug() /usr/share/horde/turba/lib/Driver/Ldap.php:492


With the 2.1.0 version it is empty:

2014-06-13T10:24:14+02:00 DEBUG: Variable information:
string(0) ""

Backtrace:
1. Turba_Form_AddContact->execute() /usr/share/horde/turba/add.php:68
2. Turba_Driver->add() /usr/share/horde/turba/lib/Form/AddContact.php:76
3. Turba_Driver_Ldap->_makeKey() /usr/share/horde/turba/lib/Driver.php:880
4. Turba_Driver_Ldap->_makeRDN()  
/usr/share/horde/turba/lib/Driver/Ldap.php:508
5. Horde::debug() /usr/share/horde/turba/lib/Driver/Ldap.php:492


It seems to me that maybe the problem is that the arguments to  
Horde_Ldap::quoteDN() include only nested arrays (i.e. only the '+'  
linked part, not the trailing ',' linked part), but this is needed by  
the Turba code, which later adds the root dn.


Moreover I made another test, I configured Turba tu use simple, not  
composite DNs so I switched from:
$cfgSources['localldap']['params']['dn'] = array(array('cn', 'sn', 'o'));
to:
$cfgSources['localldap']['params']['dn'] = array('cn', 'sn', 'o');

But this yelds:
PHP Fatal error:  Cannot access self:: when no class scope is active  
in /usr/share/pear/Horde/Ldap.php

Maybe you can help correcting these issues?
If you want, you can pm me at luigi at iotti dot biz to make some  
tests, verify etc.

Thank you





More information about the bugs mailing list