summaryrefslogtreecommitdiffstats
path: root/remote.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-25 18:17:17 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-25 18:17:17 +0200
commit4e43e3626e3f17435d011102d97e408e856fcabd (patch)
treedbe3ec6bbc45cabdb12209ac55d6d0d5711800b5 /remote.php
parentc6bcb07f8373b3a1515fc2f26872a0256ee3666d (diff)
downloadnextcloud-server-4e43e3626e3f17435d011102d97e408e856fcabd.tar.gz
nextcloud-server-4e43e3626e3f17435d011102d97e408e856fcabd.zip
Prevent loading apps in remote when an upgrade is due
Diffstat (limited to 'remote.php')
-rw-r--r--remote.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/remote.php b/remote.php
index 232e47ee402..a91742b0475 100644
--- a/remote.php
+++ b/remote.php
@@ -2,6 +2,15 @@
try {
require_once 'lib/base.php';
+
+ if (\OCP\Util::needUpgrade()) {
+ // since the behavior of apps or remotes are unpredictable during
+ // an upgrade, return a 503 directly
+ OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ OC_Template::printErrorPage('Service unavailable');
+ exit;
+ }
+
$path_info = OC_Request::getPathInfo();
if ($path_info === false || $path_info === '') {
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);