diff --git a/code/DevCheckController.php b/code/DevCheckController.php index caadb15..1782257 100644 --- a/code/DevCheckController.php +++ b/code/DevCheckController.php @@ -1,9 +1,14 @@ init(); + $e->init('ADMIN'); //check for admin permissions before running this check return $e; } } diff --git a/code/DevHealthController.php b/code/DevHealthController.php index 157e4ea..6ef31bd 100644 --- a/code/DevHealthController.php +++ b/code/DevHealthController.php @@ -1,9 +1,14 @@ init(); + $e->init(''); //empty permission check, the "health" check does not require a permission check to run $e->setErrorCode(404); return $e; } diff --git a/code/EnvironmentChecker.php b/code/EnvironmentChecker.php index 6c52f51..3ec749c 100644 --- a/code/EnvironmentChecker.php +++ b/code/EnvironmentChecker.php @@ -28,19 +28,20 @@ class EnvironmentChecker extends RequestHandler { $this->title = $title; } - function init() { - if(!$this->canAccess()) return $this->httpError(403); + function init($permission = 'ADMIN') { + if(!$this->canAccess(null, $permission)) return $this->httpError(403); } - function canAccess($member = null) { + function canAccess($member = null, $permission = "ADMIN") { if(!$member) $member = Member::currentUser(); // We allow access to this controller regardless of live-status or ADMIN permission only // if on CLI. Access to this controller is always allowed in "dev-mode", or of the user is ADMIN. if( Director::isDev() - || Director::is_cli() - || Permission::checkMember($member, "ADMIN") + || Director::is_cli() + || empty($permission) + || Permission::checkMember($member, $permission) ) { return true; } @@ -66,6 +67,7 @@ class EnvironmentChecker extends RequestHandler { } $resultText = $result->customise(array( + "URL" => Director::absoluteBaseURL(), "Title" => $this->title, "Name" => $this->checkSuiteName, "ErrorCode" => $this->errorCode, diff --git a/templates/EnvironmentChecker.ss b/templates/EnvironmentChecker.ss index 837c509..a035f78 100644 --- a/templates/EnvironmentChecker.ss +++ b/templates/EnvironmentChecker.ss @@ -13,9 +13,14 @@ h1 { font-size: 30px; - margin-bottom: 10px; + margin-bottom: 3px; margin-left: 8px; } + + h2 { + font-size: 16px; + margin: 2px 0 10px 8px; + } p { margin-left: 10px; @@ -57,6 +62,7 @@

$Title: $Status

+

Site: $URL

Check Status Message