index.php 1.2 KB

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