[Date Prev][Date Next] [Chronological] [Thread] [Top]

php-LDAP: ldap_mod_del doesn't work

I'm not sure if this problem is on the php or the ldap side, but I hope
to get help here either way.
I'm trying to delete an attribute using the ldap_mod_del function of

if ($ds) {
    if ($r) {
        $sr=ldap_list($ds,"ou=personen,o=gat", "cn=".$User, $attrs);
        $info = ldap_get_entries($ds, $sr);

// $User is the Person who is logged in
// $attr is the attribute I want to delete

        $newinfo[$attr]= "";  // $newinfo[$attr]= $info[0][$attr];
´       //next line fails if newinfo is "" or has the current value
        $c=ldap_mod_del($r, "cn=".$User.",ou=Personen,o=gat", $newinfo);


I'm using OpenLDAP 2.0.11 with PHP 4.0.6.
What does the LDAP-server want to have for deleting the attribute? 
Or is the PHP-Syntax I'm using false?
(In this case, can somebody help me, please?)

The error message php generates is
"Warning:  LDAP: modify operation could not be completed. in .../xyz.php
on line xy"
<- this is the ldap_mod_del-line

The message logged by slapd is
"RESULT tag=103 err=21 text=$attr: value #0 contains invalid data"
 <- (I replaced the name of the real attribute with $attr)

Thanks for your help