index.php 1.7 KB

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