summaryrefslogtreecommitdiff
path: root/src/controller/password.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/password.php')
-rw-r--r--src/controller/password.php16
1 files changed, 5 insertions, 11 deletions
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)
86 } 86 }
87 else 87 else
88 { 88 {
89 $error = 'bad_password'; 89 $error = 'bad_login_or_password';
90 90
91 // compteur dans la session et blocage de compte 91 // compteur dans la session et blocage de compte
92 } 92 }
@@ -217,15 +217,6 @@ function changePassword(EntityManager $entityManager)
217{ 217{
218 // fonction exécutée à priori deux fois d'affilée: affichage puis traitement de la saisie 218 // fonction exécutée à priori deux fois d'affilée: affichage puis traitement de la saisie
219 219
220 // OUT !!
221 if(empty($_SESSION['user']) || !$_SESSION['admin'])
222 {
223 $_SESSION['user'] = '';
224 $_SESSION['admin'] = false;
225 header('Location: index.php');
226 die;
227 }
228
229 // II - traitement 220 // II - traitement
230 $error = ''; 221 $error = '';
231 $success = false; 222 $success = false;
@@ -254,6 +245,9 @@ function changePassword(EntityManager $entityManager)
254 { 245 {
255 $error = 'forbidden_characters'; 246 $error = 'forbidden_characters';
256 } 247 }
248 elseif($login !== $_SESSION['user']){
249 $error = 'bad_login_or_password';
250 }
257 else 251 else
258 { 252 {
259 $user = getUser($login, $entityManager); 253 $user = getUser($login, $entityManager);
@@ -268,7 +262,7 @@ function changePassword(EntityManager $entityManager)
268 } 262 }
269 else 263 else
270 { 264 {
271 $error = 'bad_password'; 265 $error = 'bad_login_or_password';
272 } 266 }
273 } 267 }
274 } 268 }