]> Raphaƫl G. Git Repositories - userbundle/blobdiff - Controller/UserController.php
Version 0.6.0
[userbundle] / Controller / UserController.php
index 22ce0f8052f5d9166f057379237fdd4bcdf7971a..c49c5de2a9fc0b2bc49ebe8dabdf4f4ad0d2714f 100644 (file)
@@ -13,13 +13,12 @@ namespace Rapsys\UserBundle\Controller;
 
 use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
 
-use Rapsys\UserBundle\RapsysUserBundle;
-
 use Symfony\Bridge\Twig\Mime\TemplatedEmail;
 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;
@@ -387,7 +386,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
@@ -545,6 +544,7 @@ class UserController extends AbstractController {
                if (!empty($_POST['register']['mail'])) {
                        //Log new user infos
                        $this->logger->emergency(
+                               //Translated register informations
                                $this->translator->trans(
                                        'register: mail=%mail% locale=%locale% confirm=%confirm% ip=%ip%',
                                        [
@@ -562,7 +562,12 @@ class UserController extends AbstractController {
                                                '%ip%' => $request->getClientIp()
                                        ],
                                        $this->alias
-                               )
+                               ),
+                               //Set context
+                               [
+                                       'file' => __FILE__,
+                                       'line' => __LINE__
+                               ]
                        );
                }