From 454f81fb1576e12a707fa772355f362f426da066 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Mon, 4 Jun 2012 21:31:35 +0200
Subject: [PATCH] load authentication apps before checking wether user exists.
 fixes oc-910

---
 lib/user.php | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/user.php b/lib/user.php
index 99c6add9bb..37e6dcd143 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -127,7 +127,7 @@ class OC_User {
 		if(trim($password) == ''){
 			throw new Exception('A valid password must be provided');
 		}
-		
+
 		// Check if user already exists
 		if( self::userExists($uid) ){
 			throw new Exception('The username is already being used');
@@ -240,12 +240,13 @@ class OC_User {
 	 * Checks if the user is logged in
 	 */
 	public static function isLoggedIn(){
-		if( isset($_SESSION['user_id']) AND $_SESSION['user_id'] AND self::userExists($_SESSION['user_id']) ){
-			return true;
-		}
-		else{
-			return false;
+		if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) {
+			OC_App::loadApps(array('authentication'));
+			if (self::userExists($_SESSION['user_id']) ){
+				return true;
+			}
 		}
+		return false;
 	}
 
 	/**
-- 
GitLab