summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/user.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/user.php b/lib/private/user.php
index a79fc2ce834..641a329b0dd 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -335,15 +335,19 @@ class OC_User {
}
/**
- * Check if the user is logged in
+ * Check if the user is logged in, considers also the HTTP basic credentials
* @return bool
- *
- * Checks if the user is logged in
*/
public static function isLoggedIn() {
if (\OC::$server->getSession()->get('user_id') !== null && self::$incognitoMode === false) {
return self::userExists(\OC::$server->getSession()->get('user_id'));
}
+
+ // Check whether the user has authenticated using Basic Authentication
+ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
+ return \OC_User::login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
+ }
+
return false;
}