index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // DNS domain
  9. if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
  10. $v_username = escapeshellarg($user);
  11. $v_domain = escapeshellarg($_GET['domain']);
  12. exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
  13. if ($return_var != 0) {
  14. $error = implode('<br>', $output);
  15. if (empty($error)) $error = 'Error: vesta did not return any output.';
  16. $_SESSION['error_msg'] = $error;
  17. }
  18. unset($output);
  19. header("Location: /list/dns/");
  20. exit;
  21. }
  22. // DNS record
  23. if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
  24. $v_username = escapeshellarg($user);
  25. $v_domain = escapeshellarg($_GET['domain']);
  26. $v_record_id = escapeshellarg($_GET['record_id']);
  27. exec (VESTA_CMD."v_delete_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
  28. if ($return_var != 0) {
  29. $error = implode('<br>', $output);
  30. if (empty($error)) $error = 'Error: vesta did not return any output.';
  31. $_SESSION['error_msg'] = $error;
  32. }
  33. unset($output);
  34. unset($output);
  35. header("Location: /list/dns/?domain=".$_GET['domain']);
  36. exit;
  37. }
  38. //}
  39. header("Location: /list/dns/");