From bdc491fbfa8541bdf010fd4b4c5b3ff86465a66b Mon Sep 17 00:00:00 2001 From: Illia Hromovoi Date: Thu, 3 Jul 2025 11:58:58 +0200 Subject: [PATCH] =?UTF-8?q?validation=20f=C3=BCr=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/UserController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Controller/UserController.php b/Controller/UserController.php index 3adf9f7..368b018 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -120,8 +120,13 @@ class UserController{ public function login(){ $user = $this->db->getUserByEmail($_POST["email"]); + $this->validateLoginForm(); + if(!$user){ - echo "Benutzer nicht gefunden"; + $this->loginErrors['email'] = "Email oder Passwort ist falsch"; + $this->view->setDoMethodName("showUserLoginForm"); + $this->showUserLoginForm(); + return; } $hash = hash('sha256', $_POST["password"] . $user["salt"]);