diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-12-11 22:00:17 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-12-11 22:00:17 +0100 |
commit | 7f1bb5fd780f88e3765046af6777e5420d14829d (patch) | |
tree | 6e12d080bc82dababf11017bb46faae565013127 /lib/base.php | |
parent | 98dc0882cbba43e892d2a5a7bf015d0218e026cb (diff) | |
parent | a0548a416a56f6e0fd3269279777d57156c47d15 (diff) | |
download | nextcloud-server-7f1bb5fd780f88e3765046af6777e5420d14829d.tar.gz nextcloud-server-7f1bb5fd780f88e3765046af6777e5420d14829d.zip |
Merge branch 'master' into database
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 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)); |