From ba9106a7de2521191b80bb7e2a28c4e735e2b0ac Mon Sep 17 00:00:00 2001 From: viastolfi <vincent.astolfi@etu.uca.fr> Date: Wed, 7 Dec 2022 19:34:50 +0100 Subject: [PATCH] changement des routes --- .../api/inscrit/{readMdpFromMail.php => readFromMail.php} | 4 ++++ Sources/API/index.php | 6 +++--- Sources/API/models/Inscrit.php | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) rename Sources/API/api/inscrit/{readMdpFromMail.php => readFromMail.php} (86%) diff --git a/Sources/API/api/inscrit/readMdpFromMail.php b/Sources/API/api/inscrit/readFromMail.php similarity index 86% rename from Sources/API/api/inscrit/readMdpFromMail.php rename to Sources/API/api/inscrit/readFromMail.php index 949f139..505ef65 100644 --- a/Sources/API/api/inscrit/readMdpFromMail.php +++ b/Sources/API/api/inscrit/readFromMail.php @@ -19,6 +19,10 @@ extract($row); $inscrit_item = array( + 'id' => $id, + 'nom' => $nom, + 'prenom' => $prenom, + 'mail' => $mail, 'mdp' => $mdp ); array_push($inscrit_array, $inscrit_item); diff --git a/Sources/API/index.php b/Sources/API/index.php index a42837d..72a2e1e 100644 --- a/Sources/API/index.php +++ b/Sources/API/index.php @@ -7,12 +7,12 @@ $router->map( 'GET', '/', function(){ echo 'Hello World'; }); -$router->map('GET','/Inscrit/read', function(){ +$router->map('GET','/Inscrit', function(){ require(__DIR__.'/api/inscrit/read.php'); }); -$router->map('GET','/Inscrit/read/mailToMdp/[*:mail]', function($mail){ - require(__DIR__.'/api/inscrit/readMdpFromMail.php'); +$router->map('GET','/Inscrit/[*:mail]', function($mail){ + require(__DIR__.'/api/inscrit/readFromMail.php'); }); $match = $router->match(); diff --git a/Sources/API/models/Inscrit.php b/Sources/API/models/Inscrit.php index 02698ef..d3571be 100644 --- a/Sources/API/models/Inscrit.php +++ b/Sources/API/models/Inscrit.php @@ -33,6 +33,10 @@ public function readMdpFromMail($mail){ $query = 'SELECT + i.id as id, + i.nom as nom, + i.prenom as prenom, + i.mail as mail, i.mdp as mdp FROM '.$this->table.' i