summaryrefslogtreecommitdiff
path: root/modules/update
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-03 02:53:07 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-03 02:53:07 +0000
commit937575ebee4f757a7821228d565552db477fe82e (patch)
tree13bb09a8ebf06f8502c02340ebb46405f5c62c84 /modules/update
parent81f6ecd362f279a0e1c468bff68c98ea2571bd2e (diff)
downloadbrdo-937575ebee4f757a7821228d565552db477fe82e.tar.gz
brdo-937575ebee4f757a7821228d565552db477fe82e.tar.bz2
#976328 by bfroehle, dww: Fixed Update manager should not take you out of maintenance mode unless you asked it to
Diffstat (limited to 'modules/update')
-rw-r--r--modules/update/update.authorize.inc36
-rw-r--r--modules/update/update.manager.inc2
2 files changed, 25 insertions, 13 deletions
diff --git a/modules/update/update.authorize.inc b/modules/update/update.authorize.inc
index 16029568b..978fee4a4 100644
--- a/modules/update/update.authorize.inc
+++ b/modules/update/update.authorize.inc
@@ -182,7 +182,8 @@ function update_authorize_update_batch_finished($success, $results) {
// update data and recompute our status, so prevent show bogus results.
_update_authorize_clear_update_status();
- if ($offline) {
+ // Take the site out of maintenance mode if it was previously that way.
+ if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
variable_set('maintenance_mode', FALSE);
$page_message = array(
'message' => t('Update was completed successfully. Your site has been taken out of maintenance mode.'),
@@ -213,6 +214,9 @@ function update_authorize_update_batch_finished($success, $results) {
$results['tasks'][] = t('Your modules have been downloaded and updated.');
$results['tasks'][] = t('<a href="@update">Run database updates</a>', array('@update' => base_path() . 'update.php'));
+ // Unset the variable since it is no longer needed.
+ unset($_SESSION['maintenance_mode']);
+
// Set all these values into the SESSION so authorize.php can display them.
$_SESSION['authorize_results']['success'] = $success;
$_SESSION['authorize_results']['page_message'] = $page_message;
@@ -235,18 +239,21 @@ function update_authorize_install_batch_finished($success, $results) {
}
}
$offline = variable_get('maintenance_mode', FALSE);
- if ($success && $offline) {
- variable_set('maintenance_mode', FALSE);
- $page_message = array(
- 'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
- 'type' => 'status',
- );
- }
- elseif ($success && !$offline) {
- $page_message = array(
- 'message' => t('Installation was completed successfully.'),
- 'type' => 'status',
- );
+ if ($success) {
+ // Take the site out of maintenance mode if it was previously that way.
+ if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
+ variable_set('maintenance_mode', FALSE);
+ $page_message = array(
+ 'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
+ 'type' => 'status',
+ );
+ }
+ else {
+ $page_message = array(
+ 'message' => t('Installation was completed successfully.'),
+ 'type' => 'status',
+ );
+ }
}
elseif (!$success && !$offline) {
$page_message = array(
@@ -261,6 +268,9 @@ function update_authorize_install_batch_finished($success, $results) {
);
}
+ // Unset the variable since it is no longer needed.
+ unset($_SESSION['maintenance_mode']);
+
// Set all these values into the SESSION so authorize.php can display them.
$_SESSION['authorize_results']['success'] = $success;
$_SESSION['authorize_results']['page_message'] = $page_message;
diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc
index 9f0fb8cb7..4f55b1b5b 100644
--- a/modules/update/update.manager.inc
+++ b/modules/update/update.manager.inc
@@ -397,6 +397,8 @@ function update_manager_update_ready_form($form, &$form_state) {
* @see system_authorized_get_url()
*/
function update_manager_update_ready_form_submit($form, &$form_state) {
+ // Store maintenance_mode setting so we can restore it when done.
+ $_SESSION['maintenance_mode'] = variable_get('maintenance_mode', FALSE);
if ($form_state['values']['maintenance_mode'] == TRUE) {
variable_set('maintenance_mode', TRUE);
}