[*] WS : From 1.4 (PHP as CGI management)
This commit is contained in:
@@ -29,6 +29,20 @@ ob_start();
|
||||
|
||||
require_once(dirname(__FILE__).'/../config/config.inc.php');
|
||||
|
||||
//set http auth headers for apache+php-cgi work around
|
||||
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches))
|
||||
{
|
||||
list($name, $password) = explode(':', base64_decode($matches[1]));
|
||||
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
|
||||
}
|
||||
|
||||
//set http auth headers for apache+php-cgi work around if variable gets renamed by apache
|
||||
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches))
|
||||
{
|
||||
list($name, $password) = explode(':', base64_decode($matches[1]));
|
||||
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
|
||||
}
|
||||
|
||||
// Use for image management (using the POST method of the browser to simulate the PUT method)
|
||||
$method = isset($_REQUEST['ps_method']) ? $_REQUEST['ps_method'] : $_SERVER['REQUEST_METHOD'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user