root / trunk / plugins / ExtendedFileManager / config.inc.php @ 521
| Revision 521, 8.3 kB (checked in by koto, 7 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | /** |
| 3 | * ExtendedFileManager configuration file. |
| 4 | * Authors: Wei Zhuo, Afru |
| 5 | * Version: Updated on 08-01-2005 by Afru |
| 6 | * Version 1.1.1: Updated on 21-06-2006 by Krzysztof Kotowicz <koto@webworkers.pl> |
| 7 | * Package: ExtendedFileManager |
| 8 | * http://www.afrusoft.com/htmlarea |
| 9 | */ |
| 10 | |
| 11 | /* Configuration file usage: |
| 12 | * There are two insertModes for this filemanager. |
| 13 | * One is "image" and another is "link". |
| 14 | * So you can assign config values as below |
| 15 | * |
| 16 | * if($insertMode=="image") $IMConfig['property']=somevalueforimagemode; |
| 17 | * else if($insertMode=="link") $IMConfig['property']=somevalueforlinkmode; |
| 18 | * |
| 19 | * (or) you can directly as $IMConfig['property']=somevalueforbothmodes; |
| 20 | * |
| 21 | * Best of Luck :) Afru. |
| 22 | */ |
| 23 | |
| 24 | /** |
| 25 | * Default backend URL |
| 26 | * |
| 27 | * URL to use for unified backend. |
| 28 | * |
| 29 | * The ?__plugin=ExtendedFileManager& is required. |
| 30 | */ |
| 31 | |
| 32 | $IMConfig['backend_url'] = "backend.php?__plugin=ExtendedFileManager&"; |
| 33 | |
| 34 | /** |
| 35 | * Backend Installation Directory |
| 36 | * |
| 37 | * location of backend install; these are used to link to css and js |
| 38 | * assets because we may have the front end installed in a different |
| 39 | * directory than the backend. (i.e. nothing assumes that the frontend |
| 40 | * and the backend are in the same directory) |
| 41 | */ |
| 42 | $IMConfig['base_dir'] = getcwd(); |
| 43 | $IMConfig['base_url'] = ''; |
| 44 | |
| 45 | |
| 46 | /* |
| 47 | File system path to the directory you want to manage the images |
| 48 | for multiple user systems, set it dynamically. |
| 49 | |
| 50 | NOTE: This directory requires write access by PHP. That is, |
| 51 | PHP must be able to create files in this directory. |
| 52 | Able to create directories is nice, but not necessary. |
| 53 | */ |
| 54 | $IMConfig['images_dir'] = 'demo_images'; |
| 55 | |
| 56 | /* |
| 57 | The URL to the above path, the web browser needs to be able to see it. |
| 58 | It can be protected via .htaccess on apache or directory permissions on IIS, |
| 59 | check you web server documentation for futher information on directory protection |
| 60 | If this directory needs to be publicly accessiable, remove scripting capabilities |
| 61 | for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets |
| 62 | in this directory and its subdirectories. |
| 63 | */ |
| 64 | $IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images"; |
| 65 | |
| 66 | /* |
| 67 | Possible values: true, false |
| 68 | |
| 69 | TRUE - If PHP on the web server is in safe mode, set this to true. |
| 70 | SAFE MODE restrictions: directory creation will not be possible, |
| 71 | only the GD library can be used, other libraries require |
| 72 | Safe Mode to be off. |
| 73 | |
| 74 | FALSE - Set to false if PHP on the web server is not in safe mode. |
| 75 | */ |
| 76 | $IMConfig['safe_mode'] = false; |
| 77 | |
| 78 | /* |
| 79 | This specifies whether any image library is available to resize and edit images.TRUE - Thumbnails will be resized by image libraries and if there is no library, default thumbnail will be shown. |
| 80 | FALSE - Thumbnails will be resized by browser ignoring image libraries. |
| 81 | */ |
| 82 | $IMConfig['img_library'] = true; |
| 83 | |
| 84 | |
| 85 | /* |
| 86 | View type when the File manager is in insert image mode. |
| 87 | Valid values are "thumbview" and "listview". |
| 88 | */ |
| 89 | |
| 90 | if(empty($insertMode)) |
| 91 | $insertMode="image"; |
| 92 | |
| 93 | if ($insertMode == 'image') |
| 94 | $IMConfig['view_type'] = "thumbview"; |
| 95 | |
| 96 | else if($insertMode == "link") |
| 97 | $IMConfig['view_type'] = "listview"; |
| 98 | |
| 99 | $IMConfig['insert_mode'] = $insertMode; |
| 100 | |
| 101 | /* |
| 102 | Possible values: 'GD', 'IM', or 'NetPBM' |
| 103 | |
| 104 | The image manipulation library to use, either GD or ImageMagick or NetPBM. |
| 105 | If you have safe mode ON, or don't have the binaries to other packages, |
| 106 | your choice is 'GD' only. Other packages require Safe Mode to be off. |
| 107 | */ |
| 108 | define('IMAGE_CLASS', 'GD'); |
| 109 | |
| 110 | |
| 111 | /* |
| 112 | After defining which library to use, if it is NetPBM or IM, you need to |
| 113 | specify where the binary for the selected library are. And of course |
| 114 | your server and PHP must be able to execute them (i.e. safe mode is OFF). |
| 115 | GD does not require the following definition. |
| 116 | */ |
| 117 | define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); |
| 118 | |
| 119 | |
| 120 | /* |
| 121 | The prefix for thumbnail files, something like .thumb will do. The |
| 122 | thumbnails files will be named as "prefix_imagefile.ext", that is, |
| 123 | prefix + orginal filename. |
| 124 | */ |
| 125 | $IMConfig['thumbnail_prefix'] = 't_'; |
| 126 | |
| 127 | |
| 128 | /* |
| 129 | Thumbnail can also be stored in a directory, this directory |
| 130 | will be created by PHP. If PHP is in safe mode, this parameter |
| 131 | is ignored, you can not create directories. |
| 132 | |
| 133 | If you do not want to store thumbnails in a directory, set this |
| 134 | to false or empty string ''; |
| 135 | */ |
| 136 | $IMConfig['thumbnail_dir'] = 't'; |
| 137 | |
| 138 | /** |
| 139 | * Resized prefix |
| 140 | * |
| 141 | * The prefix for resized files, something like .resized will do. The |
| 142 | * resized files will be named <prefix>_<width>x<height>_<original> |
| 143 | * resized files are created when one changes the dimensions of an image |
| 144 | * in the image manager selection dialog - the image is scaled when the |
| 145 | * user clicks the ok button. |
| 146 | */ |
| 147 | |
| 148 | $IMConfig['resized_prefix'] = '.resized'; |
| 149 | |
| 150 | // ------------------------------------------------------------------------- |
| 151 | |
| 152 | /** |
| 153 | * Resized Directory |
| 154 | * |
| 155 | * Resized images may also be stored in a directory, except in safe mode. |
| 156 | */ |
| 157 | |
| 158 | $IMConfig['resized_dir'] = ''; |
| 159 | |
| 160 | /* |
| 161 | Possible values: true, false |
| 162 | |
| 163 | TRUE - Allow the user to create new sub-directories in the |
| 164 | $IMConfig['base_dir']. |
| 165 | |
| 166 | FALSE - No directory creation. |
| 167 | |
| 168 | NOTE: If $IMConfig['safe_mode'] = true, this parameter |
| 169 | is ignored, you can not create directories |
| 170 | */ |
| 171 | $IMConfig['allow_new_dir'] = true; |
| 172 | |
| 173 | |
| 174 | /* |
| 175 | Possible values: true, false |
| 176 | |
| 177 | TRUE - Allow the user to edit image by image editor. |
| 178 | |
| 179 | FALSE - No edit icon will be displayed. |
| 180 | |
| 181 | NOTE: If $IMConfig['img_library'] = false, this parameter |
| 182 | is ignored, you can not edit images. |
| 183 | */ |
| 184 | $IMConfig['allow_edit_image'] = true; |
| 185 | |
| 186 | |
| 187 | /* |
| 188 | Possible values: true, false |
| 189 | |
| 190 | TRUE - Display color pickers for image background / border colors |
| 191 | |
| 192 | FALSE - Don't display color pickers |
| 193 | */ |
| 194 | $IMConfig['use_color_pickers'] = true; |
| 195 | |
| 196 | /* |
| 197 | Possible values: true, false |
| 198 | |
| 199 | TRUE - Allow the user to upload files. |
| 200 | |
| 201 | FALSE - No uploading allowed. |
| 202 | */ |
| 203 | $IMConfig['allow_upload'] = true; |
| 204 | |
| 205 | /* Maximum upload file size in Kilobytes */ |
| 206 | $IMConfig['max_filesize_kb_image'] = 2000; |
| 207 | |
| 208 | $IMConfig['max_filesize_kb_link'] = 5000; |
| 209 | |
| 210 | /* Maximum upload folder size in Megabytes. Use 0 to disable limit */ |
| 211 | $IMConfig['max_foldersize_mb'] = 0; |
| 212 | |
| 213 | /* |
| 214 | Allowed extensions that can be shown and allowed to upload. |
| 215 | Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip" |
| 216 | -Changed by AFRU. |
| 217 | */ |
| 218 | |
| 219 | $IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp"); |
| 220 | $IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls"); |
| 221 | |
| 222 | |
| 223 | /* |
| 224 | The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown. |
| 225 | */ |
| 226 | $IMConfig['default_thumbnail'] = 'icons/def.gif'; |
| 227 | $IMConfig['default_listicon'] = 'icons/def_small.gif'; |
| 228 | |
| 229 | |
| 230 | /* |
| 231 | Only files with these extensions will be shown as thumbnails. All other files will be shown as icons. |
| 232 | */ |
| 233 | $IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp"); |
| 234 | |
| 235 | /* |
| 236 | Thumbnail dimensions. |
| 237 | */ |
| 238 | $IMConfig['thumbnail_width'] = 84; |
| 239 | $IMConfig['thumbnail_height'] = 84; |
| 240 | |
| 241 | /* |
| 242 | Image Editor temporary filename prefix. |
| 243 | */ |
| 244 | $IMConfig['tmp_prefix'] = '.editor_'; |
| 245 | |
| 246 | |
| 247 | // If config specified from front end, merge it |
| 248 | if(isset($_REQUEST['backend_config'])) |
| 249 | { |
| 250 | if(get_magic_quotes_gpc()) { |
| 251 | $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']); |
| 252 | } |
| 253 | |
| 254 | // Config specified from front end, check that it's valid |
| 255 | session_start(); |
| 256 | if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION)) |
| 257 | die("Backend security error."); |
| 258 | |
| 259 | $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']]; |
| 260 | |
| 261 | if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret)) |
| 262 | { |
| 263 | die("Backend security error."); |
| 264 | } |
| 265 | |
| 266 | $to_merge = unserialize($_REQUEST['backend_config']); |
| 267 | if(!is_array($to_merge)) |
| 268 | { |
| 269 | die("Backend config syntax error."); |
| 270 | } |
| 271 | |
| 272 | $IMConfig = array_merge($IMConfig, $to_merge); |
| 273 | |
| 274 | // changed config settings keys in relation to ImageManager |
| 275 | $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&'; |
| 276 | $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&'; |
| 277 | $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&'; |
| 278 | |
| 279 | } |
| 280 | |
| 281 | // END |
| 282 | |
| 283 | ?> |
Note: See TracBrowser
for help on using the browser.
