index.php 1004 B

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