Fix the code so that deleting and superadmin is not possible unless the user account used to do it is in the superadmin group.
This commit is contained in:
parent
374d5fd2ac
commit
4f08ba6577
|
|
@ -53,12 +53,14 @@ else {
|
||||||
|
|
||||||
//required to be a superadmin to delete a member of the superadmin group
|
//required to be a superadmin to delete a member of the superadmin group
|
||||||
$superadmin_list = superadmin_list($db);
|
$superadmin_list = superadmin_list($db);
|
||||||
if (if_superadmin($superadmin_list, $_SESSION['user_uuid'])) {
|
if (if_superadmin($superadmin_list, $user_uuid)) {
|
||||||
if (!if_group("superadmin")) {
|
if (!if_group("superadmin")) {
|
||||||
echo "access denied";
|
//access denied - do not delete the user
|
||||||
|
header("Location: index.php");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//delete the user
|
//delete the user
|
||||||
$sql_delete = "delete from v_users ";
|
$sql_delete = "delete from v_users ";
|
||||||
$sql_delete .= "where domain_uuid = '$domain_uuid' ";
|
$sql_delete .= "where domain_uuid = '$domain_uuid' ";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue