Fixes for FM

This commit is contained in:
Serghey Rodin 2015-10-28 16:39:39 +02:00
commit 5d070fc9a5
13 changed files with 274 additions and 1489 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,15 +0,0 @@
<?php
/*
* jQuery File Upload Plugin PHP Example 5.14
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
error_reporting(E_ALL | E_STRICT);
require('UploadHandler.php');
$upload_handler = new UploadHandler();

View file

@ -1,38 +0,0 @@
<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// todo: set in session?
if (empty($panel)) {
$command = VESTA_CMD."v-list-user '".$user."' 'json'";
exec ($command, $output, $return_var);
if ( $return_var > 0 ) {
header("Location: /error/");
exit;
}
$panel = json_decode(implode('', $output), true);
}
// Define a destination
//$targetFolder = '/home/admin/'; // Relative to the root
$targetFolder = $panel[$user]['HOME']; // Relative to the root
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
exec (VESTA_CMD . "v-copy-fs-file {$user} {$tempFile} {$targetFile}", $output, $return_var);
$error = check_return_code($return_var, $output);
if ($return_var != 0) {
echo '0';
} else {
echo '1';
}
}
?>