index.php 716 B

1234567891011121314151617181920212223242526272829303132
  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['ip'])) && (!empty($_GET['chain']))) {
  14. $v_ip = quoteshellarg($_GET['ip']);
  15. $v_chain = quoteshellarg($_GET['chain']);
  16. exec(HESTIA_CMD."v-delete-firewall-ban ".$v_ip." ".$v_chain, $output, $return_var);
  17. }
  18. check_return_code($return_var, $output);
  19. unset($output);
  20. $back = $_SESSION['back'];
  21. if (!empty($back)) {
  22. header("Location: ".$back);
  23. exit;
  24. }
  25. header("Location: /list/firewall/banlist/");
  26. exit;