Merge branch 'MDL-55916-maintmode-503-moodle' of https://github.com/brendanheywood/moodle
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user