PHP 4.0 Bug #7168 Updated: Unable to delete "facsimileTelephoneNumber" attribute
| From: | sniper@php.net | Date: | Tue, 07 Nov 2000 23:25:09 +0000 |
| Subject: | PHP 4.0 Bug #7168 Updated: Unable to delete "facsimileTelephoneNumber" attribute | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-37394@lists.php.net to get a copy of this message | ||
ID: 7168
Updated by: sniper
Reported By: espot@rosa.nta.no
Status: Feedback
Bug Type: LDAP related
Assigned To:
Comments:
Try adding this after both ldap_add() and ldap_mod_del() functions:
echo ldap_error($ds);
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-11-05 10:47:35] espot@rosa.nta.no
The following script also fails:
<?php
$ds=ldap_connect("localhost"); // assuming the LDAP server is on this host
if ($ds) {
// bind with appropriate dn to give update access
$r=ldap_bind($ds,"cn=root, o=LS, c=NO", "secret");
// prepare data
$info["cn"]="John Jones";
$info["sn"]="Jones";
$info["facsimileTelephoneNumber"] = "555-55555";
$info["mail"]="jonj@here.and.now";
$info["objectclass"]="inetOrgPerson";
$r=ldap_add($ds, "cn=John Jones, o=LS, c=NO", $info);
$delInfo["facsimileTelephoneNumber"] = "555-55555";
ldap_mod_del($ds, "cn=John Jones, o=LS, c=NO", $delInfo);
ldap_close($ds);
} else {
echo "Unable to connect to LDAP server";
}?>
---------------------------------------------------------------------------
[2000-11-04 01:51:15] sniper@php.net
There is no bug.
If you first delete the attribute with ldap_modify() of course
the ldap_mod_del() fails.
--Jani
---------------------------------------------------------------------------
[2000-10-12 17:13:33] espot@rosa.nta.no
in line 21 modInfo should be replaced by delInfo.
The problem remains the same.
---------------------------------------------------------------------------
[2000-10-12 17:08:22] espot@rosa.nta.no
The following script fails with the following output.
Warning: LDAP: modify operation could not be completed. in crash.php line 18
Warning: LDAP: modify operation could not be completed. in crash.php line 21
I'm using OpenLdap 2.0.6 (same for 2.0.3)
and PHP 4.0.3 (same for 4.0.2)
if "facsimileTelephoneNumber" is substituted with "telephoneNumber" or any other
attribute the script
runs fine. (except of course for trying to delete the same value twice)
<?php
$ds=ldap_connect("localhost"); // assuming the LDAP server is on this host
if ($ds) {
// bind with appropriate dn to give update access
$r=ldap_bind($ds,"cn=root, o=LS, c=NO", "secret");
// prepare data
$info["cn"]="John Jones";
$info["sn"]="Jones";
$info["facsimileTelephoneNumber"] = "555-55555";
$info["mail"]="jonj@here.and.now";
$info["objectclass"]="inetOrgPerson";
$r=ldap_add($ds, "cn=John Jones, o=LS, c=NO", $info);
$modInfo["facsimileTelephoneNumber"] = "";
ldap_modify($ds, "cn=John Jones, o=LS, c=NO", $modInfo);
$delInfo["facsimileTelephoneNumber"] = "555-55555";
ldap_mod_del($ds, "cn=John Jones, o=LS, c=NO", $modInfo);
ldap_close($ds);
} else {
echo "Unable to connect to LDAP server";
}
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7168