index.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. check_return_code($return_var,$output);
  17. unset($output);
  18. $back = $_SESSION['back'];
  19. if (!empty($back)) {
  20. header("Location: ".$back);
  21. exit;
  22. }
  23. header("Location: /list/dns/");
  24. exit;
  25. }
  26. // DNS record
  27. if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
  28. $v_username = escapeshellarg($user);
  29. $v_domain = escapeshellarg($_GET['domain']);
  30. $v_record_id = escapeshellarg($_GET['record_id']);
  31. exec (VESTA_CMD."v-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
  32. check_return_code($return_var,$output);
  33. unset($output);
  34. $back = $_SESSION['back'];
  35. if (!empty($back)) {
  36. header("Location: ".$back);
  37. exit;
  38. }
  39. header("Location: /list/dns/?domain=".$_GET['domain']);
  40. exit;
  41. }
  42. }
  43. $back = $_SESSION['back'];
  44. if (!empty($back)) {
  45. header("Location: ".$back);
  46. exit;
  47. }
  48. header("Location: /list/dns/");
  49. exit;