[Pkg-owncloud-commits] [owncloud] 59/134: Return 503 when a config/data dir error exists

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 21:44:01 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 d85d3a4493dc0e789ef3b120e6885ede7f1990a1
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Mar 14 13:58:34 2014 +0100

    Return 503 when a config/data dir error exists
    
    Backport of b619ff6 from master
---
 lib/base.php             | 1 +
 lib/private/response.php | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/lib/base.php b/lib/base.php
index e2e9de3..dba905f 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -525,6 +525,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 0474643..ecac06e 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);
 	}

-- 
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