index.php 677 B

1234567891011121314151617181920212223
  1. <?php
  2. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  3. if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
  4. header("Location: /login/");
  5. exit;
  6. }
  7. $user = $_SESSION['user'];
  8. if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
  9. $user = $_SESSION['look'];
  10. }
  11. $path = $_REQUEST['path'];
  12. if (!empty($path)) {
  13. header("Content-type: application/octet-stream");
  14. header("Content-Transfer-Encoding: binary");
  15. header("Content-disposition: attachment;filename=".basename($path));
  16. passthru(VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
  17. exit;
  18. } else {
  19. die('File not found');
  20. }