From 1daa96a57d40345da2abb387de685735929782ba Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 12 Sep 2013 17:13:52 +0200 Subject: [PATCH] call display403 method --- core/lib/Thelia/Action/HttpException.php | 5 +++++ core/lib/Thelia/Controller/Front/AddressController.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Action/HttpException.php b/core/lib/Thelia/Action/HttpException.php index 9cb9fab13..9beadeb7b 100755 --- a/core/lib/Thelia/Action/HttpException.php +++ b/core/lib/Thelia/Action/HttpException.php @@ -26,6 +26,7 @@ namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\KernelEvents; use Thelia\Model\ConfigQuery; @@ -43,6 +44,10 @@ class HttpException extends BaseAction implements EventSubscriberInterface if ($event->getException() instanceof NotFoundHttpException) { $this->display404($event); } + + if($event->getException() instanceof AccessDeniedHttpException) { + $this->display403($event); + } } protected function display404(GetResponseForExceptionEvent $event) diff --git a/core/lib/Thelia/Controller/Front/AddressController.php b/core/lib/Thelia/Controller/Front/AddressController.php index 5f3fb4799..64c2bab3b 100644 --- a/core/lib/Thelia/Controller/Front/AddressController.php +++ b/core/lib/Thelia/Controller/Front/AddressController.php @@ -47,7 +47,7 @@ class AddressController extends BaseFrontController public function generateModalAction($address_id) { if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->accessDenied(); + $this->redirect(URL::getInstance()->getIndexPage()); } $this->checkXmlHttpRequest(); @@ -63,7 +63,7 @@ class AddressController extends BaseFrontController public function createAction() { if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->accessDenied() + $this->redirect(URL::getInstance()->getIndexPage()); } $addressCreate = new AddressCreateForm($this->getRequest());