mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 13:01:51 -07:00
Update index.php
- php execution timeout disabled - shell command "v-open-fs-file" is not suitable for large files. replaced with php readfile.
This commit is contained in:
parent
5500f3c2bd
commit
cfb55d2dbc
1 changed files with 11 additions and 1 deletions
|
@ -13,10 +13,20 @@ if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
|
||||||
|
|
||||||
$path = $_REQUEST['path'];
|
$path = $_REQUEST['path'];
|
||||||
if (!empty($path)) {
|
if (!empty($path)) {
|
||||||
|
set_time_limit(0);
|
||||||
|
if (ob_get_level()) {
|
||||||
|
ob_end_clean();
|
||||||
|
}
|
||||||
header("Content-type: application/octet-stream");
|
header("Content-type: application/octet-stream");
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
header("Content-disposition: attachment;filename=".basename($path));
|
header("Content-disposition: attachment;filename=".basename($path));
|
||||||
passthru(VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
|
$output = '';
|
||||||
|
exec(VESTA_CMD . "v-check-fs-permission " . $user . " " . escapeshellarg($path), $output, $return_var);
|
||||||
|
if ($return_var != 0) {
|
||||||
|
print 'Error while opening file'; // todo: handle this more styled
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
readfile($path);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
die('File not found');
|
die('File not found');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue