aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-17 20:22:51 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-17 20:22:51 +0100
commita02b00445ef4dfd279ee760fdcb175de1bb48024 (patch)
treef0b0f18c68bfa6ccdfb399166b776e1c732718ae /lib
parentb91a435ed4c2fc42d42d28e4cfc1c638c5500867 (diff)
downloadnextcloud-server-a02b00445ef4dfd279ee760fdcb175de1bb48024.tar.gz
nextcloud-server-a02b00445ef4dfd279ee760fdcb175de1bb48024.zip
Store result of authentication
Diffstat (limited to 'lib')
-rw-r--r--lib/private/api.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index 66b763fdc3e..35a09c5cd1b 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -47,6 +47,7 @@ class OC_API {
*/
protected static $actions = array();
private static $logoutRequired = false;
+ private static $isLoggedIn = false;
/**
* registers an api call
@@ -269,7 +270,10 @@ class OC_API {
* http basic auth
* @return string|false (username, or false on failure)
*/
- private static function loginUser(){
+ private static function loginUser() {
+ if(self::$isLoggedIn === true) {
+ return \OC_User::getUser();
+ }
// reuse existing login
$loggedIn = OC_User::isLoggedIn();
@@ -279,6 +283,7 @@ class OC_API {
// initialize the user's filesystem
\OC_Util::setUpFS(\OC_User::getUser());
+ self::$isLoggedIn = true;
return OC_User::getUser();
}
@@ -296,6 +301,7 @@ class OC_API {
// initialize the user's filesystem
\OC_Util::setUpFS(\OC_User::getUser());
+ self::$isLoggedIn = true;
return $authUser;
}