From 7a13d53e43c7db7fe39474208ffa54ba2906d308 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 24 Jun 2025 23:57:59 +0200 Subject: =?UTF-8?q?petites=20am=C3=A9liorations=20au=20syst=C3=A8me=20de?= =?UTF-8?q?=20mot=20de=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/password.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/controller/password.php') diff --git a/src/controller/password.php b/src/controller/password.php index 5573a33..62b1542 100644 --- a/src/controller/password.php +++ b/src/controller/password.php @@ -86,7 +86,7 @@ function createPassword(EntityManager $entityManager) } else { - $error = 'bad_password'; + $error = 'bad_login_or_password'; // compteur dans la session et blocage de compte } @@ -217,15 +217,6 @@ function changePassword(EntityManager $entityManager) { // fonction exécutée à priori deux fois d'affilée: affichage puis traitement de la saisie - // OUT !! - if(empty($_SESSION['user']) || !$_SESSION['admin']) - { - $_SESSION['user'] = ''; - $_SESSION['admin'] = false; - header('Location: index.php'); - die; - } - // II - traitement $error = ''; $success = false; @@ -254,6 +245,9 @@ function changePassword(EntityManager $entityManager) { $error = 'forbidden_characters'; } + elseif($login !== $_SESSION['user']){ + $error = 'bad_login_or_password'; + } else { $user = getUser($login, $entityManager); @@ -268,7 +262,7 @@ function changePassword(EntityManager $entityManager) } else { - $error = 'bad_password'; + $error = 'bad_login_or_password'; } } } -- cgit v1.2.3