mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
File Manager stuff
This commit is contained in:
parent
cad14057cc
commit
55eb1ec16a
5 changed files with 131 additions and 12 deletions
|
@ -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'];
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue