diff --git a/manager/Authentification.php b/manager/Authentification.php index 08c15b0..9bd8776 100644 --- a/manager/Authentification.php +++ b/manager/Authentification.php @@ -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 diff --git a/test/authTest.php b/test/authTest.php index b6b14fb..dfaa4d5 100644 --- a/test/authTest.php +++ b/test/authTest.php @@ -4,7 +4,8 @@ use \manager\Authentification; - var_dump($_SESSION['AUTH']); var_dump( Authentification::auth() ); + var_dump( $_SESSION ); + ?>