MDL-23774 admin users can not be deleted - first remove admin privileges if necessary

This commit is contained in:
Petr Skoda
2010-08-12 08:22:26 +00:00
parent d44df69b23
commit a26a1a5b54
+3 -3
View File
@@ -64,8 +64,8 @@
print_error('nousers', 'error');
}
if (is_primary_admin($user->id)) {
print_error('nopermissions', 'error', '', 'delete the primary admin user');
if (is_siteadmin($user->id)) {
print_error('nopermissions', 'error', '', 'delete the admin users');
}
if ($confirm != md5($delete)) {
@@ -222,7 +222,7 @@
continue; // do not dispaly dummy new user and guest here
}
if ($user->id == $USER->id) {
if ($user->id == $USER->id or is_siteadmin($user)) {
$deletebutton = "";
} else {
if (has_capability('moodle/user:delete', $sitecontext)) {