[Pkg-owncloud-commits] [owncloud] 52/273: Prevent loading apps in remote when an upgrade is due

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:12:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 4e43e3626e3f17435d011102d97e408e856fcabd
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Jun 25 18:17:17 2014 +0200

    Prevent loading apps in remote when an upgrade is due
---
 remote.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/remote.php b/remote.php
index 232e47e..a91742b 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list