Correction 'Authentification.php'
This commit is contained in:
parent
fcd7480ac2
commit
4e429ee31d
|
@ -113,9 +113,9 @@
|
||||||
|
|
||||||
/* (2) On met à jour les informations de l'administrateur */
|
/* (2) On met à jour les informations de l'administrateur */
|
||||||
$_SESSION['ADMIN'] = [
|
$_SESSION['ADMIN'] = [
|
||||||
'id' => (int) $checkBranch->answer()[0]['id_admin'],
|
'id' => (int) $checkBranch->answer()['id_admin'],
|
||||||
'username' => $checkBranch->answer()[0]['username'],
|
'username' => $checkBranch->answer()['username'],
|
||||||
'mail' => $checkBranch->answer()[0]['mail']
|
'mail' => $checkBranch->answer()['mail']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,6 @@
|
||||||
public static function admin($params){
|
public static function admin($params){
|
||||||
extract($params);
|
extract($params);
|
||||||
|
|
||||||
|
|
||||||
/* [0] Par défaut, on déconnecte l'administrateur
|
/* [0] Par défaut, on déconnecte l'administrateur
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$_SESSION['AUTH'][1] = '';
|
$_SESSION['AUTH'][1] = '';
|
||||||
|
@ -89,7 +88,7 @@
|
||||||
$usernameFetched = $getUsername->answer();
|
$usernameFetched = $getUsername->answer();
|
||||||
|
|
||||||
// Si aucun résultat, on retourne le status FALSE
|
// Si aucun résultat, on retourne le status FALSE
|
||||||
if( count($usernameFetched) == 0 )
|
if( $usernameFetched === false )
|
||||||
return [ 'status' => false ];
|
return [ 'status' => false ];
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,13 +97,13 @@
|
||||||
$hash_password = sessionManager::secure_hash($password);
|
$hash_password = sessionManager::secure_hash($password);
|
||||||
|
|
||||||
// Si mot de passe faux, on retourne le status FALSE
|
// Si mot de passe faux, on retourne le status FALSE
|
||||||
if( $usernameFetched[0]['password'] != $hash_password )
|
if( $usernameFetched['password'] != $hash_password )
|
||||||
return [ 'status' => false ];
|
return [ 'status' => false ];
|
||||||
|
|
||||||
|
|
||||||
/* [3] On définit le token
|
/* [3] On définit le token
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$_SESSION['AUTH'][1] = $usernameFetched[0]['token'];
|
$_SESSION['AUTH'][1] = $usernameFetched['token'];
|
||||||
|
|
||||||
|
|
||||||
// On retourne le status
|
// On retourne le status
|
||||||
|
|
Loading…
Reference in New Issue