summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-01-14 21:39:55 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-01-14 21:39:55 +0100
commit31ce320c5242697b79204485f33f276fc0558a76 (patch)
tree2efac91005a17feedf70ebe4b7e4a74875bed7af
parent9eb16e06f70011d93d02e3b80e786cbd4a3dffef (diff)
downloadnextcloud-server-31ce320c5242697b79204485f33f276fc0558a76.tar.gz
nextcloud-server-31ce320c5242697b79204485f33f276fc0558a76.zip
in case of maintenance the error page returns http status 503.
This is necessary to enable the desktop sync client to react properly. Currently the SabreDAV plugin OC_Connector_Sabre_MaintenancePlugin is not executed because this error page is returned before the SabreDAV code is executed
-rw-r--r--lib/base.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 3d3e7d59f90..6e6880bc43e 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -231,6 +231,12 @@ class OC
public static function checkMaintenanceMode() {
// Allow ajax update script to execute without being stopped
if (OC_Config::getValue('maintenance', false) && OC::$SUBURI != '/core/ajax/update.php') {
+ // send http status 503
+ header('HTTP/1.1 503 Service Temporarily Unavailable');
+ header('Status: 503 Service Temporarily Unavailable');
+ header('Retry-After: 120');
+
+ // render error page
$tmpl = new OC_Template('', 'error', 'guest');
$tmpl->assign('errors', array(1 => array('error' => 'ownCloud is in maintenance mode')));
$tmpl->printPage();