Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Simple addition need for BASIC-Auth on mod_fcgid

UserPost

4:31 pm
March 5, 2009


Uli

Member

posts 6

1

In an unpatched mod_fcgid setup, there are no PHP_AUTH_USER and PHP_AUTH_PW credentials available. Thus, you have to add the following code to the .htaccess:

# PHP (CGI mode) HTTP Authorization with ModRewrite:
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

And modify the following code in feed-interceptor_rs.php:

if (!empty($current_user))
    return;
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])

so that it looks like this:

if (!empty($current_user))
        return;
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);
}
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])

Hope you can include that :) disclose-secret had exactly the same problem which i described here (in german)

11:43 am
March 9, 2009


Kevin

Admin

posts 2402

2

Okay, I'll add this to the next RS version.

According to a comment in this thread, some Apache version will name the server variable REDIRECT_HTTP_AUTHENTICATION, so I'm thinking to put this ahead of your code:

if ( isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) 
&& ! isset($_SERVER['HTTP_AUTHORIZATION']) )
  $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];

About the Agapetry forum

Currently Online:

12 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1186

Posts: 5409

Members:

There are 1176 members

There are 1 guests


Kevin has made 2402 posts

Top Posters:

metal450 - 159

Ragnar - 105

YikYak - 70

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin