From 41f7eb948ad09632764cd8503dcec6c5fa6093cd Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Tue, 9 Apr 2013 20:51:43 +0200 Subject: [PATCH] Move start of the maintenance mode to the ajax call Make sure the update page is shown in a browser. And not an ajax request --- core/ajax/update.php | 3 +++ lib/base.php | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/ajax/update.php b/core/ajax/update.php index 6015a901eb..9d0c6f89f1 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -5,6 +5,8 @@ require_once '../../lib/base.php'; if (OC::checkUpgrade(false)) { \OC_DB::enableCaching(false); + OC_Config::setValue('maintenance', true); + OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, OC_Log::WARN); $updateEventSource = new OC_EventSource(); $watcher = new UpdateWatcher($updateEventSource); OC_Hook::connect('update', 'success', $watcher, 'success'); @@ -99,6 +101,7 @@ class UpdateWatcher { OC_Util::obEnd(); $this->eventSource->send('failure', $message); $this->eventSource->close(); + OC_Config::setValue('maintenance', false); die(); } diff --git a/lib/base.php b/lib/base.php index 8633ae9b63..1e4bbff49c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -282,10 +282,6 @@ class OC { $currentVersion = implode('.', OC_Util::getVersion()); if (version_compare($currentVersion, $installedVersion, '>')) { if ($showTemplate && !OC_Config::getValue('maintenance', false)) { - OC_Config::setValue('maintenance', true); - OC_Log::write('core', - 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, - OC_Log::WARN); $minimizerCSS = new OC_Minimizer_CSS(); $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS();