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

Commit ece088e

Browse files
committed
Version 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
1 parent fb06ed8 commit ece088e

File tree

13 files changed

+268
-182
lines changed

13 files changed

+268
-182
lines changed

changelog.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Responsive Filemanager Changelog
22

3+
4+
*********************************************************
5+
* RFM 9.13.0
6+
*********************************************************
7+
- 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)
8+
- you can disable mime type renaming on config
9+
- blacklist extensions available on config
10+
- fixed precompiled test on duplication
11+
- rfm remember the last folder when return to filemanager
12+
- added mime type .rar
13+
- fixed folder permission to get config value
14+
- fixed an error on folder renaming
15+
- a lot of others bugs fixed
16+
17+
318
*********************************************************
419
* RFM 9.12.2
520
*********************************************************

filemanager/config/config.php

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@
9797
'thumbs_base_path' => '../thumbs/',
9898

9999

100+
/*
101+
|--------------------------------------------------------------------------
102+
| mime file control to define files extensions
103+
|--------------------------------------------------------------------------
104+
|
105+
| If you want to be forced to assign the extension starting from the mime type
106+
|
107+
*/
108+
'mime_extension_rename' => true,
109+
110+
100111
/*
101112
|--------------------------------------------------------------------------
102113
| FTP configuration BETA VERSION
@@ -131,6 +142,20 @@
131142
'ftp_base_url' => "http://host.com/testFTP",
132143
*/
133144

145+
/*
146+
|--------------------------------------------------------------------------
147+
| Multiple files selection
148+
|--------------------------------------------------------------------------
149+
| The user can delete multiple files, select all files , deselect all files
150+
*/
151+
'multiple_selection' => true,
152+
/*
153+
|
154+
| The user can have a select button that pass a json to external input or pass the first file selected to editor
155+
| If you use responsivefilemanager tinymce extension can copy into editor multiple object like images, videos, audios, links in the same time
156+
|
157+
*/
158+
'multiple_selection_action_button' => true,
134159

135160
/*
136161
|--------------------------------------------------------------------------
@@ -172,7 +197,7 @@
172197
| in Megabytes
173198
|
174199
*/
175-
'MaxSizeUpload' => 10000,
200+
'MaxSizeUpload' => 1,
176201

