index.php 601 B

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