Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-14 16:58:34 +0400
committerVincent Petry <pvince81@owncloud.com>2014-03-15 00:05:15 +0400
commitb619ff6076f200e2aee62758e1e3ea95df1c4a63 (patch)
tree0c9e65a7f86018c2aa998d4ea488c6d97ec9f330 /lib
parent3c46dcd7ddde403cdc89abdaabd3879fc71d39b9 (diff)
Return 503 when a config/data dir error exists
Diffstat (limited to 'lib')
-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);
}