Files
VestaCP/web/list/directory/index.php

35 lines
1.1 KiB
PHP
Raw Normal View History

2015-09-09 16:50:23 +03:00
<?php
2015-11-06 22:54:06 +02:00
error_reporting(NULL);
2015-09-09 16:50:23 +03:00
include($_SERVER['DOCUMENT_ROOT'] . "/inc/main.php");
2015-09-28 02:01:19 +03:00
if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
header("Location: /filemanager-not-purchased/");
exit;
}
2015-11-05 03:17:21 +02:00
// Check login_as feature
if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
$user=$_SESSION['look'];
2015-11-05 03:17:21 +02:00
}
2015-09-28 02:01:19 +03:00
2015-09-09 16:50:23 +03:00
if (empty($panel)) {
$command = VESTA_CMD."v-list-user '".$user."' 'json'";
exec ($command, $output, $return_var);
if ( $return_var > 0 ) {
2015-09-09 16:50:23 +03:00
header("Location: /error/");
exit;
}
$panel = json_decode(implode('', $output), true);
2015-09-09 16:50:23 +03:00
}
$path_a = !empty($_REQUEST['dir_a']) ? $_REQUEST['dir_a'] : '';
$path_b = !empty($_REQUEST['dir_b']) ? $_REQUEST['dir_b'] : '';
$GLOBAL_JS = '<script type="text/javascript">GLOBAL.START_DIR_A = "' . $path_a . '";</script>';
$GLOBAL_JS .= '<script type="text/javascript">GLOBAL.START_DIR_B = "' . $path_b . '";</script>';
$GLOBAL_JS .= '<script type="text/javascript">GLOBAL.ROOT_DIR = "' . $panel[$user]['HOME'] . '";</script>';
2015-09-28 02:01:19 +03:00
2015-09-09 16:50:23 +03:00
// Footer
2015-09-28 02:01:19 +03:00
include($_SERVER['DOCUMENT_ROOT'].'/templates/file_manager/main.php');