index.php 614 B

1234567891011121314151617181920212223242526272829303132
  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. verify_csrf($_GET);
  9. // Check user
  10. if ($_SESSION['userContext'] != 'admin') {
  11. header("Location: /list/user");
  12. exit;
  13. }
  14. if (!empty($_GET['rule'])) {
  15. $v_rule = escapeshellarg($_GET['rule']);
  16. exec(HESTIA_CMD."v-suspend-firewall-rule ".$v_rule, $output, $return_var);
  17. }
  18. check_return_code($return_var, $output);
  19. unset($output);
  20. $back=getenv("HTTP_REFERER");
  21. if (!empty($back)) {
  22. header("Location: ".$back);
  23. exit;
  24. }
  25. header("Location: /list/firewall/");
  26. exit;