diff --git a/var/www/html/files.php b/var/www/html/files.php index b7174f7..fb02707 100644 --- a/var/www/html/files.php +++ b/var/www/html/files.php @@ -123,8 +123,15 @@ if(@!ftp_chdir($ftp, $dir)){ exit; } -if(!empty($_POST['mkdir']) && !empty($_POST['dirname'])){ - ftp_mkdir($ftp, $_POST['dirname']); +if(!empty($_POST['mkdir']) && !empty($_POST['name'])){ + ftp_mkdir($ftp, $_POST['name']); +} + +if(!empty($_POST['mkfile']) && !empty($_POST['name'])){ + $tmpfile='/tmp/'.uniqid(); + touch($tmpfile); + ftp_put($ftp, $_POST['name'], $tmpfile, FTP_BINARY); + unlink($tmpflie); } if(!empty($_POST['delete']) && !empty($_POST['files'])){ @@ -144,6 +151,20 @@ if(!empty($_POST['rename']) && !empty($_POST['files'])){ exit; } +if(!empty($_POST['edit_2']) && !empty($_POST['files'])){ + $tmpfile='/tmp/'.uniqid(); + foreach($_POST['files'] as $name=>$content){ + file_put_contents($tmpfile, $content); + ftp_put($ftp, $name, $tmpfile, FTP_BINARY); + } + unlink($tmpfile); +} + +if(!empty($_POST['edit']) && !empty($_POST['files'])){ + send_edit($ftp, $dir); + exit; +} + if(!empty($_POST['unzip']) && !empty($_POST['files'])){ $zip = new ZipArchive(); foreach($_POST['files'] as $file){ @@ -264,10 +285,12 @@ if($order==='A'){ ?>
-

+ +

+
@@ -371,7 +394,7 @@ function ftp_recursive_delete($ftp, $file){ function send_rename($dir){ echo ''; - echo 'Daniel\s Hosting - FileManager - Rename file'; + echo 'Daniel\'s Hosting - FileManager - Rename file'; echo ''; echo ''; echo ''; @@ -386,3 +409,26 @@ function send_rename($dir){ echo '

Go back.

'; echo ''; } + +function send_edit($ftp, $dir){ + echo ''; + echo 'Daniel\'s Hosting - FileManager - Edit file'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; + $tmpfile='/tmp/'.uniqid(); + foreach($_POST['files'] as $file){ + echo ''; + } + unlink($tmpfile); + echo '
'.htmlspecialchars($file).'
'; + echo '
'; + echo '

Go back.

'; + echo ''; +}