index.php 1.8 KB

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