Don't rely on the legacy capabilities to identify admins, use doanything
This commit is contained in:
+2
-2
@@ -65,7 +65,7 @@ function get_admins() {
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
|
||||
return get_users_by_capability($context, 'moodle/legacy:admin', 'u.*, ra.id as adminid', 'ra.id ASC'); // only need first one
|
||||
return get_users_by_capability($context, 'moodle/site:doanything', 'u.*, ra.id as adminid', 'ra.id ASC'); // only need first one
|
||||
|
||||
}
|
||||
|
||||
@@ -1540,4 +1540,4 @@ function category_parent_visible($parent = 0) {
|
||||
}
|
||||
|
||||
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user