index.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. // Init
  4. ob_start();
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Check token
  7. verify_csrf($_GET);
  8. // DNS domain
  9. if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
  10. $v_domain = quoteshellarg($_GET['domain']);
  11. exec(HESTIA_CMD."v-unsuspend-dns-domain ".$user." ".$v_domain, $output, $return_var);
  12. if ($return_var != 0) {
  13. $error = implode('<br>', $output);
  14. if (empty($error)) {
  15. $error = _('Error: Hestia did not return any output.');
  16. }
  17. $_SESSION['error_msg'] = $error;
  18. }
  19. unset($output);
  20. $back=getenv("HTTP_REFERER");
  21. if (!empty($back)) {
  22. header("Location: ".$back);
  23. exit;
  24. }
  25. header("Location: /list/dns/");
  26. exit;
  27. }
  28. // DNS record
  29. if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
  30. $v_domain = quoteshellarg($_GET['domain']);
  31. $v_record_id = quoteshellarg($_GET['record_id']);
  32. exec(HESTIA_CMD."v-unsuspend-dns-record ".$user." ".$v_domain." ".$v_record_id, $output, $return_var);
  33. if ($return_var != 0) {
  34. $error = implode('<br>', $output);
  35. if (empty($error)) {
  36. $error = _('Error: Hestia did not return any output.');
  37. }
  38. $_SESSION['error_msg'] = $error;
  39. }
  40. unset($output);
  41. $back=getenv("HTTP_REFERER");
  42. if (!empty($back)) {
  43. header("Location: ".$back);
  44. exit;
  45. }
  46. header("Location: /list/dns/?domain=".$_GET['domain']);
  47. exit;
  48. }
  49. $back=getenv("HTTP_REFERER");
  50. if (!empty($back)) {
  51. header("Location: ".$back);
  52. exit;
  53. }
  54. header("Location: /list/dns/");
  55. exit;