forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
27 lines (22 loc) · 697 Bytes
/
index.php
File metadata and controls
27 lines (22 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
header("Location: /login/");
exit;
}
$user = $_SESSION['user'];
if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
$user=$_SESSION['look'];
}
if (!empty($_REQUEST['path'])) {
$path = $_REQUEST['path'];
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');
}
?>