index.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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(HESTIA_CMD."v-suspend-dns-record ".$user." ".$v_domain." ".$v_record_id, $output, $return_var);
  29. check_return_code($return_var, $output);
  30. unset($output);
  31. $back = $_SESSION['back'];
  32. if (!empty($back)) {
  33. header("Location: ".$back);
  34. exit;
  35. }
  36. header("Location: /list/dns/?domain=".$_GET['domain']);
  37. exit;
  38. }
  39. $back = $_SESSION['back'];
  40. if (!empty($back)) {
  41. header("Location: ".$back);
  42. exit;
  43. }
  44. header("Location: /list/dns/");
  45. exit;