index.php 719 B

123456789101112131415161718192021222324252627282930313233343536
  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['rule'])) {
  19. $v_rule = escapeshellarg($_GET['rule']);
  20. exec (VESTA_CMD."v-delete-firewall-rule ".$v_rule, $output, $return_var);
  21. }
  22. check_return_code($return_var,$output);
  23. unset($output);
  24. $back = $_SESSION['back'];
  25. if (!empty($back)) {
  26. header("Location: ".$back);
  27. exit;
  28. }
  29. header("Location: /list/firewall/");
  30. exit;