mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
Enhanced delete own domain/user prevention.
This commit is contained in:
@@ -184,8 +184,13 @@ else {
|
||||
if (permission_exists('domain_edit')) {
|
||||
echo "<a href='domain_edit.php?id=".$row['domain_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('domain_delete')) {
|
||||
echo "<a href='domain_delete.php?id=".$row['domain_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
if (permission_exists('domain_delete') && $result_count > 1) {
|
||||
if ($_SESSION["groups"][0]["domain_uuid"] != $row['domain_uuid']) {
|
||||
echo "<a href='domain_delete.php?id=".$row['domain_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
else {
|
||||
echo "<span onclick=\"alert('You cannot delete your own domain.\\n\\nPlease login with a user account under a different domain, then try again.');\">".$v_link_label_delete."</span>";
|
||||
}
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
@@ -163,12 +163,12 @@ echo " <td align=\"center\">\n";
|
||||
if (permission_exists('user_edit')) {
|
||||
echo "<a href='usersupdate.php?id=".$row['user_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('user_delete')) {
|
||||
if (permission_exists('user_delete') && $result_count > 1) {
|
||||
if ($_SESSION["user"]["user_uuid"] != $row['user_uuid']) {
|
||||
echo "<a href='userdelete.php?id=".$row['user_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
|
||||
}
|
||||
else {
|
||||
echo $v_link_label_delete; // no you can't delete your own account, duh
|
||||
echo "<span onclick=\"alert('You cannot delete your own user account.\\n\\nPlease login as a different user, then try again.');\">".$v_link_label_delete."</span>";
|
||||
}
|
||||
}
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user