summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-14 13:58:34 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-14 21:05:15 +0100
commitb619ff6076f200e2aee62758e1e3ea95df1c4a63 (patch)
tree0c9e65a7f86018c2aa998d4ea488c6d97ec9f330
parent3c46dcd7ddde403cdc89abdaabd3879fc71d39b9 (diff)
downloadnextcloud-server-b619ff6076f200e2aee62758e1e3ea95df1c4a63.tar.gz
nextcloud-server-b619ff6076f200e2aee62758e1e3ea95df1c4a63.zip
Return 503 when a config/data dir error exists
-rw-r--r--lib/base.php1
-rw-r--r--lib/private/response.php4
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 86ee5349828..5f15189b118 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -536,6 +536,7 @@ class OC {
echo $error['hint'] . "\n\n";
}
} else {
+ OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printGuestPage('', 'error', array('errors' => $errors));
}
exit;
diff --git a/lib/private/response.php b/lib/private/response.php
index 71c538fb311..983c682bf3f 100644
--- a/lib/private/response.php
+++ b/lib/private/response.php
@@ -12,6 +12,7 @@ class OC_Response {
const STATUS_TEMPORARY_REDIRECT = 307;
const STATUS_NOT_FOUND = 404;
const STATUS_INTERNAL_SERVER_ERROR = 500;
+ const STATUS_SERVICE_UNAVAILABLE = 503;
/**
* @brief Enable response caching by sending correct HTTP headers
@@ -74,6 +75,9 @@ class OC_Response {
case self::STATUS_INTERNAL_SERVER_ERROR;
$status = $status . ' Internal Server Error';
break;
+ case self::STATUS_SERVICE_UNAVAILABLE;
+ $status = $status . ' Service Unavailable';
+ break;
}
header($protocol.' '.$status);
}