diff --git a/core/authorize.php b/core/authorize.php index 6bc28085401a8a8ce9dfc447ca4eb78016dc04ed..d812f2e4857db2cb18a1aa73bcc9ed84666f731a 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -36,16 +36,6 @@ */ const MAINTENANCE_MODE = 'update'; -/** - * Renders a 403 access denied page for authorize.php. - */ -function authorize_access_denied_page() { - drupal_add_http_header('Status', '403 Forbidden'); - watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING); - drupal_set_title('Access denied'); - return t('You are not allowed to access this page.'); -} - /** * Determines if the current user is allowed to run authorize.php. * @@ -97,11 +87,11 @@ function authorize_access_allowed() { // Load the code that drives the authorize process. require_once __DIR__ . '/includes/authorize.inc'; - if (isset($_SESSION['authorize_operation']['page_title'])) { - drupal_set_title($_SESSION['authorize_operation']['page_title']); + if (isset($_SESSION['authorize_page_title'])) { + $page_title = $_SESSION['authorize_page_title']; } else { - drupal_set_title(t('Authorize file system changes')); + $page_title = t('Authorize file system changes'); } // See if we've run the operation and need to display a report. @@ -113,7 +103,7 @@ function authorize_access_allowed() { unset($_SESSION['authorize_filetransfer_info']); if (!empty($results['page_title'])) { - drupal_set_title($results['page_title']); + $page_title = $results['page_title']; } if (!empty($results['page_message'])) { drupal_set_message($results['page_message']['message'], $results['page_message']['type']); @@ -161,12 +151,18 @@ function authorize_access_allowed() { $show_messages = !(($batch = batch_get()) && isset($batch['running'])); } else { - $output = authorize_access_denied_page(); + drupal_add_http_header('Status', '403 Forbidden'); + watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING); + $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'); $maintenance_page = array( + '#page' => array( + '#title' => $page_title, + ), '#theme' => 'maintenance_page', '#content' => $output, '#show_messages' => $show_messages, diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc index 70fb4ca17bf855dd97c369acf32e8bd40564341c..238a3c6805535b9a208ac31e5e1e59eef907a402 100644 --- a/core/includes/authorize.inc +++ b/core/includes/authorize.inc @@ -290,10 +290,6 @@ function authorize_run_operation($filetransfer) { $operation = $_SESSION['authorize_operation']; unset($_SESSION['authorize_operation']); - if (!empty($operation['page_title'])) { - drupal_set_title($operation['page_title']); - } - require_once DRUPAL_ROOT . '/' . $operation['file']; call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments'])); } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 4befe46025adfaff8e0d6d89e450f7372d9ae46b..67b25fec06bc0a2cb630bb517afadfd3134346b5 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1014,7 +1014,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti ); if (isset($page_title)) { - $_SESSION['authorize_operation']['page_title'] = $page_title; + $_SESSION['authorize_page_title'] = $page_title; } } diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc index c4f3ad8edfa811a6140001fc0f1a9fb09edb636f..3bfdbcf4bcd6dff1d009f6e3953a5b9178d05305 100644 --- a/core/modules/update/update.authorize.inc +++ b/core/modules/update/update.authorize.inc @@ -237,7 +237,6 @@ function update_authorize_update_batch_finished($success, $results) { $_SESSION['authorize_results']['page_message'] = $page_message; $_SESSION['authorize_results']['messages'] = $results['log']; $_SESSION['authorize_results']['tasks'] = $results['tasks']; - $_SESSION['authorize_operation']['page_title'] = t('Update manager'); } /** @@ -296,7 +295,6 @@ function update_authorize_install_batch_finished($success, $results) { $_SESSION['authorize_results']['page_message'] = $page_message; $_SESSION['authorize_results']['messages'] = $results['log']; $_SESSION['authorize_results']['tasks'] = $results['tasks']; - $_SESSION['authorize_operation']['page_title'] = t('Update manager'); } /**