add accessDenied method
This commit is contained in:
@@ -265,6 +265,11 @@ class BaseController extends ContainerAware
|
||||
return $this->container->getParameter('kernel.debug');
|
||||
}
|
||||
|
||||
protected function accessDenied()
|
||||
{
|
||||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current http request is a XmlHttpRequest.
|
||||
*
|
||||
@@ -273,7 +278,7 @@ class BaseController extends ContainerAware
|
||||
protected function checkXmlHttpRequest()
|
||||
{
|
||||
if(false === $this->getRequest()->isXmlHttpRequest() && false === $this->isDebug()) {
|
||||
throw new AccessDeniedHttpException();
|
||||
$this->accessDenied();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,13 @@ class AddressController extends BaseFrontController
|
||||
*/
|
||||
public function generateModalAction($address_id)
|
||||
{
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->accessDenied();
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Create controller.
|
||||
@@ -57,7 +63,7 @@ class AddressController extends BaseFrontController
|
||||
public function createAction()
|
||||
{
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->redirect(URL::getInstance()->getIndexPage());
|
||||
$this->accessDenied()
|
||||
}
|
||||
|
||||
$addressCreate = new AddressCreateForm($this->getRequest());
|
||||
|
||||
Reference in New Issue
Block a user