index.php 706 B

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