summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-10-13 21:59:16 +0200
committerGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-10-13 21:59:16 +0200
commita01d10e57db1893939d0a7706fad239df537e24b (patch)
tree3649dab6d0006981225f88574b26447f9fbeac1f /lib/base.php
parent4cbae823eb742fac80288c6c74acba26e0a9c5d6 (diff)
parentdb2fb38746bb9d89b402c3a768a247945d813989 (diff)
downloadnextcloud-server-a01d10e57db1893939d0a7706fad239df537e24b.tar.gz
nextcloud-server-a01d10e57db1893939d0a7706fad239df537e24b.zip
Merge branch 'master' into calendar
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 0156febe231..ade4d889631 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -81,6 +81,14 @@ class OC{
date_default_timezone_set('Europe/Berlin');
ini_set('arg_separator.output','&amp;');
+ //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);
+ $_SERVER['PHP_AUTH_PW'] = strip_tags($password);
+ }
+
// calculate the documentroot
OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));