mirror of
https://github.com/moodle/moodle.git
synced 2025-05-04 23:41:50 +02:00
Primary admin should never be allowed to be deleted by sub-admins
This commit is contained in:
parent
475fe8d16c
commit
b4a348291b
@ -107,6 +107,12 @@
|
|||||||
if (!$user = get_record("user", "id", "$delete")) {
|
if (!$user = get_record("user", "id", "$delete")) {
|
||||||
error("No such user!");
|
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)) {
|
if ($confirm != md5($delete)) {
|
||||||
notice_yesno(get_string("deletecheckfull", "", "'$user->firstname $user->lastname'"),
|
notice_yesno(get_string("deletecheckfull", "", "'$user->firstname $user->lastname'"),
|
||||||
"user.php?delete=$delete&confirm=".md5($delete), "user.php");
|
"user.php?delete=$delete&confirm=".md5($delete), "user.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user