Store result of authentication

This commit is contained in:
Lukas Reschke 2014-12-17 20:22:51 +01:00
parent b91a435ed4
commit a02b00445e
1 changed files with 7 additions and 1 deletions

View File

@ -47,6 +47,7 @@ class OC_API {
*/
protected static $actions = array();
private static $logoutRequired = false;
private static $isLoggedIn = false;
/**
* registers an api call
@ -270,6 +271,9 @@ class OC_API {
* @return string|false (username, or false on failure)
*/
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;
}