index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. session_start();
  3. $TAB = 'MAIL';
  4. // Main include
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Header
  7. include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
  8. // Panel
  9. top_panel($user,$TAB);
  10. // Data
  11. if (empty($_GET['domain'])){
  12. exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
  13. $data = json_decode(implode('', $output), true);
  14. $data = array_reverse($data, true);
  15. unset($output);
  16. if ($_SESSION['user'] == 'admin') {
  17. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html');
  18. } else {
  19. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail.html');
  20. }
  21. } else {
  22. exec (VESTA_CMD."v-list-mail-accounts '".$user."' '".$_GET['domain']."' json", $output, $return_var);
  23. $data = json_decode(implode('', $output), true);
  24. $data = array_reverse($data, true);
  25. unset($output);
  26. if ($_SESSION['user'] == 'admin') {
  27. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');
  28. } else {
  29. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail_acc.html');
  30. }
  31. }
  32. // Back uri
  33. $_SESSION['back'] = $_SERVER['REQUEST_URI'];
  34. // Footer
  35. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');