index.php 1015 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. session_start();
  3. $TAB = 'USER';
  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 ($_SESSION['user'] == 'admin') {
  12. if ($user == 'admin') {
  13. exec (VESTA_CMD . "v-list-users json", $output, $return_var);
  14. } else {
  15. exec (VESTA_CMD . "v-list-user ".$user." json", $output, $return_var);
  16. }
  17. $data = json_decode(implode('', $output), true);
  18. $data = array_reverse($data,true);
  19. display_error_block();
  20. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_user.html');
  21. } else {
  22. exec (VESTA_CMD . "v-list-user ".$user." json", $output, $return_var);
  23. $data = json_decode(implode('', $output), true);
  24. display_error_block();
  25. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_user.html');
  26. }
  27. // Back uri
  28. $_SESSION['back'] = $_SERVER['REQUEST_URI'];
  29. // Footer
  30. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');