Commit 5e46282f authored by webchick's avatar webchick

Issue #2192653 by ianthomas_uk, divesh.kumar: Remove drupal_set_title from authorize.php.

parent e93b6852
...@@ -36,16 +36,6 @@ ...@@ -36,16 +36,6 @@
*/ */
const MAINTENANCE_MODE = 'update'; 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. * Determines if the current user is allowed to run authorize.php.
* *
...@@ -97,11 +87,11 @@ function authorize_access_allowed() { ...@@ -97,11 +87,11 @@ function authorize_access_allowed() {
// Load the code that drives the authorize process. // Load the code that drives the authorize process.
require_once __DIR__ . '/includes/authorize.inc'; require_once __DIR__ . '/includes/authorize.inc';
if (isset($_SESSION['authorize_operation']['page_title'])) { if (isset($_SESSION['authorize_page_title'])) {
drupal_set_title($_SESSION['authorize_operation']['page_title']); $page_title = $_SESSION['authorize_page_title'];
} }
else { 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. // See if we've run the operation and need to display a report.
...@@ -113,7 +103,7 @@ function authorize_access_allowed() { ...@@ -113,7 +103,7 @@ function authorize_access_allowed() {
unset($_SESSION['authorize_filetransfer_info']); unset($_SESSION['authorize_filetransfer_info']);
if (!empty($results['page_title'])) { if (!empty($results['page_title'])) {
drupal_set_title($results['page_title']); $page_title = $results['page_title'];
} }
if (!empty($results['page_message'])) { if (!empty($results['page_message'])) {
drupal_set_message($results['page_message']['message'], $results['page_message']['type']); drupal_set_message($results['page_message']['message'], $results['page_message']['type']);
...@@ -161,12 +151,18 @@ function authorize_access_allowed() { ...@@ -161,12 +151,18 @@ function authorize_access_allowed() {
$show_messages = !(($batch = batch_get()) && isset($batch['running'])); $show_messages = !(($batch = batch_get()) && isset($batch['running']));
} }
else { 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)) { if (!empty($output)) {
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
$maintenance_page = array( $maintenance_page = array(
'#page' => array(
'#title' => $page_title,
),
'#theme' => 'maintenance_page', '#theme' => 'maintenance_page',
'#content' => $output, '#content' => $output,
'#show_messages' => $show_messages, '#show_messages' => $show_messages,
......
...@@ -290,10 +290,6 @@ function authorize_run_operation($filetransfer) { ...@@ -290,10 +290,6 @@ function authorize_run_operation($filetransfer) {
$operation = $_SESSION['authorize_operation']; $operation = $_SESSION['authorize_operation'];
unset($_SESSION['authorize_operation']); unset($_SESSION['authorize_operation']);
if (!empty($operation['page_title'])) {
drupal_set_title($operation['page_title']);
}
require_once DRUPAL_ROOT . '/' . $operation['file']; require_once DRUPAL_ROOT . '/' . $operation['file'];
call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments'])); call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments']));
} }
......
...@@ -1014,7 +1014,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti ...@@ -1014,7 +1014,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
); );
if (isset($page_title)) { if (isset($page_title)) {
$_SESSION['authorize_operation']['page_title'] = $page_title; $_SESSION['authorize_page_title'] = $page_title;
} }
} }
......
...@@ -237,7 +237,6 @@ function update_authorize_update_batch_finished($success, $results) { ...@@ -237,7 +237,6 @@ function update_authorize_update_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message; $_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log']; $_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks']; $_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) { ...@@ -296,7 +295,6 @@ function update_authorize_install_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message; $_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log']; $_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks']; $_SESSION['authorize_results']['tasks'] = $results['tasks'];
$_SESSION['authorize_operation']['page_title'] = t('Update manager');
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment