summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-07-05 15:55:46 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-07-05 15:55:46 +0200
commit5bf050b13bbac944421ac6e993993237f847068a (patch)
treec0a05c3bf6b9266968d86937e901387c062a4628 /lib
parentbd494f562f5c396de557b2887e2b4559d4dfadb9 (diff)
downloadnextcloud-server-5bf050b13bbac944421ac6e993993237f847068a.tar.gz
nextcloud-server-5bf050b13bbac944421ac6e993993237f847068a.zip
moved performance improvement from isLoggedIn() to userExists() to avoid webdav problems
Diffstat (limited to 'lib')
-rw-r--r--lib/user.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/user.php b/lib/user.php
index 23b88aa1d06..d02c1208a8d 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -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;
}
/**