FM changes

This commit is contained in:
Serghey Rodin 2015-11-05 03:17:21 +02:00
commit d207b7a752
9 changed files with 117 additions and 136 deletions

View file

@ -1,11 +1,18 @@
<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
$user = $_SESSION['user'];
if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
$user=$_SESSION['look'];
}
if (!empty($_REQUEST['path'])) {
$path = $_REQUEST['path'];
if (is_readable($path)) {
header("Content-disposition: attachment;filename=".basename($path));
readfile($path);
exit;
}
header("Content-type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
header("Content-disposition: attachment;filename=".basename($path));
passthru (VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
exit;
}
else {
die('File not found');