@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | // SERVER OVERRIDE |
| 35 | 35 | if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){ |
| 36 | - $MaxSizeUpload = (int)(ini_get('post_max_size')); |
|
| 36 | + $MaxSizeUpload = (int)(ini_get('post_max_size')); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $default_language = "en_EN"; //default language file name |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | // | | | |- responsivefilemanager |
| 20 | 20 | // | | | | |- plugin.min.js |
| 21 | 21 | |
| 22 | -$base_url ="http://".$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)). |
|
| 22 | +$base_url = "http://".$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)). |
|
| 23 | 23 | $upload_dir = '/source/'; // path from base_url to base of upload folder (with start and final /) |
| 24 | 24 | $current_path = '../source/'; // relative path from filemanager folder to upload folder (with final /) |
| 25 | 25 | //thumbs folder can't put inside upload folder |
@@ -32,16 +32,16 @@ discard block |
||
| 32 | 32 | $MaxSizeUpload = 100; //Mb |
| 33 | 33 | |
| 34 | 34 | // SERVER OVERRIDE |
| 35 | -if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){ |
|
| 35 | +if ((int)(ini_get('post_max_size')) < $MaxSizeUpload) { |
|
| 36 | 36 | $MaxSizeUpload = (int)(ini_get('post_max_size')); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $default_language = "en_EN"; //default language file name |
| 40 | -$icon_theme = "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img |
|
| 40 | +$icon_theme = "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img |
|
| 41 | 41 | $show_folder_size = TRUE; //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations) |
| 42 | 42 | $show_sorting_bar = TRUE; //Show or not show sorting feature in filemanager |
| 43 | -$loading_bar = TRUE; //Show or not show loading bar |
|
| 44 | -$transliteration = FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters) |
|
| 43 | +$loading_bar = TRUE; //Show or not show loading bar |
|
| 44 | +$transliteration = FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters) |
|
| 45 | 45 | |
| 46 | 46 | //******************************************* |
| 47 | 47 | //Images limit and resizing configuration |
@@ -86,36 +86,36 @@ discard block |
||
| 86 | 86 | $rename_folders = TRUE; |
| 87 | 87 | $duplicate_files = TRUE; |
| 88 | 88 | $copy_cut_files = TRUE; // for copy/cut files |
| 89 | -$copy_cut_dirs = TRUE; // for copy/cut directories |
|
| 89 | +$copy_cut_dirs = TRUE; // for copy/cut directories |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | // defines size limit for paste in MB / operation |
| 93 | 93 | // set 'FALSE' for no limit |
| 94 | -$copy_cut_max_size = 100; |
|
| 94 | +$copy_cut_max_size = 100; |
|
| 95 | 95 | // defines file count limit for paste / operation |
| 96 | 96 | // set 'FALSE' for no limit |
| 97 | -$copy_cut_max_count = 200; |
|
| 97 | +$copy_cut_max_count = 200; |
|
| 98 | 98 | //IF any of these limits reached, operation won't start and generate warning |
| 99 | 99 | |
| 100 | 100 | //********************** |
| 101 | 101 | //Allowed extensions (lowercase insert) |
| 102 | 102 | //********************** |
| 103 | 103 | $ext_img = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'); //Images |
| 104 | -$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'); //Files |
|
| 105 | -$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg','wma',"flv","webm"); //Video |
|
| 106 | -$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio |
|
| 107 | -$ext_misc = array('zip', 'rar','gz','tar','iso','dmg'); //Archives |
|
| 104 | +$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'); //Files |
|
| 105 | +$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm"); //Video |
|
| 106 | +$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav'); //Audio |
|
| 107 | +$ext_misc = array('zip', 'rar', 'gz', 'tar', 'iso', 'dmg'); //Archives |
|
| 108 | 108 | |
| 109 | -$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video,$ext_music); //allowed extensions |
|
| 109 | +$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video, $ext_music); //allowed extensions |
|
| 110 | 110 | |
| 111 | 111 | /****************** |
| 112 | 112 | * AVIARY config |
| 113 | 113 | *******************/ |
| 114 | 114 | $aviary_active = TRUE; |
| 115 | -$aviary_key = "dvh8qudbp6yx2bnp"; |
|
| 116 | -$aviary_secret = "m6xaym5q42rpw433"; |
|
| 115 | +$aviary_key = "dvh8qudbp6yx2bnp"; |
|
| 116 | +$aviary_secret = "m6xaym5q42rpw433"; |
|
| 117 | 117 | $aviary_version = 3; |
| 118 | -$aviary_language= 'en'; |
|
| 118 | +$aviary_language = 'en'; |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | //The filter and sorter are managed through both javascript and php scripts because if you have a lot of |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | // path_from_filemanager/test/test1/ |
| 151 | 151 | // PS if there isn't write permission in your destination folder you must set it |
| 152 | 152 | $fixed_image_creation = FALSE; //activate or not the creation of one or more image resized with fixed path from filemanager folder |
| 153 | -$fixed_path_from_filemanager = array('../test/','../test1/'); //fixed path of the image folder from the current position on upload folder |
|
| 154 | -$fixed_image_creation_name_to_prepend = array('','test_'); //name to prepend on filename |
|
| 155 | -$fixed_image_creation_to_append = array('_test',''); //name to appendon filename |
|
| 156 | -$fixed_image_creation_width = array(300,400); //width of image (you can leave empty if you set height) |
|
| 157 | -$fixed_image_creation_height = array(200,''); //height of image (you can leave empty if you set width) |
|
| 153 | +$fixed_path_from_filemanager = array('../test/', '../test1/'); //fixed path of the image folder from the current position on upload folder |
|
| 154 | +$fixed_image_creation_name_to_prepend = array('', 'test_'); //name to prepend on filename |
|
| 155 | +$fixed_image_creation_to_append = array('_test', ''); //name to appendon filename |
|
| 156 | +$fixed_image_creation_width = array(300, 400); //width of image (you can leave empty if you set height) |
|
| 157 | +$fixed_image_creation_height = array(200, ''); //height of image (you can leave empty if you set width) |
|
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | // New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode) |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | // just simply add a value in the array |
| 163 | 163 | // The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here |
| 164 | 164 | $relative_image_creation = FALSE; //activate or not the creation of one or more image resized with relative path from upload folder |
| 165 | -$relative_path_from_current_pos = array('thumb/','thumb/'); //relative path of the image folder from the current position on upload folder |
|
| 166 | -$relative_image_creation_name_to_prepend= array('','test_'); //name to prepend on filename |
|
| 167 | -$relative_image_creation_name_to_append = array('_test',''); //name to append on filename |
|
| 168 | -$relative_image_creation_width = array(300,400); //width of image (you can leave empty if you set height) |
|
| 169 | -$relative_image_creation_height = array(200,''); //height of image (you can leave empty if you set width) |
|
| 165 | +$relative_path_from_current_pos = array('thumb/', 'thumb/'); //relative path of the image folder from the current position on upload folder |
|
| 166 | +$relative_image_creation_name_to_prepend = array('', 'test_'); //name to prepend on filename |
|
| 167 | +$relative_image_creation_name_to_append = array('_test', ''); //name to append on filename |
|
| 168 | +$relative_image_creation_width = array(300, 400); //width of image (you can leave empty if you set height) |
|
| 169 | +$relative_image_creation_height = array(200, ''); //height of image (you can leave empty if you set width) |
|
@@ -1,28 +1,28 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | include('config/config.php'); |
| 3 | -if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden'); |
|
| 3 | +if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden'); |
|
| 4 | 4 | include('include/utils.php'); |
| 5 | 5 | |
| 6 | -if(strpos($_POST['path'],'/')===0 |
|
| 7 | - || strpos($_POST['path'],'../')!==FALSE |
|
| 8 | - || strpos($_POST['path'],'./')===0) |
|
| 6 | +if (strpos($_POST['path'], '/') === 0 |
|
| 7 | + || strpos($_POST['path'], '../') !== FALSE |
|
| 8 | + || strpos($_POST['path'], './') === 0) |
|
| 9 | 9 | die('wrong path'); |
| 10 | 10 | |
| 11 | -if(strpos($_POST['name'],'/')!==FALSE) |
|
| 11 | +if (strpos($_POST['name'], '/') !== FALSE) |
|
| 12 | 12 | die('wrong path'); |
| 13 | 13 | |
| 14 | -$path=$current_path.$_POST['path']; |
|
| 15 | -$name=$_POST['name']; |
|
| 14 | +$path = $current_path.$_POST['path']; |
|
| 15 | +$name = $_POST['name']; |
|
| 16 | 16 | |
| 17 | -$info=pathinfo($name); |
|
| 18 | -if(!in_array(fix_strtolower($info['extension']), $ext)){ |
|
| 17 | +$info = pathinfo($name); |
|
| 18 | +if (!in_array(fix_strtolower($info['extension']), $ext)) { |
|
| 19 | 19 | die('wrong extension'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | header('Pragma: private'); |
| 23 | 23 | header('Cache-control: private, must-revalidate'); |
| 24 | 24 | header("Content-Type: application/octet-stream"); |
| 25 | -header("Content-Length: " .(string)(filesize($path.$name)) ); |
|
| 25 | +header("Content-Length: ".(string)(filesize($path.$name))); |
|
| 26 | 26 | header('Content-Disposition: attachment; filename="'.($name).'"'); |
| 27 | 27 | readfile($path.$name); |
| 28 | 28 | |
@@ -1,15 +1,19 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | include('config/config.php'); |
| 3 | -if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden'); |
|
| 3 | +if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") { |
|
| 4 | + die('forbiden'); |
|
| 5 | +} |
|
| 4 | 6 | include('include/utils.php'); |
| 5 | 7 | |
| 6 | 8 | if(strpos($_POST['path'],'/')===0 |
| 7 | 9 | || strpos($_POST['path'],'../')!==FALSE |
| 8 | - || strpos($_POST['path'],'./')===0) |
|
| 10 | + || strpos($_POST['path'],'./')===0) { |
|
| 9 | 11 | die('wrong path'); |
| 12 | +} |
|
| 10 | 13 | |
| 11 | -if(strpos($_POST['name'],'/')!==FALSE) |
|
| 14 | +if(strpos($_POST['name'],'/')!==FALSE) { |
|
| 12 | 15 | die('wrong path'); |
| 16 | +} |
|
| 13 | 17 | |
| 14 | 18 | $path=$current_path.$_POST['path']; |
| 15 | 19 | $name=$_POST['name']; |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | if (file_exists($path."config.php")) |
| 41 | 41 | { |
| 42 | - require_once($path."config.php"); |
|
| 43 | - $cycle = FALSE; |
|
| 42 | + require_once($path."config.php"); |
|
| 43 | + $cycle = FALSE; |
|
| 44 | 44 | } |
| 45 | 45 | $path = fix_dirname($path)."/"; |
| 46 | 46 | $cycle = FALSE; |
@@ -69,54 +69,54 @@ discard block |
||
| 69 | 69 | unlink($path); |
| 70 | 70 | if (file_exists($path_thumb)) unlink($path_thumb); |
| 71 | 71 | |
| 72 | - $info=pathinfo($path); |
|
| 73 | - if ($relative_image_creation){ |
|
| 74 | - foreach($relative_path_from_current_pos as $k=>$path) |
|
| 72 | + $info=pathinfo($path); |
|
| 73 | + if ($relative_image_creation){ |
|
| 74 | + foreach($relative_path_from_current_pos as $k=>$path) |
|
| 75 | 75 | { |
| 76 | 76 | if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/"; |
| 77 | 77 | |
| 78 | - if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])) |
|
| 78 | + if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])) |
|
| 79 | 79 | { |
| 80 | - unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']); |
|
| 81 | - } |
|
| 82 | - } |
|
| 83 | - } |
|
| 80 | + unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']); |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - if ($fixed_image_creation) |
|
| 85 | + if ($fixed_image_creation) |
|
| 86 | 86 | { |
| 87 | - foreach($fixed_path_from_filemanager as $k=>$path) |
|
| 87 | + foreach($fixed_path_from_filemanager as $k=>$path) |
|
| 88 | 88 | { |
| 89 | - if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/"; |
|
| 89 | + if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/"; |
|
| 90 | 90 | |
| 91 | - $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 92 | - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 91 | + $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 92 | + if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 93 | 93 | { |
| 94 | - unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']); |
|
| 95 | - } |
|
| 96 | - } |
|
| 97 | - } |
|
| 94 | + unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']); |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | 98 | } |
| 99 | 99 | break; |
| 100 | 100 | case 'delete_folder': |
| 101 | 101 | if ($delete_folders){ |
| 102 | - if (is_dir($path_thumb)) |
|
| 102 | + if (is_dir($path_thumb)) |
|
| 103 | 103 | { |
| 104 | - deleteDir($path_thumb); |
|
| 104 | + deleteDir($path_thumb); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if (is_dir($path)) |
|
| 107 | + if (is_dir($path)) |
|
| 108 | 108 | { |
| 109 | - deleteDir($path); |
|
| 110 | - if ($fixed_image_creation) |
|
| 109 | + deleteDir($path); |
|
| 110 | + if ($fixed_image_creation) |
|
| 111 | 111 | { |
| 112 | - foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 113 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 112 | + foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 113 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 114 | 114 | |
| 115 | - $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 116 | - if (is_dir($base_dir)) deleteDir($base_dir); |
|
| 117 | - } |
|
| 118 | - } |
|
| 119 | - } |
|
| 115 | + $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 116 | + if (is_dir($base_dir)) deleteDir($base_dir); |
|
| 117 | + } |
|
| 118 | + } |
|
| 119 | + } |
|
| 120 | 120 | } |
| 121 | 121 | break; |
| 122 | 122 | case 'create_folder': |
@@ -134,14 +134,14 @@ discard block |
||
| 134 | 134 | if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder); |
| 135 | 135 | |
| 136 | 136 | rename_folder($path_thumb,$name,$transliteration); |
| 137 | - if ($fixed_image_creation){ |
|
| 138 | - foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 139 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 137 | + if ($fixed_image_creation){ |
|
| 138 | + foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 139 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 140 | 140 | |
| 141 | 141 | $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
| 142 | - rename_folder($base_dir,$name,$transliteration); |
|
| 143 | - } |
|
| 144 | - } |
|
| 142 | + rename_folder($base_dir,$name,$transliteration); |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | 145 | } |
| 146 | 146 | else { |
| 147 | 147 | die(lang_Empty_name); |
@@ -157,28 +157,28 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | rename_file($path_thumb,$name,$transliteration); |
| 159 | 159 | |
| 160 | - if ($fixed_image_creation) |
|
| 160 | + if ($fixed_image_creation) |
|
| 161 | 161 | { |
| 162 | 162 | $info=pathinfo($path); |
| 163 | 163 | |
| 164 | - foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 164 | + foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 165 | 165 | { |
| 166 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 166 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 167 | 167 | |
| 168 | - $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 169 | - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 168 | + $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 169 | + if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 170 | 170 | { |
| 171 | - rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration); |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - } |
|
| 171 | + rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration); |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + } |
|
| 175 | 175 | } |
| 176 | 176 | else { |
| 177 | 177 | die(lang_Empty_name); |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | break; |
| 181 | - case 'duplicate_file': |
|
| 181 | + case 'duplicate_file': |
|
| 182 | 182 | if ($duplicate_files) |
| 183 | 183 | { |
| 184 | 184 | $name = fix_filename($name,$transliteration); |
@@ -191,18 +191,18 @@ discard block |
||
| 191 | 191 | if ($fixed_image_creation) |
| 192 | 192 | { |
| 193 | 193 | $info=pathinfo($path); |
| 194 | - foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 194 | + foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 195 | 195 | { |
| 196 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/"; |
|
| 196 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/"; |
|
| 197 | 197 | |
| 198 | - $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 198 | + $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 199 | 199 | |
| 200 | - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 200 | + if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
|
| 201 | 201 | { |
| 202 | - duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]); |
|
| 203 | - } |
|
| 204 | - } |
|
| 205 | - } |
|
| 202 | + duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]); |
|
| 203 | + } |
|
| 204 | + } |
|
| 205 | + } |
|
| 206 | 206 | } |
| 207 | 207 | else |
| 208 | 208 | { |
@@ -4,24 +4,24 @@ discard block |
||
| 4 | 4 | include('include/utils.php'); |
| 5 | 5 | |
| 6 | 6 | |
| 7 | -$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path); |
|
| 7 | +$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path); |
|
| 8 | 8 | |
| 9 | -if ($thumb_pos !=0 |
|
| 10 | - || strpos($_POST['path_thumb'],'../',strlen($thumbs_base_path)+$thumb_pos)!==FALSE |
|
| 11 | - || strpos($_POST['path'],'/')===0 |
|
| 12 | - || strpos($_POST['path'],'../')!==FALSE |
|
| 13 | - || strpos($_POST['path'],'./')===0) |
|
| 9 | +if ($thumb_pos != 0 |
|
| 10 | + || strpos($_POST['path_thumb'], '../', strlen($thumbs_base_path) + $thumb_pos) !== FALSE |
|
| 11 | + || strpos($_POST['path'], '/') === 0 |
|
| 12 | + || strpos($_POST['path'], '../') !== FALSE |
|
| 13 | + || strpos($_POST['path'], './') === 0) |
|
| 14 | 14 | { |
| 15 | 15 | die('wrong path'); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $language_file = 'lang/en_EN.php'; |
| 19 | -if (isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang']!='') |
|
| 19 | +if (isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang'] != '') |
|
| 20 | 20 | { |
| 21 | 21 | $path_parts = pathinfo($_GET['lang']); |
| 22 | - if (is_readable('lang/' .$path_parts['basename']. '.php')) |
|
| 22 | + if (is_readable('lang/'.$path_parts['basename'].'.php')) |
|
| 23 | 23 | { |
| 24 | - $language_file = 'lang/' .$path_parts['basename']. '.php'; |
|
| 24 | + $language_file = 'lang/'.$path_parts['basename'].'.php'; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | $cycle = TRUE; |
| 33 | 33 | $max_cycles = 50; |
| 34 | 34 | $i = 0; |
| 35 | -while($cycle && $i<$max_cycles) |
|
| 35 | +while ($cycle && $i < $max_cycles) |
|
| 36 | 36 | { |
| 37 | 37 | $i++; |
| 38 | - if ($path == $base) $cycle=FALSE; |
|
| 38 | + if ($path == $base) $cycle = FALSE; |
|
| 39 | 39 | |
| 40 | 40 | if (file_exists($path."config.php")) |
| 41 | 41 | { |
@@ -51,29 +51,29 @@ discard block |
||
| 51 | 51 | if (isset($_POST['name'])) |
| 52 | 52 | { |
| 53 | 53 | $name = $_POST['name']; |
| 54 | - if (strpos($name,'../') !== FALSE) die('wrong name'); |
|
| 54 | + if (strpos($name, '../') !== FALSE) die('wrong name'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $info = pathinfo($path); |
| 58 | -if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']==='delete_folder') && !in_array(strtolower($info['extension']), $ext)) |
|
| 58 | +if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action'] === 'delete_folder') && !in_array(strtolower($info['extension']), $ext)) |
|
| 59 | 59 | { |
| 60 | 60 | die('wrong extension'); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (isset($_GET['action'])) |
| 64 | 64 | { |
| 65 | - switch($_GET['action']) |
|
| 65 | + switch ($_GET['action']) |
|
| 66 | 66 | { |
| 67 | 67 | case 'delete_file': |
| 68 | - if ($delete_files){ |
|
| 68 | + if ($delete_files) { |
|
| 69 | 69 | unlink($path); |
| 70 | 70 | if (file_exists($path_thumb)) unlink($path_thumb); |
| 71 | 71 | |
| 72 | - $info=pathinfo($path); |
|
| 73 | - if ($relative_image_creation){ |
|
| 74 | - foreach($relative_path_from_current_pos as $k=>$path) |
|
| 72 | + $info = pathinfo($path); |
|
| 73 | + if ($relative_image_creation) { |
|
| 74 | + foreach ($relative_path_from_current_pos as $k=>$path) |
|
| 75 | 75 | { |
| 76 | - if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/"; |
|
| 76 | + if ($path != "" && $path[strlen($path) - 1] !== "/") $path .= "/"; |
|
| 77 | 77 | |
| 78 | 78 | if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])) |
| 79 | 79 | { |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | if ($fixed_image_creation) |
| 86 | 86 | { |
| 87 | - foreach($fixed_path_from_filemanager as $k=>$path) |
|
| 87 | + foreach ($fixed_path_from_filemanager as $k=>$path) |
|
| 88 | 88 | { |
| 89 | - if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/"; |
|
| 89 | + if ($path != "" && $path[strlen($path) - 1] !== "/") $path .= "/"; |
|
| 90 | 90 | |
| 91 | - $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 91 | + $base_dir = $path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 92 | 92 | if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
| 93 | 93 | { |
| 94 | 94 | unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | break; |
| 100 | 100 | case 'delete_folder': |
| 101 | - if ($delete_folders){ |
|
| 101 | + if ($delete_folders) { |
|
| 102 | 102 | if (is_dir($path_thumb)) |
| 103 | 103 | { |
| 104 | 104 | deleteDir($path_thumb); |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | deleteDir($path); |
| 110 | 110 | if ($fixed_image_creation) |
| 111 | 111 | { |
| 112 | - foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 113 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 112 | + foreach ($fixed_path_from_filemanager as $k=>$paths) { |
|
| 113 | + if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/"; |
|
| 114 | 114 | |
| 115 | - $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 115 | + $base_dir = $paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 116 | 116 | if (is_dir($base_dir)) deleteDir($base_dir); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -122,24 +122,24 @@ discard block |
||
| 122 | 122 | case 'create_folder': |
| 123 | 123 | if ($create_folders) |
| 124 | 124 | { |
| 125 | - create_folder(fix_path($path,$transliteration),fix_path($path_thumb,$transliteration)); |
|
| 125 | + create_folder(fix_path($path, $transliteration), fix_path($path_thumb, $transliteration)); |
|
| 126 | 126 | } |
| 127 | 127 | break; |
| 128 | 128 | case 'rename_folder': |
| 129 | - if ($rename_folders){ |
|
| 130 | - $name=fix_filename($name,$transliteration); |
|
| 131 | - $name=str_replace('.','',$name); |
|
| 129 | + if ($rename_folders) { |
|
| 130 | + $name = fix_filename($name, $transliteration); |
|
| 131 | + $name = str_replace('.', '', $name); |
|
| 132 | 132 | |
| 133 | - if (!empty($name)){ |
|
| 134 | - if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder); |
|
| 133 | + if (!empty($name)) { |
|
| 134 | + if (!rename_folder($path, $name, $transliteration)) die(lang_Rename_existing_folder); |
|
| 135 | 135 | |
| 136 | - rename_folder($path_thumb,$name,$transliteration); |
|
| 137 | - if ($fixed_image_creation){ |
|
| 138 | - foreach($fixed_path_from_filemanager as $k=>$paths){ |
|
| 139 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 136 | + rename_folder($path_thumb, $name, $transliteration); |
|
| 137 | + if ($fixed_image_creation) { |
|
| 138 | + foreach ($fixed_path_from_filemanager as $k=>$paths) { |
|
| 139 | + if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/"; |
|
| 140 | 140 | |
| 141 | - $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 142 | - rename_folder($base_dir,$name,$transliteration); |
|
| 141 | + $base_dir = $paths.substr_replace($path, '', 0, strlen($current_path)); |
|
| 142 | + rename_folder($base_dir, $name, $transliteration); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -149,26 +149,26 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | break; |
| 151 | 151 | case 'rename_file': |
| 152 | - if ($rename_files){ |
|
| 153 | - $name=fix_filename($name,$transliteration); |
|
| 152 | + if ($rename_files) { |
|
| 153 | + $name = fix_filename($name, $transliteration); |
|
| 154 | 154 | if (!empty($name)) |
| 155 | 155 | { |
| 156 | - if (!rename_file($path,$name,$transliteration)) die(lang_Rename_existing_file); |
|
| 156 | + if (!rename_file($path, $name, $transliteration)) die(lang_Rename_existing_file); |
|
| 157 | 157 | |
| 158 | - rename_file($path_thumb,$name,$transliteration); |
|
| 158 | + rename_file($path_thumb, $name, $transliteration); |
|
| 159 | 159 | |
| 160 | 160 | if ($fixed_image_creation) |
| 161 | 161 | { |
| 162 | - $info=pathinfo($path); |
|
| 162 | + $info = pathinfo($path); |
|
| 163 | 163 | |
| 164 | - foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 164 | + foreach ($fixed_path_from_filemanager as $k=>$paths) |
|
| 165 | 165 | { |
| 166 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 166 | + if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/"; |
|
| 167 | 167 | |
| 168 | 168 | $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
| 169 | 169 | if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
| 170 | 170 | { |
| 171 | - rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration); |
|
| 171 | + rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k], $transliteration); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -181,25 +181,25 @@ discard block |
||
| 181 | 181 | case 'duplicate_file': |
| 182 | 182 | if ($duplicate_files) |
| 183 | 183 | { |
| 184 | - $name = fix_filename($name,$transliteration); |
|
| 184 | + $name = fix_filename($name, $transliteration); |
|
| 185 | 185 | if (!empty($name)) |
| 186 | 186 | { |
| 187 | - if (!duplicate_file($path,$name)) die(lang_Rename_existing_file); |
|
| 187 | + if (!duplicate_file($path, $name)) die(lang_Rename_existing_file); |
|
| 188 | 188 | |
| 189 | - duplicate_file($path_thumb,$name); |
|
| 189 | + duplicate_file($path_thumb, $name); |
|
| 190 | 190 | |
| 191 | 191 | if ($fixed_image_creation) |
| 192 | 192 | { |
| 193 | - $info=pathinfo($path); |
|
| 194 | - foreach($fixed_path_from_filemanager as $k=>$paths) |
|
| 193 | + $info = pathinfo($path); |
|
| 194 | + foreach ($fixed_path_from_filemanager as $k=>$paths) |
|
| 195 | 195 | { |
| 196 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/"; |
|
| 196 | + if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/"; |
|
| 197 | 197 | |
| 198 | - $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 198 | + $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
|
| 199 | 199 | |
| 200 | 200 | if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
| 201 | 201 | { |
| 202 | - duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]); |
|
| 202 | + duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]); |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | break; |
| 213 | 213 | case 'paste_clipboard': |
| 214 | - if ( ! isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'], $_SESSION['RF']['clipboard']['path_thumb']) |
|
| 214 | + if (!isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'], $_SESSION['RF']['clipboard']['path_thumb']) |
|
| 215 | 215 | || $_SESSION['RF']['clipboard_action'] == '' |
| 216 | 216 | || $_SESSION['RF']['clipboard']['path'] == '' |
| 217 | 217 | || $_SESSION['RF']['clipboard']['path_thumb'] == '') |
@@ -230,22 +230,22 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | // user wants to paste folder to it's own sub folder.. baaaah. |
| 233 | - if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE){ |
|
| 233 | + if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE) { |
|
| 234 | 234 | die(); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // something terribly gone wrong |
| 238 | - if ($action !== 'copy' && $action !== 'cut'){ |
|
| 238 | + if ($action !== 'copy' && $action !== 'cut') { |
|
| 239 | 239 | die('no action'); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // check for writability |
| 243 | - if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE){ |
|
| 243 | + if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE) { |
|
| 244 | 244 | die($path.'--'.$path_thumb.'--'.lang_Dir_No_Write); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | // check if server disables copy or rename |
| 248 | - if (is_function_callable(($action === 'copy' ? 'copy' : 'rename')) === FALSE){ |
|
| 248 | + if (is_function_callable(($action === 'copy' ? 'copy' : 'rename')) === FALSE) { |
|
| 249 | 249 | die(sprintf(lang_Function_Disabled, ($action === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)))); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | rrename($data['path_thumb'], $path_thumb); |
| 261 | 261 | |
| 262 | 262 | // cleanup |
| 263 | - if (is_dir($data['path']) === TRUE){ |
|
| 263 | + if (is_dir($data['path']) === TRUE) { |
|
| 264 | 264 | rrename_after_cleaner($data['path']); |
| 265 | 265 | rrename_after_cleaner($data['path_thumb']); |
| 266 | 266 | } |
@@ -1,6 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | include('config/config.php'); |
| 3 | -if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden'); |
|
| 3 | +if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") { |
|
| 4 | + die('forbiden'); |
|
| 5 | +} |
|
| 4 | 6 | include('include/utils.php'); |
| 5 | 7 | |
| 6 | 8 | |
@@ -35,7 +37,9 @@ discard block |
||
| 35 | 37 | while($cycle && $i<$max_cycles) |
| 36 | 38 | { |
| 37 | 39 | $i++; |
| 38 | - if ($path == $base) $cycle=FALSE; |
|
| 40 | + if ($path == $base) { |
|
| 41 | + $cycle=FALSE; |
|
| 42 | + } |
|
| 39 | 43 | |
| 40 | 44 | if (file_exists($path."config.php")) |
| 41 | 45 | { |
@@ -51,8 +55,10 @@ discard block |
||
| 51 | 55 | if (isset($_POST['name'])) |
| 52 | 56 | { |
| 53 | 57 | $name = $_POST['name']; |
| 54 | - if (strpos($name,'../') !== FALSE) die('wrong name'); |
|
| 55 | -} |
|
| 58 | + if (strpos($name,'../') !== FALSE) { |
|
| 59 | + die('wrong name'); |
|
| 60 | + } |
|
| 61 | + } |
|
| 56 | 62 | |
| 57 | 63 | $info = pathinfo($path); |
| 58 | 64 | if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']==='delete_folder') && !in_array(strtolower($info['extension']), $ext)) |
@@ -67,13 +73,17 @@ discard block |
||
| 67 | 73 | case 'delete_file': |
| 68 | 74 | if ($delete_files){ |
| 69 | 75 | unlink($path); |
| 70 | - if (file_exists($path_thumb)) unlink($path_thumb); |
|
| 76 | + if (file_exists($path_thumb)) { |
|
| 77 | + unlink($path_thumb); |
|
| 78 | + } |
|
| 71 | 79 | |
| 72 | 80 | $info=pathinfo($path); |
| 73 | 81 | if ($relative_image_creation){ |
| 74 | 82 | foreach($relative_path_from_current_pos as $k=>$path) |
| 75 | 83 | { |
| 76 | - if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/"; |
|
| 84 | + if ($path!="" && $path[strlen($path)-1]!=="/") { |
|
| 85 | + $path.="/"; |
|
| 86 | + } |
|
| 77 | 87 | |
| 78 | 88 | if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])) |
| 79 | 89 | { |
@@ -86,7 +96,9 @@ discard block |
||
| 86 | 96 | { |
| 87 | 97 | foreach($fixed_path_from_filemanager as $k=>$path) |
| 88 | 98 | { |
| 89 | - if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/"; |
|
| 99 | + if ($path!="" && $path[strlen($path)-1] !== "/") { |
|
| 100 | + $path.="/"; |
|
| 101 | + } |
|
| 90 | 102 | |
| 91 | 103 | $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
| 92 | 104 | if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
@@ -110,10 +122,14 @@ discard block |
||
| 110 | 122 | if ($fixed_image_creation) |
| 111 | 123 | { |
| 112 | 124 | foreach($fixed_path_from_filemanager as $k=>$paths){ |
| 113 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 125 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") { |
|
| 126 | + $paths.="/"; |
|
| 127 | + } |
|
| 114 | 128 | |
| 115 | 129 | $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
| 116 | - if (is_dir($base_dir)) deleteDir($base_dir); |
|
| 130 | + if (is_dir($base_dir)) { |
|
| 131 | + deleteDir($base_dir); |
|
| 132 | + } |
|
| 117 | 133 | } |
| 118 | 134 | } |
| 119 | 135 | } |
@@ -131,19 +147,22 @@ discard block |
||
| 131 | 147 | $name=str_replace('.','',$name); |
| 132 | 148 | |
| 133 | 149 | if (!empty($name)){ |
| 134 | - if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder); |
|
| 150 | + if (!rename_folder($path,$name,$transliteration)) { |
|
| 151 | + die(lang_Rename_existing_folder); |
|
| 152 | + } |
|
| 135 | 153 | |
| 136 | 154 | rename_folder($path_thumb,$name,$transliteration); |
| 137 | 155 | if ($fixed_image_creation){ |
| 138 | 156 | foreach($fixed_path_from_filemanager as $k=>$paths){ |
| 139 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 157 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") { |
|
| 158 | + $paths.="/"; |
|
| 159 | + } |
|
| 140 | 160 | |
| 141 | 161 | $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); |
| 142 | 162 | rename_folder($base_dir,$name,$transliteration); |
| 143 | 163 | } |
| 144 | 164 | } |
| 145 | - } |
|
| 146 | - else { |
|
| 165 | + } else { |
|
| 147 | 166 | die(lang_Empty_name); |
| 148 | 167 | } |
| 149 | 168 | } |
@@ -153,7 +172,9 @@ discard block |
||
| 153 | 172 | $name=fix_filename($name,$transliteration); |
| 154 | 173 | if (!empty($name)) |
| 155 | 174 | { |
| 156 | - if (!rename_file($path,$name,$transliteration)) die(lang_Rename_existing_file); |
|
| 175 | + if (!rename_file($path,$name,$transliteration)) { |
|
| 176 | + die(lang_Rename_existing_file); |
|
| 177 | + } |
|
| 157 | 178 | |
| 158 | 179 | rename_file($path_thumb,$name,$transliteration); |
| 159 | 180 | |
@@ -163,7 +184,9 @@ discard block |
||
| 163 | 184 | |
| 164 | 185 | foreach($fixed_path_from_filemanager as $k=>$paths) |
| 165 | 186 | { |
| 166 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/"; |
|
| 187 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") { |
|
| 188 | + $paths.="/"; |
|
| 189 | + } |
|
| 167 | 190 | |
| 168 | 191 | $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
| 169 | 192 | if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) |
@@ -172,8 +195,7 @@ discard block |
||
| 172 | 195 | } |
| 173 | 196 | } |
| 174 | 197 | } |
| 175 | - } |
|
| 176 | - else { |
|
| 198 | + } else { |
|
| 177 | 199 | die(lang_Empty_name); |
| 178 | 200 | } |
| 179 | 201 | } |
@@ -184,7 +206,9 @@ discard block |
||
| 184 | 206 | $name = fix_filename($name,$transliteration); |
| 185 | 207 | if (!empty($name)) |
| 186 | 208 | { |
| 187 | - if (!duplicate_file($path,$name)) die(lang_Rename_existing_file); |
|
| 209 | + if (!duplicate_file($path,$name)) { |
|
| 210 | + die(lang_Rename_existing_file); |
|
| 211 | + } |
|
| 188 | 212 | |
| 189 | 213 | duplicate_file($path_thumb,$name); |
| 190 | 214 | |
@@ -193,7 +217,9 @@ discard block |
||
| 193 | 217 | $info=pathinfo($path); |
| 194 | 218 | foreach($fixed_path_from_filemanager as $k=>$paths) |
| 195 | 219 | { |
| 196 | - if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/"; |
|
| 220 | + if ($paths!="" && $paths[strlen($paths)-1] !== "/") { |
|
| 221 | + $paths.= "/"; |
|
| 222 | + } |
|
| 197 | 223 | |
| 198 | 224 | $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); |
| 199 | 225 | |
@@ -203,8 +229,7 @@ discard block |
||
| 203 | 229 | } |
| 204 | 230 | } |
| 205 | 231 | } |
| 206 | - } |
|
| 207 | - else |
|
| 232 | + } else |
|
| 208 | 233 | { |
| 209 | 234 | die(lang_Empty_name); |
| 210 | 235 | } |
@@ -253,8 +278,7 @@ discard block |
||
| 253 | 278 | { |
| 254 | 279 | rcopy($data['path'], $path); |
| 255 | 280 | rcopy($data['path_thumb'], $path_thumb); |
| 256 | - } |
|
| 257 | - elseif ($action === 'cut') |
|
| 281 | + } elseif ($action === 'cut') |
|
| 258 | 282 | { |
| 259 | 283 | rrename($data['path'], $path); |
| 260 | 284 | rrename($data['path_thumb'], $path_thumb); |
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Taiwen Jiang <[email protected]> * @version $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $ */ return $config = array( "name" => "tinymce4", "class" => "XoopsFormTinymce4", "file" => \XoopsBaseConfig::get('root-path') . "/class/xoopseditor/tinymce4/formtinymce.php", "title" => _XOOPS_EDITOR_TINYMCE4, "order" => 5, "nohtml" => 0 ); |
|
| 2 | 1 | \ No newline at end of file |
| 2 | +<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Taiwen Jiang <[email protected]> * @version $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $ */ return $config = array("name" => "tinymce4", "class" => "XoopsFormTinymce4", "file" => \XoopsBaseConfig::get('root-path')."/class/xoopseditor/tinymce4/formtinymce.php", "title" => _XOOPS_EDITOR_TINYMCE4, "order" => 5, "nohtml" => 0); |
|
| 3 | 3 | \ No newline at end of file |
@@ -15,8 +15,8 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | // check categories readability by group |
| 18 | -$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS ); |
|
| 19 | -$imgcat_handler =& xoops_getHandler('imagecategory'); |
|
| 18 | +$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS); |
|
| 19 | +$imgcat_handler = & xoops_getHandler('imagecategory'); |
|
| 20 | 20 | if (count($imgcat_handler->getList($groups, 'imgcat_read', 1)) == 0) { |
| 21 | 21 | return false; |
| 22 | 22 | } |
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Laurent JEN <[email protected]> * @version $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $ */ // Xlanguage if ( $GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG") ) { return true; } // Easiest Multi-Language Hack (EMLH) if ( defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES') ) { return true; } return false; |
|
| 2 | 1 | \ No newline at end of file |
| 2 | +<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Laurent JEN <[email protected]> * @version $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $ */ // Xlanguage if ($GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG")) { return true; } // Easiest Multi-Language Hack (EMLH) if (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) { return true; } return false; |
|
| 3 | 3 | \ No newline at end of file |
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Laurent JEN <[email protected]> * @version $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $ */ include_once \XoopsBaseConfig::get('root-path') . "/modules/system/constants.php"; // Add your code here to check acces by groups return true; |
|
| 2 | 1 | \ No newline at end of file |
| 2 | +<?php /** * TinyMCE adapter for XOOPS * * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package class * @subpackage editor * @since 2.3.0 * @author Laurent JEN <[email protected]> * @version $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $ */ include_once \XoopsBaseConfig::get('root-path')."/modules/system/constants.php"; // Add your code here to check acces by groups return true; |
|
| 3 | 3 | \ No newline at end of file |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | * Assocated with editor_registry.php |
| 15 | 15 | */ |
| 16 | 16 | // Name of the editor |
| 17 | -define("_XOOPS_EDITOR_TINYMCE4","TinyMCE4"); |
|
| 17 | +define("_XOOPS_EDITOR_TINYMCE4", "TinyMCE4"); |
|
| 18 | 18 | |
| 19 | 19 | // The value must be the same as /tinymce/jscripts/langs/your_language_code, for example, "en" for English, "fr" for French |
| 20 | 20 | // For details, check http://tinymce.moxiecode.com/download_i18n.php |
| 21 | -define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE","en"); |
|
| 21 | +define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE", "en"); |
|
| 22 | 22 | |
| 23 | 23 | // FONT LIST, FORMAT: "Name=value1,value2;Name=value" |
| 24 | 24 | |
| 25 | -define("_XOOPS_EDITOR_TINYMCE4_FONTS","Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings"); |
|
| 25 | +define("_XOOPS_EDITOR_TINYMCE4_FONTS", "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings"); |
|
@@ -14,11 +14,11 @@ |
||
| 14 | 14 | * Assocated with editor_registry.php |
| 15 | 15 | */ |
| 16 | 16 | // Name of the editor |
| 17 | -define("_XOOPS_EDITOR_TINYMCE4","TinyMCE4"); |
|
| 17 | +define("_XOOPS_EDITOR_TINYMCE4", "TinyMCE4"); |
|
| 18 | 18 | |
| 19 | 19 | // The value must be the same as /tinymce/jscripts/langs/your_language_code, for example, "en" for English, "fr" for French |
| 20 | 20 | // For details, check http://tinymce.moxiecode.com/download_i18n.php |
| 21 | -define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE","fr_FR"); |
|
| 21 | +define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE", "fr_FR"); |
|
| 22 | 22 | |
| 23 | 23 | // FONT LIST, FORMAT: "Name=value1,value2;Name=value" |
| 24 | -define("_XOOPS_EDITOR_TINYMCE4_FONTS","Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings"); |
|
| 24 | +define("_XOOPS_EDITOR_TINYMCE4_FONTS", "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings"); |
|