index.php 661 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. // Init
  4. error_reporting(null);
  5. ob_start();
  6. session_start();
  7. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  8. // Check token
  9. verify_csrf($_GET);
  10. // Check user
  11. if ($_SESSION["userContext"] != "admin") {
  12. header("Location: /list/user");
  13. exit();
  14. }
  15. if (!empty($_GET["rule"])) {
  16. $v_rule = quoteshellarg($_GET["rule"]);
  17. exec(HESTIA_CMD . "v-suspend-firewall-rule " . $v_rule, $output, $return_var);
  18. }
  19. check_return_code($return_var, $output);
  20. unset($output);
  21. $back = getenv("HTTP_REFERER");
  22. if (!empty($back)) {
  23. header("Location: " . $back);
  24. exit();
  25. }
  26. header("Location: /list/firewall/");
  27. exit();