index.php 656 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. // Main include
  5. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  6. // Check user
  7. if ($_SESSION["userContext"] != "admin") {
  8. header("Location: /list/user");
  9. exit();
  10. }
  11. // Check token
  12. verify_csrf($_GET);
  13. if (!empty($_GET["listname"])) {
  14. $v_listname = $_GET["listname"];
  15. exec(
  16. HESTIA_CMD . "v-delete-firewall-ipset " . quoteshellarg($v_listname),
  17. $output,
  18. $return_var,
  19. );
  20. }
  21. check_return_code($return_var, $output);
  22. unset($output);
  23. $back = $_SESSION["back"];
  24. if (!empty($back)) {
  25. header("Location: " . $back);
  26. exit();
  27. }
  28. header("Location: /list/firewall/ipset/");
  29. exit();