Prevent loading apps in remote when an upgrade is due

This commit is contained in:
Vincent Petry 2014-06-25 18:17:17 +02:00
parent c6bcb07f83
commit 4e43e3626e
1 changed files with 9 additions and 0 deletions

View File

@ -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);