X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/aef11da75cf6e45dc253f96324905536960fdcce..c1fd8ae3e058c68975edd4d98107d72c9bb2dc53:/Security/AccessDeniedHandler.php diff --git a/Security/AccessDeniedHandler.php b/Security/AccessDeniedHandler.php deleted file mode 100644 index 5494fb0..0000000 --- a/Security/AccessDeniedHandler.php +++ /dev/null @@ -1,68 +0,0 @@ -config = $container->getParameter($this->getAlias()); - - //Set the translator - $this->translator = $translator; - - //Set the environment - $this->environment = $environment; - } - - /** - * {@inheritdoc} - */ -#use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; - #public function login(Request $request, AuthenticationUtils $authenticationUtils) { - public function handle(Request $request, AccessDeniedException $accessDeniedException) { - //Set section - $section = $this->translator->trans('Access denied'); - - //Set title - $title = $section.' - '.$this->translator->trans($this->config['site']['title']); - - //Set message - $message = $this->translator->trans($accessDeniedException->getMessage()); - - //Render template - return new Response( - $this->environment->render( - '@RapsysAir/security/denied.html.twig', - ['title' => $title, 'section' => $section, 'message' => $message] - ), - 403 - ); - } - - /** - * {@inheritdoc} - */ - public function getAlias() { - return 'rapsys_air'; - } -}