mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-55791 admin: maintenance mode access capability
Add capability to allow certain non-admin users through maintenance mode.
This commit is contained in:
parent
0344082208
commit
59c66f926f
7 changed files with 22 additions and 13 deletions
|
@ -52,13 +52,15 @@ if ($CFG->forcelogin) {
|
|||
user_accesstime_log();
|
||||
}
|
||||
|
||||
$hassiteconfig = has_capability('moodle/site:config', context_system::instance());
|
||||
$hasmaintenanceaccess = has_capability('moodle/site:maintenanceaccess', context_system::instance());
|
||||
|
||||
// If the site is currently under maintenance, then print a message.
|
||||
if (!empty($CFG->maintenance_enabled) and !$hassiteconfig) {
|
||||
if (!empty($CFG->maintenance_enabled) and !$hasmaintenanceaccess) {
|
||||
print_maintenance_message();
|
||||
}
|
||||
|
||||
$hassiteconfig = has_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
if ($hassiteconfig && moodle_needs_upgrading()) {
|
||||
redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue