From 959b9cf0d0cff181a8c9177a41235185ea4144a6 Mon Sep 17 00:00:00 2001 From: Leo Tuaillon Date: Mon, 6 Nov 2023 17:53:22 +0100 Subject: [PATCH 1/4] connection --- php/src/config/config.php | 6 +-- php/src/controleur/UtilisateurControleur.php | 43 +++++++++------ php/src/gateway/AlumniGateway.php | 4 +- php/src/{modele => metier}/Alumni.php | 7 ++- php/src/{modele => metier}/Article.php | 2 +- php/src/{modele => metier}/Evenement.php | 2 +- php/src/{modele => metier}/Experience.php | 2 +- php/src/{modele => metier}/Formation.php | 2 +- php/src/{modele => metier}/Offre.php | 2 +- php/src/{modele => metier}/Profil.php | 2 +- php/src/{modele => metier}/Role.php | 2 +- php/src/modele/AdminModele.php | 4 +- php/src/modele/UtilisateurModele.php | 52 ++++++++++++++++--- php/templates/accueil.html | 3 ++ .../{connexion.html => connection.html} | 2 +- 15 files changed, 98 insertions(+), 37 deletions(-) rename php/src/{modele => metier}/Alumni.php (88%) rename php/src/{modele => metier}/Article.php (97%) rename php/src/{modele => metier}/Evenement.php (98%) rename php/src/{modele => metier}/Experience.php (98%) rename php/src/{modele => metier}/Formation.php (98%) rename php/src/{modele => metier}/Offre.php (99%) rename php/src/{modele => metier}/Profil.php (98%) rename php/src/{modele => metier}/Role.php (77%) rename php/templates/{connexion.html => connection.html} (95%) diff --git a/php/src/config/config.php b/php/src/config/config.php index 0a66244..dcb711b 100755 --- a/php/src/config/config.php +++ b/php/src/config/config.php @@ -7,6 +7,6 @@ $rep = __DIR__ . '/php/'; $dConfig['includes']= array('controleur/Validation.php'); //BD -$base = 'mysql:host=localhost;dbname=dbAlica'; -$login = 'root'; -$mdp = ''; +define('DB_HOST', 'mysql:host=localhost;dbname=dbAlica'); +define('DB_USER', 'Dev'); +define('DB_PASS', 'Dev'); \ No newline at end of file diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index 7ac47ec..5df7d7d 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -22,6 +22,7 @@ class UtilisateurControleur break; case "inscription": $this->inscription(); + break; case "consulterProfilLimite": $this->consulterProfilLimite(); @@ -36,7 +37,22 @@ class UtilisateurControleur protected function connection() { global $twig; - echo $twig->render('connexion.html', []); + $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant + + if (isset($_POST['email'], $_POST['password'])) { + $email = \App\config\Validation::nettoyerString($_POST['email']); + $motDePasse = \App\config\Validation::nettoyerString($_POST['password']); + $userModel = new \App\modele\UtilisateurModele(); + $utilisateur = $userModel->connection($email, $motDePasse); + if ($utilisateur instanceof \App\metier\Alumni) { + $_SESSION['utilisateur'] = $utilisateur; + header('Location: index.php?action=accueil'); + exit(); + } else { + $dVueErreur[] = "L'adresse email ou le mot de passe est incorrect."; + } + } + echo $twig->render('connection.html', ['dVueErreur' => $dVueErreur]); } protected function inscription() @@ -47,29 +63,26 @@ class UtilisateurControleur if (isset($_POST['email'], $_POST['username'], $_POST['password'])) { $email = \App\config\Validation::nettoyerString($_POST['email']); $motDePasse = \App\config\Validation::nettoyerString($_POST['password']); - - - // Validez les données d'inscription, par exemple, vérifiez si l'email est unique - // Vous pouvez également effectuer d'autres validations nécessaires - + // verification que l'email est valide et unique : + if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + $dVueErreur[] = "L'adresse email n'est pas valide."; + } else { + $userModel = new \App\modele\UtilisateurModele(); + $utilisateur = $userModel->getUtilisateurByEmail($email); + if ($utilisateur instanceof \App\metier\Alumni) { + $dVueErreur[] = "L'adresse email est déjà utilisée."; + } + } $userModel = new \App\modele\UtilisateurModele(); $nouvelUtilisateur = $userModel->inscription($email, $motDePasse); - // Si l'inscription a réussi, redirigez l'utilisateur vers une page de confirmation - // Vous pouvez également gérer les erreurs ici en cas d'échec de l'inscription - - if ($nouvelUtilisateur instanceof \App\modele\Alumni) { - // L'inscription a réussi, redirigez l'utilisateur vers une page de confirmation - // par exemple : + if ($nouvelUtilisateur instanceof \App\metier\Alumni) { header('Location: index.php?action=inscription_success'); exit(); } else { - // L'inscription a échoué, ajoutez un message d'erreur $dVueErreur[] = "L'inscription a échoué, veuillez réessayer."; } } - - // Affichez le formulaire d'inscription ou les erreurs le cas échéant echo $twig->render('inscription.html', ['dVueErreur' => $dVueErreur]); } diff --git a/php/src/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php index 1a00ff4..9f140bc 100644 --- a/php/src/gateway/AlumniGateway.php +++ b/php/src/gateway/AlumniGateway.php @@ -64,12 +64,12 @@ class AlumniGateway } public function findByEmail(string $email){ - $query='SELECT * FROM Alumni WHERE email=:e'; + $query='SELECT * FROM Alumni WHERE mail=:e'; $this->con->executeQuery($query, array( ':e' => array($email, PDO::PARAM_STR), )); $res=$this->con->getResults(); - return new Alumni($res[0]['mail'],$res[0]['id'],$res[0]['mdp'],$res[0]['role']); + return new \App\metier\Alumni($res[0]['mail'],$res[0]['mdp'],$res[0]['role']); } public function getAll(){ diff --git a/php/src/modele/Alumni.php b/php/src/metier/Alumni.php similarity index 88% rename from php/src/modele/Alumni.php rename to php/src/metier/Alumni.php index 7084fba..d1ac2fe 100644 --- a/php/src/modele/Alumni.php +++ b/php/src/metier/Alumni.php @@ -1,6 +1,6 @@ role; } + + public function getPassword(): string + { + return $this->motDePasse; + } } \ No newline at end of file diff --git a/php/src/modele/Article.php b/php/src/metier/Article.php similarity index 97% rename from php/src/modele/Article.php rename to php/src/metier/Article.php index db20f77..1c4ca95 100644 --- a/php/src/modele/Article.php +++ b/php/src/metier/Article.php @@ -1,5 +1,5 @@ findByEmail($email); + if ($utilisateur instanceof \App\metier\Alumni) { + // L'utilisateur existe, vérifiez le mot de passe + if ($hash==$utilisateur->getPassword()) { + // Le mot de passe est correct, retournez l'utilisateur + return $utilisateur; + } else { + // Le mot de passe est incorrect, renvoyez null + return new \App\metier\Alumni(null, null, null); + } + } else { + // L'utilisateur n'existe pas, renvoyez null + return new \App\metier\Alumni(null, null, null); + } } /** @@ -31,7 +50,7 @@ class UtilisateurModele * @param string $pseudo * @return \Alumni chargé */ - public function inscription(string $email, string $hashpassword): \App\modele\Alumni + public function inscription(string $email, string $hashpassword): \App\metier\Alumni { $dsn = "mysql:host=localhost;dbname=dbAlica"; $username = "Dev"; @@ -43,11 +62,30 @@ class UtilisateurModele // Insérez le nouvel utilisateur dans la base de données en utilisant AlumniGateway if ($gate->insert($email, $hashpassword, $role)) { // L'insertion a réussi, retournez le nouvel utilisateur - $nouvelUtilisateur = new \App\modele\Alumni($email, $hashpassword, $role); + $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role); return $nouvelUtilisateur; } else { // L'insertion a échoué, renvoyez un utilisateur vide pour indiquer l'échec - return new \App\modele\Alumni(null, null, null); + return new \App\metier\Alumni(null, null, null); + } + } + + public function getUtilisateurByEmail(string $email) + { + $dsn = "mysql:host=localhost;dbname=dbAlica"; + $username = "Dev"; + $password = "Dev"; + + $con = new \App\gateway\Connection($dsn, $username, $password); + $gate = new \App\gateway\AlumniGateway($con); + // Récupérez l'utilisateur avec l'email donné en utilisant AlumniGateway + $utilisateur = $gate->findByEmail($email); + if ($utilisateur instanceof \App\metier\Alumni) { + // L'utilisateur existe, retournez-le + return $utilisateur; + } else { + // L'utilisateur n'existe pas, renvoyez null + return null; } } } diff --git a/php/templates/accueil.html b/php/templates/accueil.html index 1438392..18b3aa3 100755 --- a/php/templates/accueil.html +++ b/php/templates/accueil.html @@ -10,6 +10,8 @@

