index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  5. // Check token
  6. verify_csrf($_GET);
  7. // DNS domain
  8. if (!empty($_GET["domain"]) && empty($_GET["record_id"])) {
  9. $v_domain = quoteshellarg($_GET["domain"]);
  10. exec(HESTIA_CMD . "v-suspend-dns-domain " . $user . " " . $v_domain, $output, $return_var);
  11. check_return_code($return_var, $output);
  12. unset($output);
  13. $back = $_SESSION["back"];
  14. if (!empty($back)) {
  15. header("Location: " . $back);
  16. exit();
  17. }
  18. header("Location: /list/dns/");
  19. exit();
  20. }
  21. // DNS record
  22. if (!empty($_GET["domain"]) && !empty($_GET["record_id"])) {
  23. $v_domain = quoteshellarg($_GET["domain"]);
  24. $v_record_id = quoteshellarg($_GET["record_id"]);
  25. exec(
  26. HESTIA_CMD . "v-suspend-dns-record " . $user . " " . $v_domain . " " . $v_record_id,
  27. $output,
  28. $return_var,
  29. );
  30. check_return_code($return_var, $output);
  31. unset($output);
  32. $back = $_SESSION["back"];
  33. if (!empty($back)) {
  34. header("Location: " . $back);
  35. exit();
  36. }
  37. header("Location: /list/dns/?domain=" . $_GET["domain"]);
  38. exit();
  39. }
  40. $back = $_SESSION["back"];
  41. if (!empty($back)) {
  42. header("Location: " . $back);
  43. exit();
  44. }
  45. header("Location: /list/dns/");
  46. exit();