diff options
author | Hendrik Langer <hendrik.langer@gmx.de> | 2011-10-25 01:58:37 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-11-24 02:59:22 +0100 |
commit | 76bfc3b547064a5862f72f9165785aa134d8ce4f (patch) | |
tree | 821cd8ab497c83ea1811fe95c0a967cec490dc78 /lib/base.php | |
parent | c945989a70b278ddb038d194a5c9b84572ab201b (diff) | |
download | nextcloud-server-76bfc3b547064a5862f72f9165785aa134d8ce4f.tar.gz nextcloud-server-76bfc3b547064a5862f72f9165785aa134d8ce4f.zip |
set http auth headers for apache+php-cgi work around if variable gets renamed by apache
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php index c52b4493e01..700236c96c6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -92,6 +92,14 @@ class OC{ $_SERVER['PHP_AUTH_PW'] = strip_tags($password); } + //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); + $_SERVER['PHP_AUTH_PW'] = strip_tags($password); + } + // calculate the documentroot OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); |