Accueil

+ +

Bienvenue {{session.mail}}

Vous êtes sur la page d'accueil

Vous pouvez vous connecter ou vous inscrire

Vous pouvez aussi consulter les articles

@@ -22,3 +24,4 @@ + diff --git a/php/templates/connexion.html b/php/templates/connection.html similarity index 95% rename from php/templates/connexion.html rename to php/templates/connection.html index 2dd061a..5d90cbe 100755 --- a/php/templates/connexion.html +++ b/php/templates/connection.html @@ -16,7 +16,7 @@
- +
From a9afecf68a2b3f6033314ca196465981c24fa839 Mon Sep 17 00:00:00 2001 From: Leo Tuaillon Date: Tue, 7 Nov 2023 14:19:56 +0100 Subject: [PATCH 2/4] connection + deconnection fonctionnelles --- php/public/assets/logo.png | Bin 0 -> 34574 bytes php/public/css/menu.css | 145 +++++++++++++++++++ php/public/index.php | 5 +- php/src/controleur/FrontControleur.php | 5 +- php/src/controleur/MembreControleur.php | 10 +- php/src/controleur/UtilisateurControleur.php | 12 +- php/src/gateway/AlumniGateway.php | 6 + php/src/modele/UtilisateurModele.php | 9 +- php/templates/accueil.html | 9 +- php/templates/menu.html | 37 +++++ 10 files changed, 223 insertions(+), 15 deletions(-) create mode 100644 php/public/assets/logo.png create mode 100644 php/public/css/menu.css create mode 100644 php/templates/menu.html diff --git a/php/public/assets/logo.png b/php/public/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d272825ec4ee1bc80e6dc583deb622b0fe860cb2 GIT binary patch literal 34574 zcmeFZXH-*N^9OnWDFOmYR{~-~l&*jhihziPBGNlZN2Dkaq)Qc0P*G7jC?LH`?+DoF zy(FPLN=*U+2@pc=K0NPx*ZwbSfxQwUly=V5!Z)Se8k1=<3G>iz z)<5Q8T5fwu)0*uWjVo>>j9uejcIwBXP5RB94~f{X~p~qWvxA_YRPc zq^lHCuXR=9#^J8u_|uOrU6a~;cHL@j!SAxY=CI0;uTtuqOa6!}rryv8-{e!MER?A_ zvD#cy;Eq}+)&y@UX&4&PfYm|J;=_Jd!$oV9fDk82FHsDlgNuFbF={NQJrK6v;f z-BaYj1^bhpjPQ?8)pf&K>t|6lN^DR3QvGS7G9 zaI~Lz%=Y!St5FC5+cmy(|39I2z(*5c^X}3A!tTMip~0~-scgamEW&O*Pco59^NzAC zB*Y^qbp7DDsyDR6N>Lk?q1hFb{tI1-UQfGrDGk*62aW(z%o_YU5qG0A&6nnNWDDu^ zzMTq6NYfSS4p9Cxz|nqj>9jHt&C&jaqrG|!0ogo03>G|oQ^Rx&m8v_tyQEIrZ)Y`8 z^v5vgxf%1MWF$wgxR=U2iSS_k1TMd2iroHiC#G36;SGWFM z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KbX1S>`v*+Siy5um&!^T+V*6hZs?Gh zkT!ImR;0h*QJC;VZ-7ixKC;A{asBaJ?v}}=FMW)Nq8Ta>az&HTbliE4&ls1itF`b= z6;2y~+k!3ZIw)q-sSbu3(eih7mXFv*D2JQ!R-2mpwpTc8^pp%`uc^h`mBNLD({v~> znUaO=+^_99$C}uV(gq7x(H)-y`eI-XqJAp5=LqmMZP9 z<PELXi{IHn(Q+Qu^}^vVHY$B~-JcJXdrSsSGIz+)`BybZW}5KvVJ($(UQm z`Z4$~C@ZO)>PD*)eH1>#vPlYP7RQDV@^SHUP)H2@DuF0xK8!AN&HIEviB3Hed5CI% z9!?+B+WdRe@p##vxegZ!;Z7xL&w z6Pu0d_Qk5wFVUjul<&ZqcclrR<|KpGeb9R-~wI> z<@Z-|Al8_3CF%E#IZF?jV|~ifha{>`z(p;k2f-Esp+oX@FPpnN2jYfunm%6isJ`gM z+5f}TJyEG5@Fv`Vgf5FRT|%y$X=oz0Qq*5`46}Tk(P|QRVXb zP`WB>`x@>uSm!cHuQGa@YlotBMbmSdxZh{MeUmXz6$!a02g4vzKF8#xx$~OUDgC=G zJb+mg1#av2N0#?bY&{^Og7QN=Lu|czICZz9SV#b~cL$$oD|dLFd-v`o(O<9vIZ%@5 zrF~=*tyGxZWEP^_xqD<;udVPk*TIc;SD(^GH7O@7TsVS`RFeIW?|%3ay^qVsf~HN= zV6TwE+v;YmqS>+kRnePua3|TjOy9IX{@KNlR4}}((?H7SJnkJe%j8SDoJp+85WSlM8BQ*C(pi^VE%(9vKuI0}4t*AQi05+v3CAKV1Mco-GE4O24Q_ApgJ9WMtpD@x@`dREL$St7i7Of!0e5qNw=)==gvC{!gC% zj}HGw2UM^8|49yNdp=RB;M&{{L false, 'debug' => true ]); - -$cont = new \App\controleur\FrontControleur(); \ No newline at end of file +$twig->addExtension(new \Twig\Extension\DebugExtension()); +$cont = new \App\controleur\FrontControleur(); +//end session \ No newline at end of file diff --git a/php/src/controleur/FrontControleur.php b/php/src/controleur/FrontControleur.php index 0fe94ad..791f1f5 100755 --- a/php/src/controleur/FrontControleur.php +++ b/php/src/controleur/FrontControleur.php @@ -16,7 +16,7 @@ class FrontControleur //TODO ], "Membre" => [ - "deconnexion","proposerOffre","consulterProfil","modifierProfil","signaler" + "deconnection","proposerOffre","consulterProfil","modifierProfil","signaler", ], "Utilisateur" => [ "connection", "inscription", "accueil","consulterProfilLimite" @@ -41,10 +41,11 @@ class FrontControleur } } else if(in_array($action,$actions['Membre'])) { - if (!isset($_SESSION["login"])) { + if (!isset($_SESSION["utilisateur"])) { $dVueErreur[] = 'Veuillez vous connecter'; echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]); } else{ + echo "controlleur membre instancié"; new MembreControleur(); } }else{ diff --git a/php/src/controleur/MembreControleur.php b/php/src/controleur/MembreControleur.php index c0b83ff..f73641d 100755 --- a/php/src/controleur/MembreControleur.php +++ b/php/src/controleur/MembreControleur.php @@ -12,8 +12,8 @@ class MembreControleur extends UtilisateurControleur $action = \App\config\Validation::nettoyerString($_REQUEST["action"]); } switch ($action) { - case "deconnexion": - $this->deconnexion(); + case "deconnection": + $this->deconnection(); break; case "proposerOffre": $this->proposerOffre(); @@ -32,9 +32,11 @@ class MembreControleur extends UtilisateurControleur } } - protected function deconnexion() + protected function deconnection() { - //TODO + session_destroy(); + header('Location: index.php?action=accueil'); + exit(); } protected function proposerOffre() diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index 5df7d7d..2bf0eea 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -28,7 +28,7 @@ class UtilisateurControleur $this->consulterProfilLimite(); break; default: - $dVueErreur[] ="Action inconnue ou non autorisée"; + $dVueErreur[] ="Action rjhghuiergiuhou non autorisée"; echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]); } @@ -89,9 +89,17 @@ class UtilisateurControleur protected function accueil() { global $twig; - echo $twig->render('accueil.html', []); + // Ajout d'un var_dump pour déboguer + if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof \App\metier\Alumni) { + $pseudo = $_SESSION['utilisateur']->getEmail(); // ou getPseudo() si la méthode existe + } else { + $pseudo = null; + } + + echo $twig->render('accueil.html', ['pseudo' => $pseudo]); } + protected function consulterProfilLimite() { //TODO diff --git a/php/src/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php index 9f140bc..59b9033 100644 --- a/php/src/gateway/AlumniGateway.php +++ b/php/src/gateway/AlumniGateway.php @@ -69,6 +69,12 @@ class AlumniGateway ':e' => array($email, PDO::PARAM_STR), )); $res=$this->con->getResults(); + var_dump($res); + if(count($res)==0){ + echo "Aucun utilisateur trouvé"; + return null; + } + echo "Utilisateur trouvé"; return new \App\metier\Alumni($res[0]['mail'],$res[0]['mdp'],$res[0]['role']); } diff --git a/php/src/modele/UtilisateurModele.php b/php/src/modele/UtilisateurModele.php index e11d866..b4f7cff 100755 --- a/php/src/modele/UtilisateurModele.php +++ b/php/src/modele/UtilisateurModele.php @@ -18,7 +18,7 @@ class UtilisateurModele * @param string hash * @return \App\metier\Alumni */ - public function connection(string $email, string $hash) : \App\metier\Alumni + public function connection(string $email, string $hash) : ? \App\metier\Alumni { $dsn = "mysql:host=localhost;dbname=dbAlica"; $username = "Dev"; @@ -32,14 +32,15 @@ class UtilisateurModele // L'utilisateur existe, vérifiez le mot de passe if ($hash==$utilisateur->getPassword()) { // Le mot de passe est correct, retournez l'utilisateur + session_start(); return $utilisateur; } else { // Le mot de passe est incorrect, renvoyez null - return new \App\metier\Alumni(null, null, null); + return null; } } else { // L'utilisateur n'existe pas, renvoyez null - return new \App\metier\Alumni(null, null, null); + return null; } } @@ -56,7 +57,7 @@ class UtilisateurModele $username = "Dev"; $password = "Dev"; - $role = "Utilisateur"; + $role = "Membre"; $con = new \App\gateway\Connection($dsn, $username, $password); $gate = new \App\gateway\AlumniGateway($con); // Insérez le nouvel utilisateur dans la base de données en utilisant AlumniGateway diff --git a/php/templates/accueil.html b/php/templates/accueil.html index 18b3aa3..87ab6bb 100755 --- a/php/templates/accueil.html +++ b/php/templates/accueil.html @@ -9,9 +9,16 @@ +

