summaryrefslogtreecommitdiffstats
path: root/core/authorize.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-10-09 11:58:40 (GMT)
committerNathaniel Catchpole2014-10-09 11:58:40 (GMT)
commitb1fa3ac38cb3a1695a480f3942c009733f6e0e6e (patch)
treeedd9f39d1a624b7692de9c7211b99c6675ec6b87 /core/authorize.php
parent7476af9004b78802f7696884ae60ef55bd35449a (diff)
Issue #2184907 by JeroenT, ParisLiakos, ianthomas_uk, hussainweb, dawehner: Remove uses of drupal_add_http_header and related functions.
Diffstat (limited to 'core/authorize.php')
-rw-r--r--core/authorize.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/authorize.php b/core/authorize.php
index 0188cf8..a676ee1 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -23,6 +23,7 @@
use Drupal\Core\DrupalKernel;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Site\Settings;
use Drupal\Core\Page\DefaultHtmlPageRenderer;
@@ -71,6 +72,7 @@ drupal_maintenance_theme();
$output = '';
$show_messages = TRUE;
+$response = new Response();
if (authorize_access_allowed()) {
// Load both the Form API and Batch API.
require_once __DIR__ . '/includes/form.inc';
@@ -140,15 +142,16 @@ if (authorize_access_allowed()) {
$show_messages = !(($batch = batch_get()) && isset($batch['running']));
}
else {
- drupal_add_http_header('Status', '403 Forbidden');
+ $response->setStatusCode(403);
\Drupal::logger('access denied')->warning('authorize.php');
$page_title = t('Access denied');
$output = t('You are not allowed to access this page.');
}
if (!empty($output)) {
- drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
- print DefaultHtmlPageRenderer::renderPage($output, $page_title, 'maintenance', array(
+ $response->headers->set('Content-Type', 'text/html; charset=utf-8');
+ $response->setContent(DefaultHtmlPageRenderer::renderPage($output, $page_title, 'maintenance', array(
'#show_messages' => $show_messages,
- ));
+ )));
+ $response->send();
}