177202
/*
178203
|--------------------------------------------------------------------------
@@ -261,8 +286,8 @@
261286
//
262287
// WATERMARK IMAGE
263288
//
264-
//Watermark url or false
265-
'image_watermark' => false,
289+
//Watermark path or false
290+
'image_watermark' => "../watermark.png",
266291
# Could be a pre-determined position such as:
267292
# tl = top left,
268293
# t = top (middle),
@@ -278,7 +303,7 @@
278303
# padding: If using a pre-determined position you can
279304
# adjust the padding from the edges by passing an amount
280305
# in pixels. If using co-ordinates, this value is ignored.
281-
'image_watermark_padding' => 0,
306+
'image_watermark_padding' => 10,
282307

283308
//******************
284309
// Default layout setting
@@ -321,7 +346,7 @@
321346
// if you want you can add html,css etc.
322347
// but for security reasons it's NOT RECOMMENDED!
323348
'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),
324-
349+
325350
// Preview with Google Documents
326351
'googledoc_enabled' => true,
327352
'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' , 'pdf', 'odt', 'odp', 'ods'),
@@ -337,12 +362,19 @@
337362
//**********************
338363
//Allowed extensions (lowercase insert)
339364
//**********************
340-
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
341-
'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
365+
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'ico' ), //Images
366+
'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
342367
'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video
343368
'ext_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio
344369
'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives
345370

371+
372+
//*********************
373+
// If you insert an extensions blacklist array the filemanager don't check any extensions but simply block the extensions in the list
374+
// otherwise check Allowed extensions configuration
375+
//*********************
376+
'ext_blacklist' => false, //['jpg'],
377+
346378
/******************
347379
* AVIARY config
348380
*******************/
@@ -389,8 +421,8 @@
389421
'fixed_path_from_filemanager' => array( '../test/', '../test1/' ), //fixed path of the image folder from the current position on upload folder
390422
'fixed_image_creation_name_to_prepend' => array( '', 'test_' ), //name to prepend on filename
391423
'fixed_image_creation_to_append' => array( '_test', '' ), //name to appendon filename
392-
'fixed_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
393-
'fixed_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
424+
'fixed_image_creation_width' => array( 300, 400 ), //width of image
425+
'fixed_image_creation_height' => array( 200, 300 ), //height of image
394426
/*
395427
# $option: 0 / exact = defined size;
396428
# 1 / portrait = keep aspect set height;
@@ -410,8 +442,8 @@
410442
'relative_path_from_current_pos' => array( './', './' ), //relative path of the image folder from the current position on upload folder
411443
'relative_image_creation_name_to_prepend' => array( '', '' ), //name to prepend on filename
412444
'relative_image_creation_name_to_append' => array( '_thumb', '_thumb1' ), //name to append on filename
413-
'relative_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
414-
'relative_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
445+
'relative_image_creation_width' => array( 300, 400 ), //width of image
446+
'relative_image_creation_height' => array( 200, 300 ), //height of image
415447
/*
416448
# $option: 0 / exact = defined size;
417449
# 1 / portrait = keep aspect set height;

filemanager/dialog.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@
4444
$subdir_path = '';
4545
if (isset($_GET['fldr']) && !empty($_GET['fldr'])) {
4646
$subdir_path = rawurldecode(trim(strip_tags($_GET['fldr']),"/"));
47+
}elseif(isset($_SESSION['RF']['fldr']) && !empty($_SESSION['RF']['fldr'])){
48+
$subdir_path = rawurldecode(trim(strip_tags($_SESSION['RF']['fldr']),"/"));
4749
}
4850
if (strpos($subdir_path,'../') === FALSE
4951
&& strpos($subdir_path,'./') === FALSE
5052
&& strpos($subdir_path,'..\\') === FALSE
5153
&& strpos($subdir_path,'.\\') === FALSE)
5254
{
5355
$subdir = strip_tags($subdir_path) ."/";
56+
$_SESSION['RF']['fldr'] = $subdir_path;
5457
$_SESSION['RF']["filter"]='';
5558
}
5659
else { $subdir = ''; }
@@ -352,7 +355,6 @@
352355

353356
<script>
354357
var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
355-
var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
356358
var image_editor=<?php echo $aviary_active?"true":"false";?>;
357359
if (image_editor) {
358360
var featherEditor = new Aviary.Feather({
@@ -432,6 +434,7 @@
432434
<input type="hidden" id="cur_dir" value="<?php echo $cur_dir;?>" />
433435
<input type="hidden" id="cur_dir_thumb" value="<?php echo $thumbs_path.$subdir;?>" />
434436
<input type="hidden" id="insert_folder_name" value="<?php echo trans('Insert_Folder_Name');?>" />
437+
<input type="hidden" id="rename_existing_folder" value="<?php echo trans('Rename_existing_folder');?>" />
435438
<input type="hidden" id="new_folder" value="<?php echo trans('New_Folder');?>" />
436439
<input type="hidden" id="ok" value="<?php echo trans('OK');?>" />
437440
<input type="hidden" id="cancel" value="<?php echo trans('Cancel');?>" />
@@ -671,7 +674,7 @@
671674
'date'=>$date,
672675
'size'=>$size,
673676
'permissions' => $file['permissions'],
674-
'extension'=>strtolower($file_ext)
677+
'extension'=>fix_strtolower($file_ext)
675678
);
676679
}else{
677680

@@ -692,7 +695,7 @@
692695
'date'=>$date,
693696
'size'=>$size,
694697
'permissions' =>'',
695-
'extension'=>strtolower($file_ext)
698+
'extension'=>fix_strtolower($file_ext)
696699
);
697700
if($show_folder_size){
698701
$sorted[$k]['nfiles'] = $nfiles;
@@ -923,7 +926,7 @@ function extensionSort($x, $y) {
923926

924927
foreach ($files as $file_array) {
925928
$file=$file_array['file'];
926-
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)){
929+
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)){
927930
continue;
928931
}
929932
$new_name=fix_filename($file,$config);
@@ -989,14 +992,14 @@ function extensionSort($x, $y) {
989992
<input type="hidden" class="name" value="<?php echo $file_array['file_lcase'];?>"/>
990993
<input type="hidden" class="date" value="<?php echo $file_array['date'];?>"/>
991994
<input type="hidden" class="size" value="<?php echo $file_array['size'];?>"/>
992-
<input type="hidden" class="extension" value="<?php echo trans('Type_dir');?>"/>
995+
<input type="hidden" class="extension" value="<?php echo fix_strtolower(trans('Type_dir'));?>"/>
993996
<div class="file-date"><?php echo date(trans('Date_type'),$file_array['date']);?></div>
994997
<?php if($show_folder_size){ ?>
995998
<div class="file-size"><?php echo makeSize($file_array['size']);?></div>
996999
<input type="hidden" class="nfiles" value="<?php echo $file_array['nfiles'];?>"/>
9971000
<input type="hidden" class="nfolders" value="<?php echo $file_array['nfolders'];?>"/>
9981001
<?php } ?>
999-
<div class='file-extension'><?php echo trans('Type_dir');?></div>
1002+
<div class='file-extension'><?php echo fix_strtolower(trans('Type_dir'));?></div>
10001003
<figcaption>
10011004
<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;?>">
10021005
<i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white';?>"></i></a>
@@ -1015,7 +1018,7 @@ function extensionSort($x, $y) {
10151018
foreach ($files as $nu=>$file_array) {
10161019
$file=$file_array['file'];
10171020

1018-
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))
1021+
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))
10191022
continue;
10201023
foreach ( $hidden_files as $hidden_file ) {
10211024
if ( fnmatch($hidden_file, $file, FNM_PATHNAME) ) {

filemanager/execute.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ function returnPaths($_path,$_name,$config){
156156
$name = fix_filename($_POST['name'],$config);
157157
$path .= $name;
158158
$path_thumb .= $name;
159-
create_folder(fix_path($path,$config),fix_path($path_thumb,$config),$ftp,$config);
159+
$res = create_folder(fix_path($path,$config),fix_path($path_thumb,$config),$ftp,$config);
160+
if(!$res){
161+
response(trans('Rename_existing_folder').AddErrorLocation())->send();
162+
}
160163
}
161164
break;
162165
case 'rename_folder':

filemanager/include/mime_type_lib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"application/x-bcpio" => "bcpio",
1010
"application/octet-stream" => "so",
1111
"image/bmp" => "bmp",
12+
"application/x-rar" => "rar",
1213
"application/x-bzip2" => "bz2",
1314
"application/x-netcdf" => "nc",
1415
"application/x-kchart" => "chrt",

filemanager/include/utils.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,24 @@ function create_folder($path = null, $path_thumbs = null,$ftp = null,$config = n
519519
$ftp->mkdir($path);
520520
$ftp->mkdir($path_thumbs);
521521
}else{
522+
if(file_exists($path)){
523+
return false;
524+
}
522525
$oldumask = umask(0);
523-
if ($path && ! file_exists($path))
526+
if ($path && !file_exists($path))
524527
{
525-
$permission = 0755;
528+
$permission = $config['folderPermission'];
526529
if(isset($config['folderPermission'])){
527530
$permission = $config['folderPermission'];
528531
}
529532
mkdir($path, $permission, true);
530533
} // or even 01777 so you get the sticky bit set
531534
if ($path_thumbs && ! file_exists($path_thumbs))
532535
{
533-
mkdir($path_thumbs, 0755, true) or die("$path_thumbs cannot be found");
536+
mkdir($path_thumbs, $config['folderPermission'], true) or die("$path_thumbs cannot be found");
534537
} // or even 01777 so you get the sticky bit set
535538
umask($oldumask);
539+
return true;
536540
}
537541
}
538542

0 commit comments

Comments
 (0)