Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Version 9.13.0
Browse files Browse the repository at this point in the history
- multiple file selection: you can delete multiple files, you can select multiple file (n.b. if you select multiple files on stand alone mode it return a json list of urls, if you use editor with normal mode return only the first and if you use tinymce with responsivefilemanager plugin return all files on editor)
- you can disable mime type renaming on config
- blacklist extensions available on config
- fixed precompiled test on duplication
- rfm remember the last folder when return to filemanager
- added mime type .rar
- fixed folder permission to get config value
- fixed an error on folder renaming
- a lot of others bugs fixed
  • Loading branch information
trippo committed Jun 3, 2018
1 parent fb06ed8 commit ece088e
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 182 deletions.
15 changes: 15 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
Responsive Filemanager Changelog


*********************************************************
* RFM 9.13.0
*********************************************************
- multiple file selection: you can delete multiple files, you can select multiple file (n.b. if you select multiple files on stand alone mode it return a json list of urls, if you use editor with normal mode return only the first and if you use tinymce with responsivefilemanager plugin return all files on editor)
- you can disable mime type renaming on config
- blacklist extensions available on config
- fixed precompiled test on duplication
- rfm remember the last folder when return to filemanager
- added mime type .rar
- fixed folder permission to get config value
- fixed an error on folder renaming
- a lot of others bugs fixed


*********************************************************
* RFM 9.12.2
*********************************************************
Expand Down
54 changes: 43 additions & 11 deletions filemanager/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@
'thumbs_base_path' => '../thumbs/',


/*
|--------------------------------------------------------------------------
| mime file control to define files extensions
|--------------------------------------------------------------------------
|
| If you want to be forced to assign the extension starting from the mime type
|
*/
'mime_extension_rename' => true,


/*
|--------------------------------------------------------------------------
| FTP configuration BETA VERSION
Expand Down Expand Up @@ -131,6 +142,20 @@
'ftp_base_url' => "http://host.com/testFTP",
*/

/*
|--------------------------------------------------------------------------
| Multiple files selection
|--------------------------------------------------------------------------
| The user can delete multiple files, select all files , deselect all files
*/
'multiple_selection' => true,
/*
|
| The user can have a select button that pass a json to external input or pass the first file selected to editor
| If you use responsivefilemanager tinymce extension can copy into editor multiple object like images, videos, audios, links in the same time
|
*/
'multiple_selection_action_button' => true,

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -172,7 +197,7 @@
| in Megabytes
|
*/
'MaxSizeUpload' => 10000,
'MaxSizeUpload' => 1,

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -261,8 +286,8 @@
//
// WATERMARK IMAGE
//
//Watermark url or false
'image_watermark' => false,
//Watermark path or false
'image_watermark' => "../watermark.png",
# Could be a pre-determined position such as:
# tl = top left,
# t = top (middle),
Expand All @@ -278,7 +303,7 @@
# padding: If using a pre-determined position you can
# adjust the padding from the edges by passing an amount
# in pixels. If using co-ordinates, this value is ignored.
'image_watermark_padding' => 0,
'image_watermark_padding' => 10,

//******************
// Default layout setting
Expand Down Expand Up @@ -321,7 +346,7 @@
// if you want you can add html,css etc.
// but for security reasons it's NOT RECOMMENDED!
'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),

// Preview with Google Documents
'googledoc_enabled' => true,
'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' , 'pdf', 'odt', 'odp', 'ods'),
Expand All @@ -337,12 +362,19 @@
//**********************
//Allowed extensions (lowercase insert)
//**********************
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai', 'kmz','dwg', 'dxf', 'hpgl', 'plt', 'spl', 'step', 'stp', 'iges', 'igs', 'sat', 'cgm'), //Files
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'ico' ), //Images
'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai', 'kmz','dwg', 'dxf', 'hpgl', 'plt', 'spl', 'step', 'stp', 'iges', 'igs', 'sat', 'cgm', 'tiff'), //Files
'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video
'ext_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio
'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives


//*********************
// If you insert an extensions blacklist array the filemanager don't check any extensions but simply block the extensions in the list
// otherwise check Allowed extensions configuration
//*********************
'ext_blacklist' => false, //['jpg'],

