Skip to content
Snippets Groups Projects
Commit 5bf050b1 authored by Björn Schießle's avatar Björn Schießle
Browse files

moved performance improvement from isLoggedIn() to userExists() to avoid webdav problems

parent bd494f56
No related branches found
No related tags found
No related merge requests found
......@@ -240,17 +240,13 @@ class OC_User {
* Checks if the user is logged in
*/
public static function isLoggedIn(){
static $is_login_checked = null;
if (!is_null($is_login_checked)) {
return $is_login_checked;
}
if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) {
OC_App::loadApps(array('authentication'));
if (self::userExists($_SESSION['user_id']) ){
return $is_login_checked = true;
return true;
}
}
return $is_login_checked = false;
return false;
}
/**
......@@ -349,13 +345,17 @@ class OC_User {
* @return boolean
*/
public static function userExists($uid){
static $user_exists_checked = null;
if (!is_null($user_exists_checked)) {
return $user_exists_checked;
}
foreach(self::$_usedBackends as $backend){
$result=$backend->userExists($uid);
if($result===true){
return true;
return $user_exists_checked = true;
}
}
return false;
return $user_exists_checked = false;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment