diff --git a/build/api/core/Authentification.php b/build/api/core/Authentification.php index 8c98537..325eca5 100644 --- a/build/api/core/Authentification.php +++ b/build/api/core/Authentification.php @@ -78,9 +78,9 @@ * */ public static function deepCheck(){ - /* [1] Si aucune authentification + /* [1] Si aucun token =========================================================*/ - if( self::auth() == 0 ) + if( is_null($GLOBALS['TOKEN']) ) return false; @@ -101,7 +101,7 @@ /* (3) Compares content */ $hashed = self::secure_hash($GLOBALS['TOKEN']); - if( strlen($hashed) !== 64 || $fc !== $hashed ) + if( strlen($hashed) !== 64 || $hashed !== $fc ) return false; /* (4) Stores new content */ @@ -169,7 +169,7 @@ * */ public static function auth(){ - return is_null($GLOBALS['TOKEN']) ? 0 : 1; + return !is_array($GLOBALS['PERM']) ? 0 : count($GLOBALS['PERM']); } }