diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-04-29 09:40:33 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-05-11 13:36:46 +0200 |
commit | 168ccf90a6ae515b1e4c2c10f32b08f284ac50b3 (patch) | |
tree | 15c296265922f3d22be37733e6330619271d6fcb /lib/base.php | |
parent | aa85edd2242c696954c64799e7880f7a3d39ca83 (diff) | |
download | nextcloud-server-168ccf90a6ae515b1e4c2c10f32b08f284ac50b3.tar.gz nextcloud-server-168ccf90a6ae515b1e4c2c10f32b08f284ac50b3.zip |
try apache auth too
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php index fd8f39e0b8d..16ce0973a95 100644 --- a/lib/base.php +++ b/lib/base.php @@ -856,10 +856,7 @@ class OC { } else { // For guests: Load only filesystem and logging OC_App::loadApps(array('filesystem', 'logging')); - $userSession = self::$server->getUserSession(); - if (!$userSession->tryTokenLogin()) { - $userSession->tryBasicAuthLogin(); - } + self::handleLogin($request); } } @@ -905,6 +902,26 @@ class OC { } } + /** + * Check login: apache auth, auth token, basic auth + * + * @param OCP\IRequest $request + * @return boolean + */ + private static function handleLogin(OCP\IRequest $request) { + $userSession = self::$server->getUserSession(); + if (OC_User::handleApacheAuth()) { + return true; + } + if ($userSession->tryTokenLogin($request)) { + return true; + } + if ($userSession->tryBasicAuthLogin($request)) { + return true; + } + return false; + } + protected static function handleAuthHeaders() { //copy http auth headers for apache+php-fcgid work around if (isset($_SERVER['HTTP_XAUTHORIZATION']) && !isset($_SERVER['HTTP_AUTHORIZATION'])) { |