index.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. error_reporting(NULL);
  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. v_exec('v-list-mail-domains', [$user, 'json'], false, $output);
  13. $data = json_decode($output, true);
  14. $data = array_reverse($data, true);
  15. if ($_SESSION['user'] == 'admin') {
  16. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html');
  17. } else {
  18. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail.html');
  19. }
  20. } else {
  21. v_exec('v-list-mail-accounts', [$user, $_GET['domain'], 'json'], false, $output);
  22. $data = json_decode($output, true);
  23. $data = array_reverse($data, true);
  24. if ($_SESSION['user'] == 'admin') {
  25. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');
  26. } else {
  27. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail_acc.html');
  28. }
  29. }
  30. // Back uri
  31. $_SESSION['back'] = $_SERVER['REQUEST_URI'];
  32. // Footer
  33. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');