Gestion de la récupération des informations du 'warehouse' et de l' 'admin' quand on a le token correspondant
This commit is contained in:
parent
f96a6aec95
commit
482f7888d2
|
@ -81,6 +81,12 @@
|
|||
// Si le token n'existe pas
|
||||
if( count($checkRoot->answer()) < 1 )
|
||||
return false;
|
||||
|
||||
// On met à jour les informations
|
||||
$_SESSION['WAREHOUSE'] = [
|
||||
'id' => $checkRoot->answer()[0]['id_warehouse'],
|
||||
'name' => $checkRoot->answer()[0]['name']
|
||||
];
|
||||
}
|
||||
|
||||
/* [3] Si authentification double
|
||||
|
@ -91,6 +97,13 @@
|
|||
// Si le token n'existe pas
|
||||
if( count($checkBranch->answer()) < 1 )
|
||||
return false;
|
||||
|
||||
// On met à jour les informations
|
||||
$_SESSION['ADMIN'] = [
|
||||
'id' => $checkBranch->answer()[0]['id_admin'],
|
||||
'username' => $checkBranch->answer()[0]['username'],
|
||||
'mail' => $checkBranch->answer()[0]['mail']
|
||||
];
|
||||
}
|
||||
|
||||
/* [4] Si pas d'erreur d'authentification, on retourne TRUE
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
use \manager\Authentification;
|
||||
|
||||
|
||||
var_dump($_SESSION['AUTH']);
|
||||
var_dump( Authentification::auth() );
|
||||
|
||||
var_dump( $_SESSION );
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue