X-Git-Url: https://git.rapsys.eu/userbundle/blobdiff_plain/022d0e9a32cc5b5f2475a98438b7651ab91c6ef2..be90ff0448f23198efda2b575744cd160088b94d:/Controller/DefaultController.php?ds=sidebyside 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