index.php 951 B

12345678910111213141516171819202122232425
  1. <?php
  2. error_reporting(NULL);
  3. include($_SERVER['DOCUMENT_ROOT'] . "/inc/main.php");
  4. // Check login_as feature
  5. if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
  6. $user=$_SESSION['look'];
  7. }
  8. if (empty($panel)) {
  9. $command = HESTIA_CMD."v-list-user ".escapeshellarg($user)." 'json'";
  10. exec ($command, $output, $return_var);
  11. if ( $return_var > 0 ) {
  12. header("Location: /error/");
  13. exit;
  14. }
  15. $panel = json_decode(implode('', $output), true);
  16. }
  17. $path_a = !empty($_REQUEST['dir_a']) ? htmlentities($_REQUEST['dir_a']) : '';
  18. $path_b = !empty($_REQUEST['dir_b']) ? htmlentities($_REQUEST['dir_b']) : '';
  19. $GLOBAL_JS = '<script type="text/javascript">GLOBAL.START_DIR_A = "' . $path_a . '";</script>';
  20. $GLOBAL_JS .= '<script type="text/javascript">GLOBAL.START_DIR_B = "' . $path_b . '";</script>';
  21. $GLOBAL_JS .= '<script type="text/javascript">GLOBAL.ROOT_DIR = "' . $panel[$user]['HOME'] . '";</script>';