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