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:
poltawski
2008-01-26 17:00:03 +00:00
parent 29ee92888b
commit fc4b2decc0
5 changed files with 23 additions and 12 deletions
+1 -2
View File
@@ -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);
}