File Manager stuff

This commit is contained in:
Serghey Rodin 2015-09-10 14:35:17 +03:00
commit 55eb1ec16a
5 changed files with 131 additions and 12 deletions

View file

@ -31,6 +31,11 @@ switch ($_REQUEST['action']) {
$dir = $_REQUEST['dir'];
print json_encode($fm->ls($dir));
break;
case 'check_file_type':
$dir = $_REQUEST['dir'];
print json_encode($fm->checkFileType($dir));
break;
case 'rename_file':
$dir = $_REQUEST['dir'];
$item = $_REQUEST['item'];

View file

@ -42,6 +42,26 @@ class FileManager {
);
}*/
public function checkFileType($dir) {
$dir = $this->formatFullPath($dir);
exec(VESTA_CMD . "v-delete-fs-file {$this->user} {$dir}", $output, $return_var);
$error = self::check_return_code($return_var, $output);
if (empty($error)) {
return array(
'result' => true
);
}
else {
return array(
'result' => false,
'message' => $error
);
}
}
public function formatFullPath($path_part = '') {
if (substr($path_part, 0, strlen($this->ROOT_DIR)) === $this->ROOT_DIR) {
$path = $path_part;