MDL-50973 admin: do not throw exception on /admin/
This commit is contained in:
committed by
David Monllao
parent
a8af89ac13
commit
3b6e267b24
+9
-1
@@ -513,7 +513,15 @@ if (isguestuser()) {
|
||||
redirect(get_login_url());
|
||||
}
|
||||
$context = context_system::instance();
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
if (!has_capability('moodle/site:config', $context)) {
|
||||
// Do not throw exception display an empty page with administration menu if visible for current user.
|
||||
$PAGE->set_title($SITE->fullname);
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
// check that site is properly customized
|
||||
$site = get_site();
|
||||
|
||||
Reference in New Issue
Block a user