index.php 667 B

12345678910111213141516171819202122232425262728293031
  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['ip'])) && (!empty($_GET['chain']))) {
  13. $v_ip = escapeshellarg($_GET['ip']);
  14. $v_chain = escapeshellarg($_GET['chain']);
  15. exec(HESTIA_CMD."v-delete-firewall-ban ".$v_ip." ".$v_chain, $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/banlist/");
  25. exit;