summaryrefslogtreecommitdiffstats
path: root/lib/private/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/user.php')
-rw-r--r--lib/private/user.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/user.php b/lib/private/user.php
index 2964b58ba14..17b84d1f93e 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -317,6 +317,15 @@ class OC_User {
}
/**
+ * Tries to login the user with HTTP Basic Authentication
+ */
+ public static function tryBasicAuthLogin() {
+ if(!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_USER'])) {
+ \OC_User::login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
+ }
+ }
+
+ /**
* Check if the user is logged in, considers also the HTTP basic credentials
* @return bool
*/
@@ -325,11 +334,6 @@ class OC_User {
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;
}