index.php 651 B

12345678910111213141516171819202122232425262728293031
  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(HESTIA_CMD."v-delete-firewall-ipset ".quoteshellarg($v_listname), $output, $return_var);
  16. }
  17. check_return_code($return_var, $output);
  18. unset($output);
  19. $back = $_SESSION['back'];
  20. if (!empty($back)) {
  21. header("Location: ".$back);
  22. exit;
  23. }
  24. header("Location: /list/firewall/ipset/");
  25. exit;