mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
FM changes
This commit is contained in:
parent
f064c09667
commit
d207b7a752
9 changed files with 117 additions and 136 deletions
|
@ -2,18 +2,17 @@
|
|||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check login_as feature
|
||||
$user = $_SESSION['user'];
|
||||
if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
|
||||
$user=$_SESSION['look'];
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['path'])) {
|
||||
$path = $_REQUEST['path'];
|
||||
if (is_readable($path) && !empty($_REQUEST['raw'])) {
|
||||
//print file_get_contents($path);
|
||||
exec (VESTA_CMD . "v-check-fs-permission {$user} {$path}", $content, $return_var);
|
||||
|
||||
if ($return_var != 0) {
|
||||
print 'Error while opening file'; // todo: handle this more styled
|
||||
exit;
|
||||
}
|
||||
header('content-type: image/jpeg');
|
||||
print file_get_contents($path);
|
||||
if (!empty($_REQUEST['raw'])) {
|
||||
header('content-type: image/jpeg');
|
||||
passthru (VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($_REQUEST['path']));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue