index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. // DNS domain
  11. if (!empty($_GET["domain"]) && empty($_GET["record_id"])) {
  12. $v_domain = quoteshellarg($_GET["domain"]);
  13. exec(HESTIA_CMD . "v-suspend-dns-domain " . $user . " " . $v_domain, $output, $return_var);
  14. check_return_code($return_var, $output);
  15. unset($output);
  16. $back = $_SESSION["back"];
  17. if (!empty($back)) {
  18. header("Location: " . $back);
  19. exit();
  20. }
  21. header("Location: /list/dns/");
  22. exit();
  23. }
  24. // DNS record
  25. if (!empty($_GET["domain"]) && !empty($_GET["record_id"])) {
  26. $v_domain = quoteshellarg($_GET["domain"]);
  27. $v_record_id = quoteshellarg($_GET["record_id"]);
  28. exec(
  29. HESTIA_CMD . "v-suspend-dns-record " . $user . " " . $v_domain . " " . $v_record_id,
  30. $output,
  31. $return_var,
  32. );
  33. check_return_code($return_var, $output);
  34. unset($output);
  35. $back = $_SESSION["back"];
  36. if (!empty($back)) {
  37. header("Location: " . $back);
  38. exit();
  39. }
  40. header("Location: /list/dns/?domain=" . $_GET["domain"]);
  41. exit();
  42. }
  43. $back = $_SESSION["back"];
  44. if (!empty($back)) {
  45. header("Location: " . $back);
  46. exit();
  47. }
  48. header("Location: /list/dns/");
  49. exit();