mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Primary admin should never be allowed to be deleted by sub-admins
This commit is contained in:
parent
475fe8d16c
commit
b4a348291b
1 changed files with 6 additions and 0 deletions
|
@ -107,6 +107,12 @@
|
|||
if (!$user = get_record("user", "id", "$delete")) {
|
||||
error("No such user!");
|
||||
}
|
||||
|
||||
$primaryadmin = get_admin();
|
||||
if ($user->id == $primaryadmin->id) {
|
||||
error("You are not allowed to delete the primary admin user!");
|
||||
}
|
||||
|
||||
if ($confirm != md5($delete)) {
|
||||
notice_yesno(get_string("deletecheckfull", "", "'$user->firstname $user->lastname'"),
|
||||
"user.php?delete=$delete&confirm=".md5($delete), "user.php");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue