note 40489 added to features.http-auth
| From: | ianATiyatesDOTcoDORuk at rn2 dot php dot net | Date: | Fri, 05 Mar 2004 10:32:01 +0000 |
| Subject: | note 40489 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66288@lists.php.net to get a copy of this message | ||
In my use of HTTP Authentication, I've found that some Apache setups swap around the usual
variables.
Here's the fix I made so that you can still use PHP_AUTH_USER and PHP_AUTH_PW. Hope it helps
someone
<?php
## Apache server fix ##
if (isset($_SERVER['PHP_AUTH_USER']) && !isset($_ENV['REMOTE_USER']))
$_ENV['REMOTE_USER'] = $_SERVER['PHP_AUTH_USER'];
if (isset($_SERVER['AUTH_PASSWORD']) && !isset($_ENV['PHP_AUTH_PW']))
$_ENV['PHP_AUTH_PW'] = $_SERVER['AUTH_PASSWORD'];
?>
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40489
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40489&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40489&report=yes
Search -- http://master.php.net/manage/user-notes.php