Plugin Directory

Changeset 3186518


Ignore:
Timestamp:
11/12/2024 01:03:05 PM (2 years ago)
Author:
ninjateam
Message:

Version 1.8.5

Location:
filester/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • filester/trunk/assets/js/file_manager_admin.js

    r2965824 r3186518  
    302302        });
    303303    })
     304  },
     305  fsConnector() {
     306    jQuery('#njt-fs-file-manager').elfinder({
     307      url: ajaxurl,
     308      handlers : {
     309        dblclick : function(event, elfinderInstance) {
     310          event.preventDefault();
     311          elfinderInstance.exec('getfile')
     312          .done(function() {
     313            try {
     314              elfinderInstance.exec('edit');
     315            } catch (e) {
     316              elfinderInstance.exec('quicklook');
     317            }
     318          })
     319          .fail(function() { elfinderInstance.exec('open');});
     320        }
     321      },
     322      // disable quicklook
     323      // bootCallback : function(fm) {
     324      //     fm.bind('init', function() {
     325      //         fm._commands.quicklook.getstate = function() {
     326      //             return -1;
     327      //         }
     328      //     });
     329      // },
     330      getFileCallback : function(files, fm) {
     331        return false;
     332      },
     333      contextmenu: {
     334        // current directory file menu
     335        files: ['getfile', '|', 'open', 'opennew', 'download', 'opendir', 'quicklook', 'email', '|', 'upload',
     336          'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', 'edit',
     337          'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod',
     338          'netunmount'
     339        ],
     340        // navbarfolder menu
     341        navbar: ['open', 'opennew', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate',
     342          '|', 'rm', 'empty', 'hide', '|', 'rename', '|', 'archive', '|', 'places', 'info', 'chmod',
     343          'netunmount'
     344        ],
     345        // current directory menu
     346        cwd: ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|',
     347          'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod',
     348          'netunmount',
     349          '|', 'fullscreen', '|'
     350        ],
     351      },
     352      uiOptions: {
     353        // toolbar configuration
     354        toolbar: [
     355          ['home', 'back', 'forward', 'up', 'reload'],
     356          ['netmount'],
     357          ['mkdir', 'mkfile', 'upload'],
     358          ['open', 'download', 'getfile'],
     359          ['undo', 'redo'],
     360          ['copy', 'cut', 'paste', 'rm', 'empty'],
     361          ['duplicate', 'rename', 'edit', 'resize', 'chmod'],
     362          ['selectall', 'selectnone', 'selectinvert'],
     363          ['quicklook', 'info'],
     364          ['extract', 'archive'],
     365          ['search'],
     366          ['view', 'sort'],
     367          ['help'],
     368          ['fullscreen']
     369        ],
     370        toolbarExtra: {
     371          // show Preference button into contextmenu of the toolbar (true / false)
     372          preferenceInContextmenu: false
     373        }
     374      },
     375      ui: ['toolbar', 'tree', 'path', 'stat'],
     376      customData: {
     377        action: 'fs_connector',
     378        nonce: wpData.nonce_connector,
     379      },
     380      lang: wpData.lang,
     381      requestType: 'get',
     382      width: 'auto',
     383      height: '600',
     384    });
    304385  }
    305386}
    … …  
    332413      jQuery(".elfinder-theme-ext").remove()
    333414    }
     415    njtFileManager.fsConnector();
     416
    334417  }
    335418});
  • filester/trunk/includes/File_manager/FileManager.php

    r3132353 r3186518  
    248248                $locale = $this->options['njt_fs_file_manager_settings']['fm_locale'];
    249249                if( !empty($locale) &&  $locale != 'en' ) {
     250                    $locale = sanitize_file_name($locale);
    250251                    wp_enqueue_script( 'njt_fs_fma_lang', plugins_url('lib/js/i18n/elfinder.'.$locale.'.js', __FILE__));
    251252                }
    252253            }
    253            
     254
    254255            wp_localize_script('njt_fs_elFinder', 'wpData', array(
    255256                'admin_ajax' => admin_url('admin-ajax.php'),
    … …  
    259260                'PLUGIN_DIR'=> NJT_FS_BN_PLUGIN_DIR,
    260261                'ABSPATH'=> str_replace("\\", "/", ABSPATH),
    261                 'is_multisite' => is_multisite()
    262 
     262                'is_multisite' => is_multisite(),
     263                'lang' => !empty( $this->options['njt_fs_file_manager_settings']['fm_locale']) ? $this->options['njt_fs_file_manager_settings']['fm_locale'] : '',
     264                'nonce_connector' => wp_create_nonce('file-manager-security-token'),
    263265            ));
    264266        }
    … …  
    285287                    'uploadMaxSize' =>  $uploadMaxSize .'M',
    286288                    'winHashFix'    => DIRECTORY_SEPARATOR !== '/',
    287                     'uploadDeny'    => array(),
    288                     'uploadAllow'   => array('all'),
    289289                    'uploadOrder'   => array('deny', 'allow'),
    290290                    'disabled' => array(''),
    … …  
    294294            ),
    295295        );
     296
     297        if (current_user_can('manage_options')) {
     298            $opts['roots'][0]['uploadDeny'] = array('htaccess');
     299            $opts['roots'][0]['uploadAllow'] = array('all');
     300        }
     301
    296302        // .htaccess
    297303        if(isset($this->options['njt_fs_file_manager_settings']['enable_htaccess']) && ($this->options['njt_fs_file_manager_settings']['enable_htaccess'] == '1')) {
    … …  
    314320                'tmbURL'        => site_url() . '/includes/File_manager/lib/files/.trash/.tmb',
    315321                'winHashFix'    => DIRECTORY_SEPARATOR !== '/',
    316                 'uploadDeny'    => array(),
     322                'uploadDeny'    => array('htaccess'),
    317323                'uploadAllow'   => array('all'),
    318324                'uploadOrder'   => array('deny', 'allow'),
  • filester/trunk/ninja-file-manager.php

    r3132353 r3186518  
    44 * Plugin URI: https://ninjateam.org/filester
    55 * Description: Made to help you focus on WordPress file management and avoid being distracted.
    6  * Version: 1.8.4
     6 * Version: 1.8.5
    77 * Author: Ninja Team
    88 * Author URI: https://ninjateam.org
    … …  
    3232
    3333define('NJT_FS_BN_PREFIX', 'njt-fs');
    34 define('NJT_FS_BN_VERSION', '1.8.4');
     34define('NJT_FS_BN_VERSION', '1.8.5');
    3535define('NJT_FS_BN_DOMAIN', 'filester');
    3636
  • filester/trunk/readme.txt

    r3132353 r3186518  
    44Tags: file manager, wordpress file manager, wp file manager, files, download plugin
    55Requires at least: 3.0
    6 Tested up to: 6.6
    7 Stable tag: 1.8.4
     6Tested up to: 6.7
     7Stable tag: 1.8.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    112112== Changelog ==
    113113
     114= 1.8.5 =
     115Nov 12, 2024 - Version 1.8.5
     116- Fixed: Security
     117
    114118= 1.8.4 =
    115119Aug 7, 2024 - Version 1.8.4
  • filester/trunk/views/pages/html-filemanager.php

    r2965824 r3186518  
    3232  </div>
    3333</div>
    34 
    35 
    36 <script>
    37 jQuery(document).ready(function() {
    38   jQuery('#njt-fs-file-manager').elfinder({
    39     url: ajaxurl,
    40     handlers : {
    41       dblclick : function(event, elfinderInstance) {
    42         event.preventDefault();
    43         elfinderInstance.exec('getfile')
    44         .done(function() {
    45           try {
    46             elfinderInstance.exec('edit');
    47           } catch (e) {
    48             elfinderInstance.exec('quicklook');
    49           }
    50         })
    51         .fail(function() { elfinderInstance.exec('open');});
    52       }
    53     },
    54     // disable quicklook
    55     // bootCallback : function(fm) {
    56     //     fm.bind('init', function() {
    57     //         fm._commands.quicklook.getstate = function() {
    58     //             return -1;
    59     //         }
    60     //     });
    61     // },
    62     getFileCallback : function(files, fm) {
    63       return false;
    64     },
    65     contextmenu: {
    66       // current directory file menu
    67       files: ['getfile', '|', 'open', 'opennew', 'download', 'opendir', 'quicklook', 'email', '|', 'upload',
    68         'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', 'edit',
    69         'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod',
    70         'netunmount'
    71       ],
    72       // navbarfolder menu
    73       navbar: ['open', 'opennew', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate',
    74         '|', 'rm', 'empty', 'hide', '|', 'rename', '|', 'archive', '|', 'places', 'info', 'chmod',
    75         'netunmount'
    76       ],
    77       // current directory menu
    78       cwd: ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|',
    79         'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod',
    80         'netunmount',
    81         '|', 'fullscreen', '|'
    82       ],
    83     },
    84     uiOptions: {
    85       // toolbar configuration
    86       toolbar: [
    87         ['home', 'back', 'forward', 'up', 'reload'],
    88         ['netmount'],
    89         ['mkdir', 'mkfile', 'upload'],
    90         ['open', 'download', 'getfile'],
    91         ['undo', 'redo'],
    92         ['copy', 'cut', 'paste', 'rm', 'empty'],
    93         ['duplicate', 'rename', 'edit', 'resize', 'chmod'],
    94         ['selectall', 'selectnone', 'selectinvert'],
    95         ['quicklook', 'info'],
    96         ['extract', 'archive'],
    97         ['search'],
    98         ['view', 'sort'],
    99         ['help'],
    100         ['fullscreen']
    101       ],
    102       toolbarExtra: {
    103         // show Preference button into contextmenu of the toolbar (true / false)
    104         preferenceInContextmenu: false
    105       }
    106     },
    107     ui: ['toolbar', 'tree', 'path', 'stat'],
    108     customData: {
    109       action: 'fs_connector',
    110       nonce: '<?php echo wp_create_nonce( "file-manager-security-token" ); ?>'
    111     },
    112     lang: '<?php echo ($lang)?>',
    113     requestType: 'post',
    114     width: 'auto',
    115     height: '600',
    116   });
    117 });
    118 </script>
Note: See TracChangeset for help on using the changeset viewer.