index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. // Check token
  8. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  9. header('location: /login/');
  10. exit();
  11. }
  12. // Mail domain
  13. if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
  14. $v_username = escapeshellarg($user);
  15. $v_domain = escapeshellarg($_GET['domain']);
  16. exec (HESTIA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
  17. check_return_code($return_var,$output);
  18. unset($output);
  19. $back=getenv("HTTP_REFERER");
  20. if (!empty($back)) {
  21. header("Location: ".$back);
  22. exit;
  23. }
  24. header("Location: /list/mail/");
  25. exit;
  26. }
  27. // Mail account
  28. if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) {
  29. $v_username = escapeshellarg($user);
  30. $v_domain = escapeshellarg($_GET['domain']);
  31. $v_account = escapeshellarg($_GET['account']);
  32. exec (HESTIA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
  33. check_return_code($return_var,$output);
  34. unset($output);
  35. $back = $_SESSION['back'];
  36. if (!empty($back)) {
  37. header("Location: ".$back);
  38. exit;
  39. }
  40. header("Location: /list/mail/?domain=".$_GET['domain']);
  41. exit;
  42. }
  43. $back = $_SESSION['back'];
  44. if (!empty($back)) {
  45. header("Location: ".$back);
  46. exit;
  47. }
  48. header("Location: /list/mail/");
  49. exit;