index.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. session_start();
  5. $TAB = 'USER';
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. // Header
  8. include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
  9. // Panel
  10. top_panel($user,$TAB);
  11. // Data
  12. if ($_SESSION['user'] == 'admin') {
  13. if ($user == 'admin') {
  14. exec (VESTA_CMD."v_list_users json", $output, $return_var);
  15. } else {
  16. exec (VESTA_CMD."v_list_user ".$user." json", $output, $return_var);
  17. }
  18. check_error($return_var);
  19. $data = json_decode(implode('', $output), true);
  20. $data = array_reverse($data);
  21. unset($output);
  22. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_user.html');
  23. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_user.html');
  24. } else {
  25. exec (VESTA_CMD."v_list_user ".$user." json", $output, $return_var);
  26. check_error($return_var);
  27. $data = json_decode(implode('', $output), true);
  28. $data = array_reverse($data);
  29. unset($output);
  30. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_user.html');
  31. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_user.html');
  32. }
  33. // Footer
  34. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');