index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. // Init
  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 = escapeshellarg($_GET['domain']);
  10. exec(HESTIA_CMD."v-unsuspend-dns-domain ".$user." ".$v_domain, $output, $return_var);
  11. if ($return_var != 0) {
  12. $error = implode('<br>', $output);
  13. if (empty($error)) {
  14. $error = _('Error: Hestia did not return any output.');
  15. }
  16. $_SESSION['error_msg'] = $error;
  17. }
  18. unset($output);
  19. $back=getenv("HTTP_REFERER");
  20. if (!empty($back)) {
  21. header("Location: ".$back);
  22. exit;
  23. }
  24. header("Location: /list/dns/");
  25. exit;
  26. }
  27. // DNS record
  28. if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
  29. $v_domain = escapeshellarg($_GET['domain']);
  30. $v_record_id = escapeshellarg($_GET['record_id']);
  31. exec(HESTIA_CMD."v-unsuspend-dns-record ".$user." ".$v_domain." ".$v_record_id, $output, $return_var);
  32. if ($return_var != 0) {
  33. $error = implode('<br>', $output);
  34. if (empty($error)) {
  35. $error = _('Error: Hestia did not return any output.');
  36. }
  37. $_SESSION['error_msg'] = $error;
  38. }
  39. unset($output);
  40. $back=getenv("HTTP_REFERER");
  41. if (!empty($back)) {
  42. header("Location: ".$back);
  43. exit;
  44. }
  45. header("Location: /list/dns/?domain=".$_GET['domain']);
  46. exit;
  47. }
  48. $back=getenv("HTTP_REFERER");
  49. if (!empty($back)) {
  50. header("Location: ".$back);
  51. exit;
  52. }
  53. header("Location: /list/dns/");
  54. exit;