From: [EMAIL PROTECTED]
Operating system: win, iis
PHP version: 4.1.2
PHP Bug Type: LDAP related
Bug description: ldap_delete and ldap_add return http header
I'm using IIS, Win2000, PHP 4.1.2, IPlanet 5.1. When I try to delete or add
an entry I receive the http header. This is a sample of the code:
if (!$ds=@ldap_connect($LDAP_SERVER[$SERVER_ID])) die("Unable to
connect");
if (!@ldap_bind($ds,$gebruiker,$passw)) {
$errno = ldap_errno($ds);
// error 49 wrong password, error 32 unknown user
if ($errno == 49 || $errno == 32) {
//call login function
showLogin();
} else {
die("Unable to bind");
}
if (!@ldap_delete($ds, $dn)) {
$errno = ldap_errno($ds);
//error 50 No Access
if ($errno == 50) {
showLogin($);
} else {
die ("Could not delete");
}
}
What this should do is delete an entry by first connecting to the server,
then bind to it and finally delete the specified entry.
When a bind is unsuccessful due to wrong access info a redirect to a login
screen is forced. This also goes for when an object has insufficient right
to delete the specified entry.
The function ldap_delete does return true or false, but when I don't have
sufficient access rights to delete an entry (errno 50) the below http
header is not processed by the webserver but returned to the browser
instead.
X-Powered-By: PHP/4.1.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Location: http://www.somedomain.com/loginscreen.php
Content-type: text/html
This problem also occurs when I don't have proper rights to add an entry
with ldap_add.
These problems do not occur when I run the code on a Unix system and a
Apache webserver. So it might be the dll or IIS that's causing the
problems.
--
Edit bug report at http://bugs.php.net/?id=16406&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16406&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16406&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16406&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16406&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16406&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16406&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16406&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16406&r=submittedtwice