index.php 623 B

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