summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-12-11 22:00:17 +0100
committerRobin Appelman <icewind1991@gmail.com>2011-12-11 22:00:17 +0100
commit7f1bb5fd780f88e3765046af6777e5420d14829d (patch)
tree6e12d080bc82dababf11017bb46faae565013127 /lib/base.php
parent98dc0882cbba43e892d2a5a7bf015d0218e026cb (diff)
parenta0548a416a56f6e0fd3269279777d57156c47d15 (diff)
downloadnextcloud-server-7f1bb5fd780f88e3765046af6777e5420d14829d.tar.gz
nextcloud-server-7f1bb5fd780f88e3765046af6777e5420d14829d.zip
Merge branch 'master' into database
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index b6e8ccbe283..de2a7a673d5 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));