X-Git-Url: https://git.rapsys.eu/userbundle/blobdiff_plain/8ca7256d7db44ec347b2324d2fabc928a99b3d5e..refs/heads/master:/Controller/UserController.php?ds=sidebyside diff --git a/Controller/UserController.php b/Controller/UserController.php index 672f933..15da194 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -20,6 +20,7 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\HttpKernel\Exception\GoneHttpException; use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mime\Address; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -155,7 +156,7 @@ class UserController extends AbstractController { //Set civility default 'civility_default' => $this->doctrine->getRepository($this->config['class']['civility'])->findOneByTitle($this->config['default']['civility']), //Disable mail - 'mail' => $this->checker->isGranted('ROLE_ADMIN'), + 'mail' => $this->checker->isGranted('ROLE_'.strtoupper($this->config['default']['admin'])), //Disable password 'password' => false, //Set method @@ -387,7 +388,7 @@ class UserController extends AbstractController { if ($pass != $this->slugger->hash($user->getPassword())) { //Throw not found //XXX: prevent use of outdated recover link - throw $this->createNotFoundException($this->translator->trans('Outdated recover link', [], $this->alias)); + throw new GoneHttpException($this->translator->trans('Outdated recover link', [], $this->alias)); } //Set context