index.php 935 B

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