index.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // Mail domain
  9. if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
  10. $v_username = escapeshellarg($user);
  11. $v_domain = escapeshellarg($_GET['domain']);
  12. exec (VESTA_CMD."v_delete_mail_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/mail/");
  20. exit;
  21. }
  22. // Mail account
  23. if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) {
  24. $v_username = escapeshellarg($user);
  25. $v_domain = escapeshellarg($_GET['domain']);
  26. $v_account = escapeshellarg($_GET['account']);
  27. exec (VESTA_CMD."v_delete_mail_account ".$v_username." ".$v_domain." ".$v_account, $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. header("Location: /list/mail/?domain=".$_GET['domain']);
  35. exit;
  36. }
  37. //}
  38. header("Location: /list/mail/");