Bug #16406 Updated: ldap_delete and ldap_add return http header

From: Date: Wed, 03 Apr 2002 12:16:12 +0000
Subject: Bug #16406 Updated: ldap_delete and ldap_add return http header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3905@lists.php.net to get a copy of this message
ID: 16406 Updated by: aede.vander.weij@cgey.nl Reported By: aede.vander.weij@cgey.nl Status: Bogus Bug Type: LDAP related Operating System: win, iis PHP Version: 4.1.2 New Comment: I installed Apache on my win2000 machine and tested the code. This processed the code without any problems. I guess it is save to say that IIS, or at least the configuration is to blame. Previous Comments: ------------------------------------------------------------------------ [2002-04-03 05:25:15] mfischer@php.net See, the LDAP module does in no way return any headers if it encounters an error (that would render it useless for on-web application for which I use it for example). It's more likely a configuration error with your webserver or your code, you should double/tripple check that first. ------------------------------------------------------------------------ [2002-04-03 03:01:50] aede.vander.weij@cgey.nl 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 this bug report at http://bugs.php.net/?id=16406&edit=1

« previous php.bugs (#3905) next »