From 146f84b08a0c76ee5c01ba259cd6f9c0cb793d63 Mon Sep 17 00:00:00 2001 From: "patrick.brugiere" Date: Mon, 20 Nov 2023 12:31:42 +0100 Subject: [PATCH] =?UTF-8?q?rajout=20d'un=20if=20pour=20g=C3=A9rer=20une=20?= =?UTF-8?q?erreur=20(logpass=20et=20logemail)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/php/controller/AbsController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 Project/php/controller/AbsController.php diff --git a/Project/php/controller/AbsController.php b/Project/php/controller/AbsController.php old mode 100644 new mode 100755 index bdca85a..324cbfe --- a/Project/php/controller/AbsController.php +++ b/Project/php/controller/AbsController.php @@ -139,8 +139,11 @@ class AbsController public function confirmLogin(): void { $model = new MdlStudent(); - $login = strip_tags($_POST['logemail']); - $password = strip_tags($_POST['logpass']); + if($_POST['logemail']!=null && $_POST['logpass']!=null) { + $login = strip_tags($_POST['logemail']); + $password = strip_tags($_POST['logpass']); + } + else throw new Exception("logmail ou logpass null"); if (!$this->checkLoginExist($login)) throw new Exception(("login invalide")); $user = $model->connection($login, $password); if ($user == null) throw new Exception("mot de passe invalide");