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:
xdrm-brackets 2016-07-05 15:21:32 +02:00
parent 90add00c0d
commit 01f23e6671
2 changed files with 15 additions and 1 deletions

View File

@ -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

View File

@ -4,7 +4,8 @@
use \manager\Authentification;
var_dump($_SESSION['AUTH']);
var_dump( Authentification::auth() );
var_dump( $_SESSION );
?>