Skip to content

Commit

Permalink
load authentication apps before checking wether user exists. fixes oc…
Browse files Browse the repository at this point in the history
…-910
  • Loading branch information
blizzz committed Jun 4, 2012
1 parent 773f3cf commit 454f81f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/user.php
Expand Up @@ -127,7 +127,7 @@ public static function createUser( $uid, $password ){
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');
Expand Down Expand Up @@ -240,12 +240,13 @@ public static function logout(){
* 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;
}

/**
Expand Down

0 comments on commit 454f81f

Please sign in to comment.