MDL-13179 - avoid calling get_admin() when unecessary.
It uses a relatively complex query and its not needed except for a minority of users so we may as well avoid it.. merged from MOODLE_19_STABLE
This commit is contained in:
+1
-2
@@ -63,8 +63,7 @@
|
||||
error("No such user!", '', true);
|
||||
}
|
||||
|
||||
$primaryadmin = get_admin();
|
||||
if ($user->id == $primaryadmin->id) {
|
||||
if (is_primary_admin($user->id)) {
|
||||
error("You are not allowed to delete the primary admin user!", '', true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user