index.php 1.0 KB

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