[*] WS : From 1.4 (PHP as CGI management)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13113 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aKorczak
2012-02-08 10:28:14 +00:00
parent c01de935dc
commit 1f615bcc4b
+14
View File
@@ -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'];