index.php 808 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. // Main include
  7. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  8. // Check user
  9. if ($_SESSION['user'] != 'admin') {
  10. header("Location: /list/user");
  11. exit;
  12. }
  13. // Check token
  14. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  15. header('location: /login/');
  16. exit();
  17. }
  18. if ((!empty($_GET['ip'])) && (!empty($_GET['chain']))) {
  19. $v_ip = escapeshellarg($_GET['ip']);
  20. $v_chain = escapeshellarg($_GET['chain']);
  21. exec (VESTA_CMD."v-delete-firewall-ban ".$v_ip." ".$v_chain, $output, $return_var);
  22. }
  23. check_return_code($return_var,$output);
  24. unset($output);
  25. $back = $_SESSION['back'];
  26. if (!empty($back)) {
  27. header("Location: ".$back);
  28. exit;
  29. }
  30. header("Location: /list/firewall/banlist/");
  31. exit;