index.php 697 B

123456789101112131415161718192021222324252627
  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. if (!empty($_REQUEST['path'])) {
  12. $path = $_REQUEST['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. }
  19. else {
  20. die('File not found');
  21. }
  22. ?>