+ {% include 'menu.html' %} +

Accueil

-

Bienvenue {{session.mail}}

+

{% if pseudo %} + Bienvenue, {{ pseudo }}! + {% else %} + Bienvenue, invité! + {% endif %}

Vous êtes sur la page d'accueil

Vous pouvez vous connecter ou vous inscrire

Vous pouvez aussi consulter les articles

diff --git a/php/templates/menu.html b/php/templates/menu.html new file mode 100644 index 0000000..603ceea --- /dev/null +++ b/php/templates/menu.html @@ -0,0 +1,37 @@ + + + + + + +
+ \ No newline at end of file From 206e3ef580ab0e63afe1e1e854bb7449e7c722e8 Mon Sep 17 00:00:00 2001 From: Leo Tuaillon Date: Sun, 12 Nov 2023 15:53:27 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Inscription=20Connexion=20et=20deconnexion?= =?UTF-8?q?=20fonctionnelles=20avec=20cr=C3=A9ation=20du=20profil=20associ?= =?UTF-8?q?=C3=A9=20lors=20de=20l'inscription?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/alica.iml | 4 +- php/public/css/inscription_success.css | 102 +++++++++++++++++++ php/public/index.php | 2 +- php/src/controleur/UtilisateurControleur.php | 33 ++++-- php/src/gateway/AlumniGateway.php | 25 +++-- php/src/gateway/ProfilGateway.php | 26 +++++ php/src/metier/Alumni.php | 20 +++- php/src/metier/Profil.php | 28 ++--- php/src/modele/UtilisateurModele.php | 15 ++- php/templates/accueil.html | 25 +++-- php/templates/connection.html | 14 +++ php/templates/inscription.html | 38 ++++++- php/templates/inscription_success.html | 24 +++++ 13 files changed, 296 insertions(+), 60 deletions(-) mode change 100755 => 100644 .idea/alica.iml create mode 100644 php/public/css/inscription_success.css create mode 100644 php/src/gateway/ProfilGateway.php create mode 100644 php/templates/inscription_success.html diff --git a/.idea/alica.iml b/.idea/alica.iml old mode 100755 new mode 100644 index 9a8e33d..816484e --- a/.idea/alica.iml +++ b/.idea/alica.iml @@ -2,9 +2,7 @@ - - - + diff --git a/php/public/css/inscription_success.css b/php/public/css/inscription_success.css new file mode 100644 index 0000000..86fa52c --- /dev/null +++ b/php/public/css/inscription_success.css @@ -0,0 +1,102 @@ +.three-body { + --uib-size: 500px; + --uib-speed: 0.8s; + --uib-color: #00DBFF; + position: relative; + display: inline-block; + height: var(--uib-size); + width: var(--uib-size); + animation: spin78236 calc(var(--uib-speed) * 2.5) infinite linear; +} + +.three-body__dot { + position: absolute; + height: 100%; + width: 30%; +} + +.three-body__dot:after { + content: ''; + position: absolute; + height: 0; + width: 100%; + padding-bottom: 100%; + background-color: var(--uib-color); + border-radius: 50%; +} + +.three-body__dot:nth-child(1) { + bottom: 5%; + left: 0; + transform: rotate(60deg); + transform-origin: 50% 85%; +} + +.three-body__dot:nth-child(1)::after { + bottom: 0; + left: 0; + animation: wobble1 var(--uib-speed) infinite ease-in-out; + animation-delay: calc(var(--uib-speed) * -0.3); +} + +.three-body__dot:nth-child(2) { + bottom: 5%; + right: 0; + transform: rotate(-60deg); + transform-origin: 50% 85%; +} + +.three-body__dot:nth-child(2)::after { + bottom: 0; + left: 0; + animation: wobble1 var(--uib-speed) infinite + calc(var(--uib-speed) * -0.15) ease-in-out; +} + +.three-body__dot:nth-child(3) { + bottom: -5%; + left: 0; + transform: translateX(116.666%); +} + +.three-body__dot:nth-child(3)::after { + top: 0; + left: 0; + animation: wobble2 var(--uib-speed) infinite ease-in-out; +} + +@keyframes spin78236 { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +@keyframes wobble1 { + 0%, + 100% { + transform: translateY(0%) scale(1); + opacity: 1; + } + + 50% { + transform: translateY(-66%) scale(0.65); + opacity: 0.8; + } +} + +@keyframes wobble2 { + 0%, + 100% { + transform: translateY(0%) scale(1); + opacity: 1; + } + + 50% { + transform: translateY(66%) scale(0.65); + opacity: 0.8; + } +} diff --git a/php/public/index.php b/php/public/index.php index 6158841..d0ad525 100755 --- a/php/public/index.php +++ b/php/public/index.php @@ -1,4 +1,4 @@ -accueil(); break; + case "inscription_success": + $this->inscription_success(); + break; case "connection": $this->connection(); break; @@ -28,7 +31,7 @@ class UtilisateurControleur $this->consulterProfilLimite(); break; default: - $dVueErreur[] ="Action rjhghuiergiuhou non autorisée"; + $dVueErreur[] ="Action non autorisée"; echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]); } @@ -59,22 +62,24 @@ class UtilisateurControleur { global $twig; $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant + $userModel = new \App\modele\UtilisateurModele(); - if (isset($_POST['email'], $_POST['username'], $_POST['password'])) { + if (isset($_POST['firstname'],$_POST['name'], $_POST['email'], $_POST['password'])) { + $nom = \App\config\Validation::nettoyerString($_POST['name']); + $prenom = \App\config\Validation::nettoyerString($_POST['firstname']); $email = \App\config\Validation::nettoyerString($_POST['email']); $motDePasse = \App\config\Validation::nettoyerString($_POST['password']); + // verification que l'email est valide et unique : if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { - $dVueErreur[] = "L'adresse email n'est pas valide."; + $dVueErreur[] = "L'adresse email n'est pas valide ou est déjà utilisée."; } else { - $userModel = new \App\modele\UtilisateurModele(); $utilisateur = $userModel->getUtilisateurByEmail($email); if ($utilisateur instanceof \App\metier\Alumni) { $dVueErreur[] = "L'adresse email est déjà utilisée."; } } - $userModel = new \App\modele\UtilisateurModele(); - $nouvelUtilisateur = $userModel->inscription($email, $motDePasse); + $nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $motDePasse); if ($nouvelUtilisateur instanceof \App\metier\Alumni) { header('Location: index.php?action=inscription_success'); @@ -91,15 +96,21 @@ class UtilisateurControleur global $twig; // Ajout d'un var_dump pour déboguer if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof \App\metier\Alumni) { - $pseudo = $_SESSION['utilisateur']->getEmail(); // ou getPseudo() si la méthode existe + $prenom = $_SESSION['utilisateur']->getPrenom(); + $nom = $_SESSION['utilisateur']->getNom(); } else { - $pseudo = null; + $prenom = "Utilisateur"; + $nom = "inconnu"; } - - echo $twig->render('accueil.html', ['pseudo' => $pseudo]); + //aller sur la page d'accueil avec le nom et prenom de l'utilisateur + echo $twig->render('accueil.html', ['prenom' => $prenom, 'nom' => $nom]); } - + protected function inscription_success() + { + global $twig; + echo $twig->render('inscription_success.html'); + } protected function consulterProfilLimite() { //TODO diff --git a/php/src/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php index 59b9033..dbc4dee 100644 --- a/php/src/gateway/AlumniGateway.php +++ b/php/src/gateway/AlumniGateway.php @@ -64,20 +64,21 @@ class AlumniGateway } public function findByEmail(string $email){ - $query='SELECT * FROM Alumni WHERE mail=:e'; + $query = 'SELECT Alumni.mail, Alumni.mdp, Alumni.role, Profil.nom, Profil.prenom + FROM Alumni + LEFT JOIN Profil ON Alumni.id = Profil.alumni + WHERE Alumni.mail = :e'; $this->con->executeQuery($query, array( ':e' => array($email, PDO::PARAM_STR), )); - $res=$this->con->getResults(); - var_dump($res); - if(count($res)==0){ - echo "Aucun utilisateur trouvé"; + $res = $this->con->getResults(); + if (count($res) == 0) { return null; } - echo "Utilisateur trouvé"; - return new \App\metier\Alumni($res[0]['mail'],$res[0]['mdp'],$res[0]['role']); + return new \App\metier\Alumni($res[0]['mail'], $res[0]['mdp'], $res[0]['role'], $res[0]['nom'], $res[0]['prenom']); } + public function getAll(){ $query='SELECT * FROM Alumni'; $this->con->executeQuery($query); @@ -88,4 +89,14 @@ class AlumniGateway } return $array; } + + public function getID(string $email) + { + $query = 'SELECT id FROM Alumni WHERE mail=:e'; + $this->con->executeQuery($query, array( + ':e' => array($email, PDO::PARAM_STR), + )); + $res = $this->con->getResults(); + return $res[0]['id']; + } } \ No newline at end of file diff --git a/php/src/gateway/ProfilGateway.php b/php/src/gateway/ProfilGateway.php new file mode 100644 index 0000000..abee520 --- /dev/null +++ b/php/src/gateway/ProfilGateway.php @@ -0,0 +1,26 @@ +con = $con; + } + + public function insert(int $alumni,string $nom, string $prenom, string $email) + { + $query = 'INSERT INTO Profil (alumni,nom, prenom,email) VALUES (:alumni,:nom, :prenom,:email)'; + return $this->con->executeQuery($query, array( + ':alumni' => array($alumni, PDO::PARAM_INT), + ':nom' => array($nom, PDO::PARAM_STR), + ':prenom' => array($prenom, PDO::PARAM_STR), + ':email' => array($email, PDO::PARAM_STR) + )); + } +} \ No newline at end of file diff --git a/php/src/metier/Alumni.php b/php/src/metier/Alumni.php index d1ac2fe..3f25d43 100644 --- a/php/src/metier/Alumni.php +++ b/php/src/metier/Alumni.php @@ -18,16 +18,20 @@ class Alumni{ */ private String $role; + private Profil $profil; + /** * @param string $email * @param string $motDePasse * @param String $role + * @param Profil $profil */ - public function __construct(string $email, string $motDePasse, String $role) + public function __construct(string $email, string $motDePasse, String $role, string $nom, string $prenom) { $this->email = $email; $this->motDePasse = $motDePasse; $this->role = $role; + $this->profil = new Profil($nom, $prenom, $email, "","", "", ""); } /** @@ -38,6 +42,10 @@ class Alumni{ return $this->email; } + public function getProfil() : Profil + { + return $this->profil; + } /** * @return string */ @@ -55,4 +63,14 @@ class Alumni{ { return $this->motDePasse; } + + public function getPrenom() + { + return $this->profil->getPrenom(); + } + + public function getNom() + { + return $this->profil->getNom(); + } } \ No newline at end of file diff --git a/php/src/metier/Profil.php b/php/src/metier/Profil.php index cee762c..8fef2ee 100644 --- a/php/src/metier/Profil.php +++ b/php/src/metier/Profil.php @@ -8,10 +8,6 @@ class Profil */ private int $id; - /** - * @var Alumni Compte - */ - private Alumni $alumni; /** * @var string CV @@ -28,6 +24,7 @@ class Profil */ private string $prenom; + private string $email; /** * @var string Url linkedin */ @@ -44,8 +41,6 @@ class Profil private string $portfolioUrl; /** - * @param int $id - * @param Alumni $alumni * @param string $cv * @param string $nom * @param string $prenom @@ -53,27 +48,18 @@ class Profil * @param string $githubUrl * @param string $portfolioUrl */ - public function __construct(int $id, Alumni $alumni, string $cv, string $nom, string $prenom, string $linkedinUrl, string $githubUrl, string $portfolioUrl) + public function __construct(string $nom, string $prenom, string $email, string $cv, string $linkedinUrl, string $githubUrl, string $portfolioUrl) { - $this->id = $id; - $this->alumni = $alumni; - $this->cv = $cv; + $this->nom = $nom; $this->prenom = $prenom; + $this->email = $email; + $this->cv = $cv; $this->linkedinUrl = $linkedinUrl; $this->githubUrl = $githubUrl; $this->portfolioUrl = $portfolioUrl; } - public function getId(): int - { - return $this->id; - } - - public function getAlumni(): Alumni - { - return $this->alumni; - } public function getCv(): string { @@ -100,6 +86,10 @@ class Profil return $this->githubUrl; } + public function getEmail(): string + { + return $this->email; + } public function getPortfolioUrl(): string { return $this->portfolioUrl; diff --git a/php/src/modele/UtilisateurModele.php b/php/src/modele/UtilisateurModele.php index b4f7cff..9d2fd1d 100755 --- a/php/src/modele/UtilisateurModele.php +++ b/php/src/modele/UtilisateurModele.php @@ -51,7 +51,7 @@ class UtilisateurModele * @param string $pseudo * @return \Alumni chargé */ - public function inscription(string $email, string $hashpassword): \App\metier\Alumni + public function inscription(string $prenom, string $nom,string $email, string $hashpassword):? \App\metier\Alumni { $dsn = "mysql:host=localhost;dbname=dbAlica"; $username = "Dev"; @@ -60,14 +60,19 @@ class UtilisateurModele $role = "Membre"; $con = new \App\gateway\Connection($dsn, $username, $password); $gate = new \App\gateway\AlumniGateway($con); + $profilGate = new \App\gateway\ProfilGateway($con); // Insérez le nouvel utilisateur dans la base de données en utilisant AlumniGateway if ($gate->insert($email, $hashpassword, $role)) { - // L'insertion a réussi, retournez le nouvel utilisateur - $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role); - return $nouvelUtilisateur; + $alumni = $gate->getID($email); + if($profilGate->insert($alumni,$nom, $prenom,$email)){ + // L'insertion a réussi, retournez le nouvel utilisateur + $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role,$nom,$prenom); + return $nouvelUtilisateur; + } + return null; } else { // L'insertion a échoué, renvoyez un utilisateur vide pour indiquer l'échec - return new \App\metier\Alumni(null, null, null); + return null; } } diff --git a/php/templates/accueil.html b/php/templates/accueil.html index 87ab6bb..6994331 100755 --- a/php/templates/accueil.html +++ b/php/templates/accueil.html @@ -14,19 +14,26 @@

Accueil

-

{% if pseudo %} - Bienvenue, {{ pseudo }}! +

{% if prenom and nom %} + Bienvenue, {{ prenom }} {{ nom }}! {% else %} Bienvenue, invité! {% endif %}

Vous êtes sur la page d'accueil

-

Vous pouvez vous connecter ou vous inscrire

-

Vous pouvez aussi consulter les articles

-

Vous pouvez aussi consulter les annonces

-

Connexion :

-
- -
+ {% if dVueErreur is not empty %} +
+
+
+
    + {% for erreur in dVueErreur %} +
  • {{ erreur }}
  • + {% endfor %} +
+
+
+
+ {% endif %} + diff --git a/php/templates/connection.html b/php/templates/connection.html index 5d90cbe..20bc8d3 100755 --- a/php/templates/connection.html +++ b/php/templates/connection.html @@ -35,6 +35,7 @@
+
@@ -42,6 +43,19 @@
+ {% if dVueErreur is not empty %} +
+
+
+
    + {% for erreur in dVueErreur %} +
  • {{ erreur }}
  • + {% endfor %} +
+
+
+
+ {% endif %} diff --git a/php/templates/inscription.html b/php/templates/inscription.html index b86bcea..a22ee4b 100755 --- a/php/templates/inscription.html +++ b/php/templates/inscription.html @@ -11,12 +11,25 @@

S'inscrire

- Identifiant + Prénom :
- + +
+
+
+ Nom : +
+
+ +
+
@@ -25,7 +38,9 @@
- +
@@ -34,7 +49,9 @@
- +
@@ -50,6 +67,19 @@
+ {% if dVueErreur is not empty %} +
+
+
+
    + {% for erreur in dVueErreur %} +
  • {{ erreur }}
  • + {% endfor %} +
+
+
+
+ {% endif %} diff --git a/php/templates/inscription_success.html b/php/templates/inscription_success.html new file mode 100644 index 0000000..3e1f2b3 --- /dev/null +++ b/php/templates/inscription_success.html @@ -0,0 +1,24 @@ + + + + + Success + + + +

Inscription effectuée avec succès, vous pouvez désormais vous connecter

+

Vous allez être redirigé vers la page de connexion dans 5 secondes

+
+
+
+
+
+ + + + + \ No newline at end of file From d9ea1e83b738aadbb96bd0b330e696e4d313b500 Mon Sep 17 00:00:00 2001 From: Leo Tuaillon Date: Wed, 15 Nov 2023 12:58:35 +0100 Subject: [PATCH 4/4] password hash --- php/src/controleur/FrontControleur.php | 5 ++--- php/src/controleur/MembreControleur.php | 6 +++--- php/src/controleur/UtilisateurControleur.php | 12 +++++++----- php/src/modele/UtilisateurModele.php | 4 ++-- php/templates/menu.html | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/php/src/controleur/FrontControleur.php b/php/src/controleur/FrontControleur.php index 791f1f5..58b83e8 100755 --- a/php/src/controleur/FrontControleur.php +++ b/php/src/controleur/FrontControleur.php @@ -16,10 +16,10 @@ class FrontControleur //TODO ], "Membre" => [ - "deconnection","proposerOffre","consulterProfil","modifierProfil","signaler", + "deconnexion","proposerOffre","consulterProfil","modifierProfil","signaler", ], "Utilisateur" => [ - "connection", "inscription", "accueil","consulterProfilLimite" + "connexion", "inscription", "accueil","consulterProfilLimite" ] ); @@ -45,7 +45,6 @@ class FrontControleur $dVueErreur[] = 'Veuillez vous connecter'; echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]); } else{ - echo "controlleur membre instancié"; new MembreControleur(); } }else{ diff --git a/php/src/controleur/MembreControleur.php b/php/src/controleur/MembreControleur.php index f73641d..151c410 100755 --- a/php/src/controleur/MembreControleur.php +++ b/php/src/controleur/MembreControleur.php @@ -12,8 +12,8 @@ class MembreControleur extends UtilisateurControleur $action = \App\config\Validation::nettoyerString($_REQUEST["action"]); } switch ($action) { - case "deconnection": - $this->deconnection(); + case "deconnexion": + $this->deconnexion(); break; case "proposerOffre": $this->proposerOffre(); @@ -32,7 +32,7 @@ class MembreControleur extends UtilisateurControleur } } - protected function deconnection() + protected function deconnexion() { session_destroy(); header('Location: index.php?action=accueil'); diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index 5ca0ff1..fceb133 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -41,11 +41,11 @@ class UtilisateurControleur { global $twig; $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant + $userModel = new \App\modele\UtilisateurModele(); if (isset($_POST['email'], $_POST['password'])) { $email = \App\config\Validation::nettoyerString($_POST['email']); $motDePasse = \App\config\Validation::nettoyerString($_POST['password']); - $userModel = new \App\modele\UtilisateurModele(); $utilisateur = $userModel->connection($email, $motDePasse); if ($utilisateur instanceof \App\metier\Alumni) { $_SESSION['utilisateur'] = $utilisateur; @@ -69,6 +69,7 @@ class UtilisateurControleur $prenom = \App\config\Validation::nettoyerString($_POST['firstname']); $email = \App\config\Validation::nettoyerString($_POST['email']); $motDePasse = \App\config\Validation::nettoyerString($_POST['password']); + $hash = password_hash($motDePasse, PASSWORD_DEFAULT); // verification que l'email est valide et unique : if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { @@ -79,7 +80,7 @@ class UtilisateurControleur $dVueErreur[] = "L'adresse email est déjà utilisée."; } } - $nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $motDePasse); + $nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $hash); if ($nouvelUtilisateur instanceof \App\metier\Alumni) { header('Location: index.php?action=inscription_success'); @@ -98,9 +99,10 @@ class UtilisateurControleur if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof \App\metier\Alumni) { $prenom = $_SESSION['utilisateur']->getPrenom(); $nom = $_SESSION['utilisateur']->getNom(); - } else { - $prenom = "Utilisateur"; - $nom = "inconnu"; + } + else{ + $prenom = null; + $nom = null; } //aller sur la page d'accueil avec le nom et prenom de l'utilisateur echo $twig->render('accueil.html', ['prenom' => $prenom, 'nom' => $nom]); diff --git a/php/src/modele/UtilisateurModele.php b/php/src/modele/UtilisateurModele.php index 9d2fd1d..e4d9a06 100755 --- a/php/src/modele/UtilisateurModele.php +++ b/php/src/modele/UtilisateurModele.php @@ -18,7 +18,7 @@ class UtilisateurModele * @param string hash * @return \App\metier\Alumni */ - public function connection(string $email, string $hash) : ? \App\metier\Alumni + public function connection(string $email, string $mdp) : ? \App\metier\Alumni { $dsn = "mysql:host=localhost;dbname=dbAlica"; $username = "Dev"; @@ -30,7 +30,7 @@ class UtilisateurModele $utilisateur = $gate->findByEmail($email); if ($utilisateur instanceof \App\metier\Alumni) { // L'utilisateur existe, vérifiez le mot de passe - if ($hash==$utilisateur->getPassword()) { + if (password_verify($mdp, $utilisateur->getPassword())) { // Le mot de passe est correct, retournez l'utilisateur session_start(); return $utilisateur; diff --git a/php/templates/menu.html b/php/templates/menu.html index 603ceea..9788900 100644 --- a/php/templates/menu.html +++ b/php/templates/menu.html @@ -23,9 +23,9 @@