index.php 686 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  5. // Check token
  6. verify_csrf($_GET);
  7. if ($_SESSION["userContext"] === "admin") {
  8. if (!empty($_GET["ip"])) {
  9. $v_ip = quoteshellarg($_GET["ip"]);
  10. if (filter_var($_GET["ip"], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
  11. $v_ipv6_suffix='v6';
  12. } else {
  13. $v_ipv6_suffix='';
  14. }
  15. exec(HESTIA_CMD . "v-delete-sys-ip".$v_ipv6_suffix." " . $v_ip, $output, $return_var);
  16. }
  17. check_return_code($return_var, $output);
  18. unset($output);
  19. }
  20. $back = $_SESSION["back"];
  21. if (!empty($back)) {
  22. header("Location: " . $back);
  23. exit();
  24. }
  25. header("Location: /list/ip/");
  26. exit();