Changeset 2669537
- Timestamp:
- 01/31/2022 05:51:08 AM (4 years ago)
- Location:
- wp-file-manager/trunk
- Files:
-
- 8 edited
-
css/fm_common.css (modified) (1 diff)
-
file_folder_manager.php (modified) (22 diffs)
-
inc/root.php (modified) (1 diff)
-
js/file_manager_free_shortcode_admin.js (modified) (5 diffs)
-
js/top.js (modified) (1 diff)
-
lib/js/commands/info.js (modified) (1 diff)
-
lib/js/elFinder.options.js (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-file-manager/trunk/css/fm_common.css
r2505680 r2669537 3 3 padding-top: 5px !important; 4 4 } 5 .wp-filemanager-wrap .elfinder-touch .elfinder-cwd tr.elfinder-cwd-file td .elfinder-cwd-select, .wp-filemanager-wrap .elfinder .elfinder-cwd table thead td .elfinder-cwd-selectall { 6 display: none; 7 } -
wp-file-manager/trunk/file_folder_manager.php
r2649873 r2669537 5 5 Description: Manage your WP files. 6 6 Author: mndpsingh287 7 Version: 7.1. 37 Version: 7.1.4 8 8 Author URI: https://profiles.wordpress.org/mndpsingh287 9 9 License: GPLv2 … … 17 17 { 18 18 protected $SERVER = 'http://ikon.digital/plugindata/api.php'; 19 var $ver = '7.1. 3';19 var $ver = '7.1.4'; 20 20 /* Auto Load Hooks */ 21 21 public function __construct() 22 22 { 23 23 add_action('admin_menu', array(&$this, 'ffm_menu_page')); 24 add_action('network_admin_menu', array(&$this, 'ffm_menu_page')); 24 25 add_action('admin_enqueue_scripts', array(&$this, 'ffm_admin_things')); 25 26 add_action('admin_enqueue_scripts', array(&$this, 'ffm_admin_script')); … … 73 74 // security fix 74 75 $myfile = $backup_dirname."/.htaccess"; 75 $myfileHandle = @fopen($myfile, 'wr'); 76 $txt = '<FilesMatch "\.(zip|gz)$">'; 77 $txt .= "\nOrder allow,deny\n"; 78 $txt .= "Deny from all\n"; 79 $txt .= "</Files>"; 80 @fwrite($myfileHandle, $txt); 81 @fclose($myfileHandle); 82 83 // creating bank index.php inside fm_backup 76 if(!file_exists($myfile)){ 77 $myfileHandle = @fopen($myfile, 'w+'); 78 if(!is_bool($myfileHandle)){ 79 $txt = '<FilesMatch "\.(zip|gz)$">'; 80 $txt .= "\nOrder allow,deny\n"; 81 $txt .= "Deny from all\n"; 82 $txt .= "</Files>"; 83 @fwrite($myfileHandle, $txt); 84 @fclose($myfileHandle); 85 } 86 } 87 88 // creating blank index.php inside fm_backup 84 89 $ourFileName = $backup_dirname."/index.html"; 85 $ourFileHandle = @fopen($ourFileName, 'w'); 86 @fclose($ourFileHandle); 87 @chmod($ourFileName, 0755); 90 if(!file_exists($ourFileName)){ 91 $ourFileHandle = @fopen($ourFileName, 'w'); 92 if(!is_bool($ourFileHandle)){ 93 @fclose($ourFileHandle); 94 @chmod($ourFileName, 0755); 95 } 96 } 88 97 } 89 98 /* … … 125 134 }else{ 126 135 $backup_path = $backup_dirname."/"; 127 128 136 } 129 137 … … 139 147 $wpdb->prepare('select * from '.$fmdb.' where id = %d', $bkpid) 140 148 ); 141 142 149 if($themes == 'true') { 143 150 // case 1 - Themes … … 158 165 } 159 166 else if($uploads == 'true'){ 160 // case 2 - Uploads 167 // case 2 - Uploads 168 if ( is_multisite() ) { 169 $path_direc = $upload_dir['basedir']; 170 } else { 171 $path_direc = $filesDestination.'uploads'; 172 } 161 173 if(file_exists($backup_dirname.$fmbkp->backup_name.'-uploads.zip')) { 162 $alllist = $wp_filesystem->dirlist($ filesDestination.'uploads');174 $alllist = $wp_filesystem->dirlist($path_direc); 163 175 if(is_array($alllist) && !empty($alllist)) 164 176 { … … 167 179 if($key!= 'wp-file-manager-pro') 168 180 { 169 $wp_filesystem->delete($ filesDestination.'uploads/'.$key,true);181 $wp_filesystem->delete($path_direc.'/'.$key,true); 170 182 } 171 183 } 172 184 } 173 185 174 $restoreUploads = $restoreFiles->extract($backup_dirname.$fmbkp->backup_name.'-uploads.zip',$ filesDestination.'uploads');175 if($restoreUploads) {176 echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-checked">Uploads backup restored successfully.</li>', 'wp-file-manager')));186 $restoreUploads = $restoreFiles->extract($backup_dirname.$fmbkp->backup_name.'-uploads.zip',$path_direc); 187 if($restoreUploads) { 188 echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-checked">Uploads backup restored successfully.</li>', 'wp-file-manager'))); 177 189 die; 178 190 … … 182 194 183 195 } 184 } else {196 } else { 185 197 echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => '')); 186 198 die; … … 215 227 echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => 'false','bkpid' => $bkpid,'msg' => '')); 216 228 die; 217 218 } 219 229 } 220 230 } 221 231 else if($plugins == 'true'){ 222 // case 4- Plugins232 // case 4- Plugins 223 233 if(file_exists($backup_path.$fmbkp->backup_name.'-plugins.zip')) { 224 234 $alllist = $wp_filesystem->dirlist($filesDestination.'plugins'); … … 242 252 echo json_encode(array('step' => 1, 'database' => $database,'plugins' => 'false','themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore plugins.</li>', 'wp-file-manager'))); 243 253 die; 244 245 254 } 246 255 }else { … … 253 262 // case 5- Database 254 263 if(file_exists($backup_dirname.$fmbkp->backup_name.'-db.sql.gz')) { 255 256 264 include('classes/db-restore.php'); 257 265 $restoreDatabase = new Restore_Database($fmbkp->backup_name.'-db.sql.gz'); … … 259 267 echo json_encode(array('step' => 0, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => '','msg' => __('<li class="fm-running-list fm-custom-checked">Database backup restored successfully.</li>', 'wp-file-manager'), 'msgg' => __('<li class="fm-running-list fm-custom-checked">All Done</li>', 'wp-file-manager'))); 260 268 die; 261 262 269 } else { 263 270 echo json_encode(array('step' => 0, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore DB backup.</li>', 'wp-file-manager'))); … … 267 274 echo json_encode(array('step' => 1, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => '')); 268 275 die; 269 270 276 } 271 277 }else { … … 276 282 echo json_encode(array('step' => 0, 'database' => 'false','plugins' => 'false','themes' => 'false', 'uploads'=> 'false', 'others' => 'false','bkpid' => '','msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore plugins.</li>', 'wp-file-manager'))); 277 283 die; 278 279 284 } 280 285 die; … … 854 859 855 860 wp_enqueue_script('fm_elFinder', plugins_url('lib/js/elFinder.js', __FILE__), '', $this->ver); 861 wp_enqueue_script('fm_elFinder', plugins_url('lib/js/elFinder.min.js', __FILE__), '', $this->ver); 856 862 wp_enqueue_script('fm_elFinder_version', plugins_url('lib/js/elFinder.version.js', __FILE__), '', $this->ver); 857 863 wp_enqueue_script('fm_jquery_elfinder', plugins_url('lib/js/jquery.elfinder.js', __FILE__), '', $this->ver); … … 976 982 'lang' => isset($_GET['lang']) ? sanitize_text_field(htmlentities($_GET['lang'])) : (($wp_fm_lang !== false) ? $wp_fm_lang : 'en'), 977 983 'fm_enable_media_upload' => (isset($opt['fm_enable_media_upload']) && $opt['fm_enable_media_upload'] == '1') ? '1' : '0', 984 'is_multisite'=> is_multisite() ? '1' : '0', 985 'network_url'=> is_multisite() ? network_home_url() : '', 978 986 ) 979 987 ); … … 1060 1068 $mkTrashHash = ''; 1061 1069 } 1070 1071 $path_url = site_url(); 1072 1073 if(is_multisite()){ 1074 $path_url = network_home_url(); 1075 } 1062 1076 $opts = array( 1063 1077 'debug' => false, … … 1066 1080 'driver' => 'LocalFileSystem', 1067 1081 'path' => $path, 1068 'URL' => site_url(),1082 'URL' => $path_url, 1069 1083 'trashHash' => $mkTrashHash, 1070 1084 'winHashFix' => DIRECTORY_SEPARATOR !== '/', … … 1240 1254 $uploadedfiles = isset($_POST['uploadefiles']) ? $_POST['uploadefiles'] : ''; 1241 1255 if(!empty($uploadedfiles)) { 1242 $files = '';1243 $fileCount = 1;1244 1256 foreach($uploadedfiles as $uploadedfile) { 1245 /* Start - Uploading Image to Media Lib */ 1246 $uploadedfile = esc_url_raw($uploadedfile); 1247 $this->upload_to_media_library($uploadedfile); 1248 /* End - Uploading Image to Media Lib */ 1249 } 1250 } 1251 } 1252 die; 1257 $uploadedfile = esc_url_raw($uploadedfile); 1258 /* Start - Uploading Image to Media Lib */ 1259 if(is_multisite() && isset($_REQUEST['networkhref']) && !empty($_REQUEST['networkhref'])) 1260 { 1261 $network_home = network_home_url(); 1262 $uploadedfile = $network_home.basename($uploadedfile); 1263 } 1264 $this->upload_to_media_library($uploadedfile); 1265 /* End - Uploading Image to Media Lib */ 1266 } 1267 } 1268 } 1269 die; 1253 1270 } 1254 1271 /* Upload Images to Media Library */ … … 1282 1299 require_once(ABSPATH . "wp-admin" . '/includes/media.php'); 1283 1300 } 1284 1301 1285 1302 $tmp = download_url( $url ); 1286 1303 $post_id = 0; … … 1304 1321 } 1305 1322 } 1306 1323 1324 /** 1325 * Function to download backup 1326 */ 1327 1307 1328 public function fm_download_backup($request){ 1308 1329 $params = $request->get_params(); 1309 if(isset($params["backup_id"]) && !empty(trim($params["backup_id"])) && isset($params["type"]) && !empty(trim($params["type"]))){ 1330 $backup_id = isset($params["backup_id"]) ? trim($params["backup_id"]) : ''; 1331 $type = isset($params["type"]) ? trim($params["type"]) : ''; 1332 if(!empty($backup_id) && !empty($type)){ 1310 1333 $id = (int) base64_decode(trim($params["backup_id"])); 1311 1334 $type = base64_decode(trim($params["type"])); … … 1372 1395 } 1373 1396 1397 /** 1398 * Function to download all backup zip in one 1399 */ 1400 1374 1401 public function fm_download_backup_all($request){ 1375 1402 $params = $request->get_params(); 1376 if(isset($params["backup_id"]) && !empty(trim($params["backup_id"])) && isset($params["type"]) && !empty(trim($params["type"])) && !empty(trim($params["all"])) ){ 1403 $backup_id = isset($params["backup_id"]) ? trim($params["backup_id"]) : ''; 1404 $type = isset($params["type"]) ? trim($params["type"]) : ''; 1405 $all = isset($params["all"]) ? trim($params["all"]) : ''; 1406 if(!empty($backup_id) && !empty($type) && !empty($all)){ 1377 1407 $id = (int) base64_decode(trim($params["backup_id"])); 1378 1408 $type = base64_decode(trim($params["type"])); -
wp-file-manager/trunk/inc/root.php
r2649873 r2669537 4 4 if (isset($_POST['submit']) && wp_verify_nonce(sanitize_text_field($_POST['wp_filemanager_root_nonce_field']), 'wp_filemanager_root_action')) { 5 5 if(isset($_POST['fm_max_packet_allowed'])){ 6 $packet_value = intval($_POST['fm_max_packet_allowed'] * 1000000); 6 $fm_max_packet_allowed = intval($_POST['fm_max_packet_allowed']); 7 $packet_value = intval($fm_max_packet_allowed * 1000000); 8 if($packet_value == 0){ 9 $max_allowed_packet = 'max_allowed_packet'; 10 $packet_obj = $wpdb->get_row( $wpdb->prepare( "SHOW SESSION VARIABLES WHERE (variable_name = %s)", $max_allowed_packet ) ); 11 $packet_value = intval($packet_obj->Value); 12 } 13 7 14 $set_packet_value = $wpdb->query($wpdb->prepare("SET GLOBAL max_allowed_packet = %d",$packet_value)); 8 15 } -
wp-file-manager/trunk/js/file_manager_free_shortcode_admin.js
r2649873 r2669537 3 3 var fmlang = fmfparams.lang; 4 4 var ajaxurl = fmfparams.ajaxurl; 5 var href = fm_get_network_url(); 5 6 jQuery("#wp_file_manager") 6 7 .elfinder({ … … 9 10 action: "mk_file_folder_manager", 10 11 _wpnonce: security_key, 12 networkhref:href, 11 13 }, 12 14 uploadMaxChunkSize: 1048576000000, … … 27 29 filepaths.push(file.url); 28 30 } 31 29 32 if (filepaths != "") { 30 33 var data = { … … 32 35 uploadefiles: filepaths, 33 36 _wpnonce: security_key, 37 networkhref:href, 34 38 }; 35 39 jQuery.post(ajaxurl, data, function (response) {}); … … 125 129 uiOptions : { 126 130 toolbarExtra : { 131 autoHideUA: [], 127 132 displayTextLabel: false, 128 133 preferenceInContextmenu: false -
wp-file-manager/trunk/js/top.js
r2305567 r2669537 1 1 var $ = jQuery; 2 function fm_get_network_url(){ 3 var urlhash = window.location.hash; 4 var href = ''; 5 if(urlhash){ 6 var arr = urlhash.split('_'); 7 var lastItem = arr.pop(); 8 var txt = decodeURIComponent(escape(window.atob(lastItem))); 9 10 if(fmfparams.is_multisite == '1') 11 { 12 if(txt == '/') 13 { 14 href = fmfparams.network_url; 15 } 16 } 17 } 18 return href; 19 } -
wp-file-manager/trunk/lib/js/commands/info.js
r2649873 r2669537 185 185 } else { 186 186 href = fm.url(file.hash); 187 var network_href = fm_get_network_url(); 188 if(network_href) { 189 var filename = href.substring(href.lastIndexOf('/') + 1); 190 href = network_href+filename; 191 } 187 192 } 188 193 href && content.push(row.replace(l, msg.link).replace(v, '<a href="'+href+'" target="_blank">'+name_esc+'</a>')); -
wp-file-manager/trunk/lib/js/elFinder.options.js
r2649873 r2669537 799 799 * @full ['toolbar', 'places', 'tree', 'path', 'stat'] 800 800 */ 801 ui : ['toolbar', ' places', 'tree', 'path', 'stat'],801 ui : ['toolbar', 'tree', 'path', 'stat'], 802 802 803 803 /** … … 820 820 ['search'], 821 821 ['view', 'sort'], 822 ['preference', 'help'],823 822 ['fullscreen'] 824 823 ], … … 837 836 showPreferenceButton: 'none', 838 837 // show Preference button into contextmenu of the toolbar (true / false) 839 preferenceInContextmenu: true838 preferenceInContextmenu: false 840 839 }, 841 840 // directories tree options … … 1307 1306 navbar : ['open', 'opennew', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', '|', 'archive', '|', 'places', 'info', 'chmod', 'netunmount'], 1308 1307 // current directory menu 1309 cwd : ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod', 'netunmount', '|', 'fullscreen' , '|', 'preference'],1308 cwd : ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod', 'netunmount', '|', 'fullscreen'], 1310 1309 // current directory file menu 1311 1310 files : ['getfile', '|' ,'open', 'opennew', 'download', 'opendir', 'quicklook', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', 'edit', 'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod', 'netunmount'] -
wp-file-manager/trunk/readme.txt
r2649873 r2669537 3 3 Tags: wp-file-manager, elfinder,file manager, ftp, wp-filemanager,file manager, wp-filemanager, Upload Files, WP File Manager, File Manage, Edit Files, Delete Files, FTP, filemanager, wpfilemanager, ftp, file transfer, update, create, delete, view, rename, editor, Cpanel, Control Panel, Admin, Shortcode, explorer, file explorer, filemanager 4 4 Requires at least: 4.0 5 Tested up to: 5. 8.25 Tested up to: 5.9 6 6 Requires PHP: 5.2.4 7 Stable tag: 7.1. 37 Stable tag: 7.1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 139 139 == Changelog == 140 140 141 = 7.1.4 (27th Jan, 2022) = 142 143 * Fixed compatibility issue with PHP > 8 144 * Fixed issue of fatal error on activating plugin 145 * Fixed compatibility issue of restore backup in multisite 146 * Fixed autohide toolbar issue for Ipad 147 141 148 = 7.1.3 (28th Dec, 2021) = 142 149
Note: See TracChangeset
for help on using the changeset viewer.