index.php 998 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. include($_SERVER['DOCUMENT_ROOT'] . "/inc/main.php");
  3. if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
  4. header("Location: /filemanager-not-purchased/");
  5. exit;
  6. }
  7. if (empty($panel)) {
  8. $command = VESTA_CMD."v-list-user '".$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']) ? $_REQUEST['dir_a'] : '';
  17. $path_b = !empty($_REQUEST['dir_b']) ? $_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>';
  21. // Footer
  22. include($_SERVER['DOCUMENT_ROOT'].'/templates/file_manager/main.php');