PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_LDAP » Bug #290

ldap_rename (fix)

Details

Submitted2003-11-24 17:06 UTC
Frompeter at jingo dot com
Assignedjw
StatusClosed
PackageNet_LDAP
PHP Version4.3.3
OSlinux
Roadmaps(Not assigned)

Comments

[2003-11-24 17:06 UTC] peter at jingo dot com

Description:
------------
Entry.php line 449:

array_pop($newparent);
if (!@ldap_rename( $this->_link,$this->_olddn,$this->_dn,$newparent,true) ){

creates the message:
Notice: Array to string conversion in /usr/local/lib/php/Net/LDAP/Entry.php on line 455

Also, the new dn '$this->_dn' should be relative to the newparent string.

fix :

@@ -444,10 +444,13 @@
return $this->raiseError("Moving or renaming an dn is only supported in LDAP V3!", 80);
}
// ldap_rename ( resource link_identifier, string dn, string newrdn, string newparent, bool deleteoldrdn)
- $newparent = ldap_explode_dn($this->_dn,0);
+ $newparent = ldap_explode_dn($this->_dn,0);
// remove the first part
- array_pop($newparent);
- if (!@ldap_rename( $this->_link,$this->_olddn,$this->_dn,$newparent,true) ){
+ unset($newparent['count']);
+ $relativeDn = $newparent[0];
+ unset($newparent[0]);
+ $newparent = join(',',$newparent);
+ if (!@ldap_rename( $this->_link,$this->_olddn,$relativeDn,$newparent,true) ){
return $this->raiseError("DN not renamed: " . ldap_error($this->_link),ldap_errno($this->_link));
}
}

[2003-11-28 10:48 UTC] jw at php dot net

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.