note 70864 added to features.http-auth
| From: | admin at isprohosting dot com | Date: | Wed, 01 Nov 2006 14:21:25 +0000 |
| Subject: | note 70864 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119295@lists.php.net to get a copy of this message | ||
There are .htaccess which actually works for us (cPanel + phpsuexec) unless others failed. Perhaps
it may help someone.
# PHP (CGI mode) HTTP Authorization with ModRewrite:
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
Then you need small piece of php code to parse this line and then everything will work like with
mod_php:
if (isset($_SERVER['HTTP_AUTHORIZATION']))
{
$ha = base64_decode( substr($_SERVER['HTTP_AUTHORIZATION'],6) );
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', $ha);
unset $ha;
}
Enjoy!
----
Server IP: 216.194.113.175
Probable Submitter: 216.127.88.18
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- https://master.php.net/note/edit/70864
Del: integrated -- https://master.php.net/note/delete/70864/integrated
Del: useless -- https://master.php.net/note/delete/70864/useless
Del: bad code -- https://master.php.net/note/delete/70864/bad+code
Del: spam -- https://master.php.net/note/delete/70864/spam
Del: non-english -- https://master.php.net/note/delete/70864/non-english
Del: in docs -- https://master.php.net/note/delete/70864/in+docs
Del: other reasons-- https://master.php.net/note/delete/70864
Reject -- https://master.php.net/note/reject/70864
Search -- https://master.php.net/manage/user-notes.php