public
Description: A flexible, elegant and easy-to-use content management system
Homepage: http://textpattern.com/
Clone URL: git://github.com/gerhard/textpattern-4-0.git
Remove trigger_error on http-auth with fcgi as it works out of the box on 
lighttpd and other webservers. Also add workaround to allow http-auth to 
work on apache with php as (f)cgi in some cases. Confirmed to work on 
textdrive.

git-svn-id: http://svn.textpattern.com/development/4.0@2479 
9f4ba7e5-8be4-0310-8a13-eacbff687fd7
sencer (author)
Wed Jul 11 04:12:40 -0700 2007
commit  3321a9ad38958c6332ddcaf252561839b69aeb7a
tree    9f6032e912d21ed85477afc0fef157198fafd850
parent  5c0dcc22324399643410d076c7bb4e4beb429f0f
...
12
13
14
 
 
 
15
16
17
18
 
...
12
13
14
15
16
17
18
19
 
20
21
0
@@ -12,6 +12,9 @@
0
   RewriteRule ^(.+) - [PT,L]
0
 
0
   RewriteRule ^(.*) index.php
0
+
0
+ RewriteCond %{HTTP:Authorization} !^$
0
+ RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
0
 </IfModule>
0
 
0
-#php_value register_globals 0
0
\ No newline at end of file
0
+#php_value register_globals 0
...
551
552
553
554
555
556
557
558
559
560
561
...
565
566
567
 
 
 
 
 
568
569
570
...
551
552
553
 
 
 
 
 
554
555
556
...
560
561
562
563
564
565
566
567
568
569
570
0
@@ -551,11 +551,6 @@ $LastChangedRevision$
0
 // -------------------------------------------------------------
0
   function password_protect($atts)
0
   {
0
- if (!is_mod_php()) {
0
- trigger_error(gTxt('http_auth_requires_mod_php'));
0
- return;
0
- }
0
-
0
     ob_start();
0
 
0
     extract(lAtts(array(
0
@@ -565,6 +560,11 @@ $LastChangedRevision$
0
 
0
     $au = serverSet('PHP_AUTH_USER');
0
     $ap = serverSet('PHP_AUTH_PW');
0
+ //For php as (f)cgi, two rules in htaccess often allow this workaround
0
+ $ru = serverSet('REDIRECT_REMOTE_USER');
0
+ if ($ru && !$au && !$ap && substr( $ru,0,5) == 'Basic' ) {
0
+ list ( $au, $ap ) = explode( ':', base64_decode( substr( $ru,6)));
0
+ }
0
     if ($login && $pass) {
0
       if (!$au || !$ap || $au!= $login || $ap!= $pass) {
0
         header('WWW-Authenticate: Basic realm="Private"');

Comments

    No one has commented yet.