diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 621b4e7a..9cf71d35 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -15,6 +15,8 @@ $vues['main'] = 'View/src/pages/Main.php'; $vues['presentation'] = 'View/src/pages/Presentation.html'; $vues['login'] = 'View/src/pages/LogSign/Login.php'; $vues['signUp'] = 'View/src/pages/LogSign/SignUp.php'; +$vues['mail'] = 'View/src/pages/LogSign/Mail.php'; +$vues['confirm'] = 'View/src/pages/LogSign/Confirm.php'; $vues['test'] = 'View/src/pages/FirstTests/FirstTest1.html'; $vues['next'] = 'View/src/pages/FirstTests/FirstTest'; $vues['admin'] = 'View/src/pages/Admin/Admin.php'; diff --git a/WEB/Controller/VisitorController.php b/WEB/Controller/VisitorController.php index 2ccf3e1f..204892d2 100644 --- a/WEB/Controller/VisitorController.php +++ b/WEB/Controller/VisitorController.php @@ -28,9 +28,18 @@ class VisitorController case "goToSignUp": $this->goToSignUp(); break; + case "goToMail": + $this->goToMail(); + break; case "goToQueue": $this->goToLogin(); break; + case "sendMail": + $this->sendMail(); + break; + case "goToReset": + $this->goToReset(); + break; default: $error = "Action non valide"; require($rep . $vues['erreur']); @@ -74,6 +83,16 @@ class VisitorController require($rep . $vues['erreur']); } } + public function goToMail() + { + try { + global $rep, $vues; + require($rep . $vues['mail']); + } catch (Exception $e) { + $error = $e->getMessage(); + require($rep . $vues['erreur']); + } + } public function signUp() { try { @@ -102,4 +121,30 @@ class VisitorController require($rep . $vues['erreur']); } } + + public function sendMail() + { + $nettoyage = new Nettoyage(); + $code = 10; + $to = $nettoyage->cleanEmail($_POST['email']); + $subject = 'Reset your password'; + $message = 'Hello, you can reset your password here : http://82.165.180.114/index.php?action=goToConfirm&code='.$code; + $headers = 'From: scripted@gmail.com' . "\r\n" . + // 'Reply-To: sender@example.com' . "\r\n" . + 'X-Mailer: PHP/' . phpversion(); + + mail($to, $subject, $message, $headers); + $this->goToMail(); + } + + public function goToConfirm() + { + try { + global $rep, $vues; + require($rep . $vues['confirm']); + } catch (Exception $e) { + $error = $e->getMessage(); + require($rep . $vues['erreur']); + } + } } \ No newline at end of file diff --git a/WEB/View/src/CSS/Login.css b/WEB/View/src/CSS/Login.css index 29365aa3..66960bda 100644 --- a/WEB/View/src/CSS/Login.css +++ b/WEB/View/src/CSS/Login.css @@ -24,6 +24,10 @@ body { background-color: #000; } +a{ + text-decoration: none !important; +} + .login-box { position: absolute; top: 50%; @@ -194,4 +198,4 @@ body { 100% { bottom: 100%; } -} +} \ No newline at end of file diff --git a/WEB/View/src/pages/LogSign/Confirm.php b/WEB/View/src/pages/LogSign/Confirm.php new file mode 100644 index 00000000..0549750f --- /dev/null +++ b/WEB/View/src/pages/LogSign/Confirm.php @@ -0,0 +1,64 @@ + + + + + + + Login + + + + + + + + + + +
+
+
+
+ home +
+
+

Password + Reset

+
+
+
+
+

Your password was reset go to your mail and enter the validation code.

+
+ +
+
+ + +
+
+ +
+
+
+ Login + Sign up +
+
+
+ + + \ No newline at end of file diff --git a/WEB/View/src/pages/LogSign/Login.php b/WEB/View/src/pages/LogSign/Login.php index 986eb78b..78a1cc98 100644 --- a/WEB/View/src/pages/LogSign/Login.php +++ b/WEB/View/src/pages/LogSign/Login.php @@ -31,10 +31,13 @@ -
+
+
+ Mots de passe oucliƩe ? +
+
+ +
+ Login + Sign up +
+
+ + + + \ No newline at end of file