Issues

ZF-11611: _ensureRdnAttributeValues() and multi-valued RDN attributes

Issue Type: Bug Created: 2011-07-26T12:07:42.000+0000 Last Updated: 2011-08-04T20:51:56.000+0000 Status: Resolved Fix version(s): Reporter: Claude Duvergier (cduv) Assignee: Stefan Gehrig (sgehrig) Tags: - Zend_Ldap

Related issues: Attachments:

Description

I'm having an issue with Zend_Ldap_Node::_ensureRdnAttributeValues() that changes the value of the cn attribute.

Considering the LDAP group defined as follows:

<pre class="highlight">
dn: cn=funkygroup,ou=Groups,dc=domain,dc=local
objectClass: groupOfNames
objectClass: top
cn: The Funkygroup
cn: funkygroup
member: uid=john-doe,ou=Users,dc=domain,dc=local

The special thing here is that the cn attribute has 2 values: "The Funkygroup" and "funkygroup"

When creating a Zend_Ldap_Node with Zend_Ldap_Node::fromArray(), Zend_Ldap_Node::ensureRdnAttributeValues() gets called and get rid of the "_The Funkygroup" cn value because it is not part of the RDN of the node.

+Reproduce code:+

<pre class="highlight">
<?php

$data = array(
    'dn' => 'cn=funkygroup,ou=Groupes,dc=domain,dc=local',
    'objectClass' => array(
        'groupOfNames',
        'top',
    ),
    'cn' => array(
        'The Funkygroup',
        'funkygroup',
    ),
    'member' => 'uid=john-doe,ou=Users,dc=domain,dc=local',
);

$node = Zend_Ldap_Node::fromArray($data, true);
print_r($node->getChangedData());

+Expected result:+

<pre class="literal">
Array
(
)

+Actual result:+

<pre class="literal">
Array
(
    [cn] => Array
        (
            [0] => funkygroup
        )

)

I understand the need to ensure that the attributes used in the RDN are present in the Node (goal of Zend_Ldap_Node::_ensureRdnAttributeValues()) but when everything is already correctly set (each attributes present in the RDN are well defined): calling that method shouldn't break anything (or it should be possible to avoid calling such method)

Comments

Posted by Stefan Gehrig (sgehrig) on 2011-08-04T20:51:56.000+0000

fixed in r24351

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts