From df726f2d87a8dd94b8fdae19d8828572d5a1713e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sat, 28 Aug 2021 13:06:32 +0200 Subject: [PATCH] Fix reset password message display condition Remove slug reference --- Controller/DefaultController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Controller/DefaultController.php b/Controller/DefaultController.php index c431b5d..070df0c 100644 --- a/Controller/DefaultController.php +++ b/Controller/DefaultController.php @@ -183,11 +183,6 @@ class DefaultController extends AbstractController { //Add reset view $this->config['edit']['view']['context']['reset'] = $reset->createView(); - //Without admin role - //XXX: prefer a reset on login to force user unspam action - } else { - //Add notice - $this->addFlash('notice', $this->translator->trans('To change your password login with your mail and any password then follow the procedure')); } //With post method @@ -216,9 +211,14 @@ class DefaultController extends AbstractController { //Catch double slug or mail } catch (UniqueConstraintViolationException $e) { //Add error message mail already exists - $this->addFlash('error', $this->translator->trans('Account %mail% or with slug %slug% already exists', ['%mail%' => $data->getMail(), '%slug%' => $slug])); + $this->addFlash('error', $this->translator->trans('Account %mail% already exists', ['%mail%' => $data->getMail()])); } } + //Without admin role + //XXX: prefer a reset on login to force user unspam action + } elseif (!$this->isGranted('ROLE_ADMIN')) { + //Add notice + $this->addFlash('notice', $this->translator->trans('To change your password login with your mail and any password then follow the procedure')); } //Render view -- 2.41.1