Merge branch 'MDL-55916-maintmode-503-moodle' of https://github.com/brendanheywood/moodle

This commit is contained in:
Dan Poltawski
2016-09-20 09:31:41 +01:00
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -313,6 +313,9 @@ if (!defined('WS_SERVER')) {
// Detect CLI maintenance mode - this is useful when you need to mess with database, such as during upgrades
if (file_exists("$CFG->dataroot/climaintenance.html")) {
if (!CLI_SCRIPT) {
header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance');
header('Status: 503 Moodle under maintenance');
header('Retry-After: 300');
header('Content-type: text/html; charset=utf-8');
header('X-UA-Compatible: IE=edge');
/// Headers to make it not cacheable and json
+4
View File
@@ -2934,6 +2934,10 @@ function rebuildnolinktag($text) {
function print_maintenance_message() {
global $CFG, $SITE, $PAGE, $OUTPUT;
header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance');
header('Status: 503 Moodle under maintenance');
header('Retry-After: 300');
$PAGE->set_pagetype('maintenance-message');
$PAGE->set_pagelayout('maintenance');
$PAGE->set_title(strip_tags($SITE->fullname));