From 7dc270515bd6c60325a654486c088e8aab2094cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sat, 28 Aug 2021 05:14:24 +0200 Subject: [PATCH] Improve disabled 403 status code response Cleanup --- Controller/DefaultController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Controller/DefaultController.php b/Controller/DefaultController.php index c8bb8a5..7f6b02e 100644 --- a/Controller/DefaultController.php +++ b/Controller/DefaultController.php @@ -609,18 +609,21 @@ class DefaultController extends AbstractController { //With disabled existing if ($existing->isDisabled()) { //Render view - return $this->render( + $response = $this->render( //Template $this->config['register']['view']['name'], //Context - ['title' => $this->translator->trans('Access denied'), 'disabled' => 1]+$this->config['register']['view']['context'], - //Set 403 - new Response('', 403) + ['title' => $this->translator->trans('Access denied'), 'disabled' => 1]+$this->config['register']['view']['context'] ); + + //Set 403 + $response->setStatusCode(403); + + //Return response + return $response; //With unactivated existing } elseif (!$existing->isActivated()) { //Set mail shortcut - //TODO: change for activate ??? $activateMail =& $this->config['register']['mail']; //Generate each route route -- 2.41.1