index.php 1.9 KB

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