/******************
* AVIARY config
*******************/
Expand Down Expand Up @@ -389,8 +421,8 @@
'fixed_path_from_filemanager' => array( '../test/', '../test1/' ), //fixed path of the image folder from the current position on upload folder
'fixed_image_creation_name_to_prepend' => array( '', 'test_' ), //name to prepend on filename
'fixed_image_creation_to_append' => array( '_test', '' ), //name to appendon filename
'fixed_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
'fixed_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
'fixed_image_creation_width' => array( 300, 400 ), //width of image
'fixed_image_creation_height' => array( 200, 300 ), //height of image
/*
# $option: 0 / exact = defined size;
# 1 / portrait = keep aspect set height;
Expand All @@ -410,8 +442,8 @@
'relative_path_from_current_pos' => array( './', './' ), //relative path of the image folder from the current position on upload folder
'relative_image_creation_name_to_prepend' => array( '', '' ), //name to prepend on filename
'relative_image_creation_name_to_append' => array( '_thumb', '_thumb1' ), //name to append on filename
'relative_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
'relative_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
'relative_image_creation_width' => array( 300, 400 ), //width of image
'relative_image_creation_height' => array( 200, 300 ), //height of image
/*
# $option: 0 / exact = defined size;
# 1 / portrait = keep aspect set height;
Expand Down
17 changes: 10 additions & 7 deletions filemanager/dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@
$subdir_path = '';
if (isset($_GET['fldr']) && !empty($_GET['fldr'])) {
$subdir_path = rawurldecode(trim(strip_tags($_GET['fldr']),"/"));
}elseif(isset($_SESSION['RF']['fldr']) && !empty($_SESSION['RF']['fldr'])){
$subdir_path = rawurldecode(trim(strip_tags($_SESSION['RF']['fldr']),"/"));
}
if (strpos($subdir_path,'../') === FALSE
&& strpos($subdir_path,'./') === FALSE
&& strpos($subdir_path,'..\\') === FALSE
&& strpos($subdir_path,'.\\') === FALSE)
{
$subdir = strip_tags($subdir_path) ."/";
$_SESSION['RF']['fldr'] = $subdir_path;
$_SESSION['RF']["filter"]='';
}
else { $subdir = ''; }
Expand Down Expand Up @@ -352,7 +355,6 @@

<script>
var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
var image_editor=<?php echo $aviary_active?"true":"false";?>;
if (image_editor) {
var featherEditor = new Aviary.Feather({
Expand Down Expand Up @@ -432,6 +434,7 @@
<input type="hidden" id="cur_dir" value="<?php echo $cur_dir;?>" />
<input type="hidden" id="cur_dir_thumb" value="<?php echo $thumbs_path.$subdir;?>" />
<input type="hidden" id="insert_folder_name" value="<?php echo trans('Insert_Folder_Name');?>" />
<input type="hidden" id="rename_existing_folder" value="<?php echo trans('Rename_existing_folder');?>" />
<input type="hidden" id="new_folder" value="<?php echo trans('New_Folder');?>" />
<input type="hidden" id="ok" value="<?php echo trans('OK');?>" />
<input type="hidden" id="cancel" value="<?php echo trans('Cancel');?>" />
Expand Down Expand Up @@ -671,7 +674,7 @@
'date'=>$date,
'size'=>$size,
'permissions' => $file['permissions'],
'extension'=>strtolower($file_ext)
'extension'=>fix_strtolower($file_ext)
);
}else{

Expand All @@ -692,7 +695,7 @@
'date'=>$date,
'size'=>$size,
'permissions' =>'',
'extension'=>strtolower($file_ext)
'extension'=>fix_strtolower($file_ext)
);
if($show_folder_size){
$sorted[$k]['nfiles'] = $nfiles;
Expand Down Expand Up @@ -923,7 +926,7 @@ function extensionSort($x, $y) {

foreach ($files as $file_array) {
$file=$file_array['file'];
if($file == '.' || ( substr($file, 0, 1) == '.' && isset( $file_array[ 'extension' ] ) && $file_array[ 'extension' ] == strtolower(trans( 'Type_dir' ) )) || (isset($file_array['extension']) && $file_array['extension']!=strtolower(trans('Type_dir'))) || ($file == '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $n_files>$file_number_limit_js && $file!=".." && stripos($file,$filter)===false)){
if($file == '.' || ( substr($file, 0, 1) == '.' && isset( $file_array[ 'extension' ] ) && $file_array[ 'extension' ] == fix_strtolower(trans( 'Type_dir' ) )) || (isset($file_array['extension']) && $file_array['extension']!=fix_strtolower(trans('Type_dir'))) || ($file == '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $n_files>$file_number_limit_js && $file!=".." && stripos($file,$filter)===false)){
continue;
}
$new_name=fix_filename($file,$config);
Expand Down Expand Up @@ -989,14 +992,14 @@ function extensionSort($x, $y) {
<input type="hidden" class="name" value="<?php echo $file_array['file_lcase'];?>"/>
<input type="hidden" class="date" value="<?php echo $file_array['date'];?>"/>
<input type="hidden" class="size" value="<?php echo $file_array['size'];?>"/>
<input type="hidden" class="extension" value="<?php echo trans('Type_dir');?>"/>
<input type="hidden" class="extension" value="<?php echo fix_strtolower(trans('Type_dir'));?>"/>
<div class="file-date"><?php echo date(trans('Date_type'),$file_array['date']);?></div>
<?php if($show_folder_size){ ?>
<div class="file-size"><?php echo makeSize($file_array['size']);?></div>
<input type="hidden" class="nfiles" value="<?php echo $file_array['nfiles'];?>"/>
<input type="hidden" class="nfolders" value="<?php echo $file_array['nfolders'];?>"/>
<?php } ?>
<div class='file-extension'><?php echo trans('Type_dir');?></div>
<div class='file-extension'><?php echo fix_strtolower(trans('Type_dir'));?></div>
<figcaption>
<a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) echo "rename-folder";?>" title="<?php echo trans('Rename')?>" data-folder="1" data-permissions="<?php echo $file_array['permissions']; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file;?>">
<i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white';?>"></i></a>
Expand All @@ -1015,7 +1018,7 @@ function extensionSort($x, $y) {
foreach ($files as $nu=>$file_array) {
$file=$file_array['file'];

if($file == '.' || $file == '..' || $file_array['extension']==trans('Type_dir') || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && $n_files>$file_number_limit_js && stripos($file,$filter)===false))
if($file == '.' || $file == '..' || $file_array['extension']==fix_strtolower(trans('Type_dir')) || (!$config['ext_blacklist'] && !in_array(fix_strtolower($file_array['extension']), $ext)) || ($config['ext_blacklist'] && in_array(fix_strtolower($file_array['extension']), $config['ext_blacklist'])) || ($filter!='' && $n_files>$file_number_limit_js && stripos($file,$filter)===false))
continue;
foreach ( $hidden_files as $hidden_file ) {
if ( fnmatch($hidden_file, $file, FNM_PATHNAME) ) {
Expand Down
5 changes: 4 additions & 1 deletion filemanager/execute.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ function returnPaths($_path,$_name,$config){
$name = fix_filename($_POST['name'],$config);
$path .= $name;
$path_thumb .= $name;
create_folder(fix_path($path,$config),fix_path($path_thumb,$config),$ftp,$config);
$res = create_folder(fix_path($path,$config),fix_path($path_thumb,$config),$ftp,$config);
if(!$res){
response(trans('Rename_existing_folder').AddErrorLocation())->send();
}
}
break;
case 'rename_folder':
Expand Down
1 change: 1 addition & 0 deletions filemanager/include/mime_type_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"application/x-bcpio" => "bcpio",
"application/octet-stream" => "so",
"image/bmp" => "bmp",
"application/x-rar" => "rar",
"application/x-bzip2" => "bz2",
"application/x-netcdf" => "nc",
"application/x-kchart" => "chrt",
Expand Down
10 changes: 7 additions & 3 deletions filemanager/include/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,24 @@ function create_folder($path = null, $path_thumbs = null,$ftp = null,$config = n
$ftp->mkdir($path);
$ftp->mkdir($path_thumbs);
}else{
if(file_exists($path)){
return false;
}
$oldumask = umask(0);
if ($path && ! file_exists($path))
if ($path && !file_exists($path))
{
$permission = 0755;
$permission = $config['folderPermission'];
if(isset($config['folderPermission'])){
$permission = $config['folderPermission'];
}
mkdir($path, $permission, true);
} // or even 01777 so you get the sticky bit set
if ($path_thumbs && ! file_exists($path_thumbs))
{
mkdir($path_thumbs, 0755, true) or die("$path_thumbs cannot be found");
mkdir($path_thumbs, $config['folderPermission'], true) or die("$path_thumbs cannot be found");
} // or even 01777 so you get the sticky bit set
umask($oldumask);
return true;
}
}

Expand Down
Loading

0 comments on commit ece088e

Please sign in to comment.