source: trunk/unsupported_plugins/ExtendedFileManager/config.inc.php

Last change on this file was 1367, checked in by gogo, 21 months ago

Fix loading warning for a not-found or forbidden plugin. Remove the die's I just added to EFM and IM, they would be "hard to discover" because first you would get the .htaccess denial warning, you'd fix that, but it still wouldn't work.

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 12.3 KB
Line 
1<?php
2
3/**
4 * ExtendedFileManager configuration file.
5 * Authors: Wei Zhuo, Afru
6 * Version: Updated on 08-01-2005 by Afru
7 * Version 1.1.2: Updated on 04-07-2006 by Krzysztof Kotowicz <koto@webworkers.pl>
8 * Package: ExtendedFileManager
9 * http://www.afrusoft.com/htmlarea
10 */
11
12/*  Configuration file usage:
13 *      There are two insertModes for this filemanager.
14 *      One is "image" and another is "link".
15 *      So you can assign config values as below
16 *
17 *      if($insertMode=="image") $IMConfig['property']=somevalueforimagemode;
18 *      else if($insertMode=="link") $IMConfig['property']=somevalueforlinkmode;
19 *
20 *      (or) you can directly as $IMConfig['property']=somevalueforbothmodes;
21 *
22 *      Best of Luck :) Afru.
23 */
24 
25/*
26 *      Getting the mode for further differentiation
27 */
28
29if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode'];
30        if(!isset($insertMode)) $insertMode="image";
31
32/**
33* Default backend URL
34*
35* URL to use for unified backend.
36*
37* The ?__plugin=ExtendedFileManager& is required.
38*/
39
40$IMConfig['backend_url'] = "backend.php?__plugin=ExtendedFileManager&";
41
42/**
43* Backend Installation Directory
44*
45* location of backend install; these are used to link to css and js
46* assets because we may have the front end installed in a different
47* directory than the backend. (i.e. nothing assumes that the frontend
48* and the backend are in the same directory)
49*/
50$IMConfig['base_dir'] = getcwd();
51$IMConfig['base_url'] = '';
52
53
54/*
55         File system path to the directory you want to manage the images
56         for multiple user systems, set it dynamically.
57
58         NOTE: This directory requires write access by PHP. That is,
59                   PHP must be able to create files in this directory.
60                   Able to create directories is nice, but not necessary.
61*/
62$IMConfig['images_dir'] = 'demo_images';
63//You may set a different directory for the link mode; if you don't, the above setting will be used for both modes
64//$IMConfig['files_dir'] = 'demo_files';
65
66/*
67 The URL to the above path, the web browser needs to be able to see it.
68 Please remove scripting capabilities in this directory
69 for this directory (i.e. disable PHP, Perl, CGI; see .htaccess file in demo_images folder).
70*/
71$IMConfig['images_url'] = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['images_dir'];
72//$IMConfig['files_url'] = 'url/to/files_dir';
73
74/*
75  Format of the Date Modified in list view.
76  It has to be a string understood by the PHP date() function (for possible values see http://http://php.net/manual/en/function.date.php)
77*/
78$IMConfig['date_format'] = "d.m.y H:i";
79/*
80  Possible values: true, false
81
82  TRUE - If PHP on the web server is in safe mode, set this to true.
83         SAFE MODE restrictions: directory creation will not be possible,
84                 only the GD library can be used, other libraries require
85                 Safe Mode to be off.
86
87  FALSE - Set to false if PHP on the web server is not in safe mode.
88*/
89$IMConfig['safe_mode'] = false;
90
91/*
92This 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.
93FALSE - Thumbnails will be resized by browser ignoring image libraries.
94*/
95$IMConfig['img_library'] = true;
96
97
98/*
99View type when the File manager is in insert image mode.
100Valid values are "thumbview" and "listview".
101*/
102
103   
104if ($insertMode == 'image')
105        $IMConfig['view_type'] = "thumbview";
106       
107else if($insertMode == "link")
108        $IMConfig['view_type'] = "listview";
109
110$IMConfig['insert_mode'] = $insertMode;
111
112/*
113 Possible values: 'GD', 'IM', or 'NetPBM'
114
115 The image manipulation library to use, either GD or ImageMagick or NetPBM.
116 If you have safe mode ON, or don't have the binaries to other packages,
117 your choice is 'GD' only. Other packages require Safe Mode to be off.
118*/
119define('IMAGE_CLASS', 'GD');
120
121
122/*
123 After defining which library to use, if it is NetPBM or IM, you need to
124 specify where the binary for the selected library are. And of course
125 your server and PHP must be able to execute them (i.e. safe mode is OFF).
126 GD does not require the following definition.
127*/
128define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/');
129//define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/');
130
131
132/*
133  The prefix for thumbnail files, something like .thumb will do. The
134  thumbnails files will be named as "prefix_imagefile.ext", that is,
135  prefix + orginal filename.
136*/
137$IMConfig['thumbnail_prefix'] = 't_';
138
139
140/*
141  Thumbnail can also be stored in a directory, this directory
142  will be created by PHP. If PHP is in safe mode, this parameter
143  is ignored, you can not create directories.
144
145  If you do not want to store thumbnails in a directory, set this
146  to false or empty string '';
147*/
148$IMConfig['thumbnail_dir'] = 't';
149
150/**
151 * Resize files, or not.  If the dimensions for an image are changed
152 * this will control if the image is actually resized. 
153 *
154 * Usually you want this true, unless you are very disk space concious.
155 */
156 
157$IMConfig['resize_files'] = true;
158
159/**
160* Resized prefix
161*
162* The prefix for resized files, something like .resized will do.  The
163* resized files will be named <prefix>_<width>x<height>_<original>
164* resized files are created when one changes the dimensions of an image
165* in the image manager selection dialog - the image is scaled when the
166* user clicks the ok button.
167*/
168
169$IMConfig['resized_prefix'] = '.resized';
170
171// -------------------------------------------------------------------------
172
173/**
174* Resized Directory
175*
176* Resized images may also be stored in a directory, except in safe mode.
177*/
178
179$IMConfig['resized_dir'] = '';
180
181/*
182  Possible values: true, false
183
184 TRUE -  Allow the user to create new sub-directories in the
185         $IMConfig['images_dir']/$IMConfig['files_dir'].
186
187 FALSE - No directory creation.
188
189 NOTE: If $IMConfig['safe_mode'] = true, this parameter
190       is ignored, you can not create directories
191*/
192$IMConfig['allow_new_dir'] = false;
193
194/*
195  Possible values: true, false
196
197 TRUE -  Allow the user to edit image by image editor.
198
199 FALSE - No edit icon will be displayed.
200
201 NOTE: If $IMConfig['img_library'] = false, this parameter
202       is ignored, you can not edit images.
203*/
204$IMConfig['allow_edit_image'] = false;
205
206/*
207  Possible values: true, false
208
209 TRUE -  Allow the user to rename files and folders.
210
211 FALSE - No rename icon will be displayed.
212
213*/
214$IMConfig['allow_rename'] = false;
215
216/*
217  Possible values: true, false
218
219 TRUE -  Allow the user to perform cut/copy/paste actions.
220
221 FALSE - No cut/copy/paste icons will be displayed.
222
223*/
224$IMConfig['allow_cut_copy_paste'] = false;
225
226/*
227  Possible values: true, false
228
229 TRUE -  Allow the user to delete files and folders.
230
231 FALSE - No delete icon will be displayed.
232
233*/
234$IMConfig['allow_delete'] = false;
235
236/*
237  Possible values: true, false
238
239  TRUE - Display color pickers for image background / border colors
240
241  FALSE - Don't display color pickers
242*/
243$IMConfig['use_color_pickers'] = true;
244
245/*
246  Possible values: true, false
247
248 TRUE -  Allow the user to set alt (alternative text) attribute.
249
250 FALSE - No input field for alt attribute will be displayed.
251
252 NOTE: The alt attribute is _obligatory_ for images, so <img alt="" /> will be inserted
253      if 'images_enable_alt' is set to false
254*/
255$IMConfig['images_enable_alt'] = true;
256
257/*
258  Possible values: true, false
259
260 TRUE -  Allow the user to set title attribute (usually displayed when mouse is over element).
261
262 FALSE - No input field for title attribute will be displayed.
263
264*/
265$IMConfig['images_enable_title'] = false;
266
267/*
268  Possible values: true, false
269
270 TRUE -  Allow the user to set align attribute.
271
272 FALSE - No selection box for align attribute will be displayed.
273
274*/
275$IMConfig['images_enable_align'] = true;
276
277/*
278  Possible values: true, false
279
280 TRUE -  Allow the user to set margin, padding, and border styles for the image
281
282 FALSE - No styling input fields will be displayed.
283
284*/
285$IMConfig['images_enable_styling'] = true;
286
287/*
288  Possible values: true, false
289
290 TRUE -   Allow the user to set target attribute for link (the window in which the link will be opened).
291
292 FALSE - No selection box for target attribute will be displayed.
293
294*/
295$IMConfig['link_enable_target'] = true;
296/*
297  Possible values: true, false
298
299  TRUE - Allow the user to upload files.
300
301  FALSE - No uploading allowed.
302*/
303$IMConfig['allow_upload'] = false;
304
305/* Maximum upload file size
306
307  Possible values: number, "max"
308
309  number - maximum size in Kilobytes.
310
311  "max"  - the maximum allowed by the server (the value is retrieved from the server configuration).
312*/
313$IMConfig['max_filesize_kb_image'] = 200;
314
315$IMConfig['max_filesize_kb_link'] = 5000;
316
317/* Maximum upload folder size in Megabytes. Use 0 to disable limit */
318$IMConfig['max_foldersize_mb'] = 0;
319
320/*
321Allowed extensions that can be shown and allowed to upload.
322Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip"
323-Changed by AFRU.
324*/
325
326$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp");
327$IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls","doc");
328
329
330/*
331 The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown.
332*/
333$IMConfig['default_thumbnail'] = 'icons/def.gif';
334$IMConfig['default_listicon'] = 'icons/def_small.gif';
335
336
337/*
338Only files with these extensions will be shown as thumbnails. All other files will be shown as icons.
339*/
340$IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp");
341
342/*
343  Thumbnail dimensions.
344*/
345$IMConfig['thumbnail_width'] = 84;
346$IMConfig['thumbnail_height'] = 84;
347
348/*
349  Image Editor temporary filename prefix.
350*/
351$IMConfig['tmp_prefix'] = '.editor_';
352
353
354// Standard PHP Backend Data Passing
355//  if data was passed using xinha_pass_to_php_backend() we merge the items
356//  provided into the Config
357require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
358if($passed_data = xinha_read_passed_data())
359{
360  $IMConfig = array_merge($IMConfig, $passed_data);
361  $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&';
362}
363// Deprecated config passing, don't use this way any more!
364elseif(isset($_REQUEST['backend_config']))
365{
366  if(get_magic_quotes_gpc()) {
367    $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']);
368  }
369 
370  if($_REQUEST['backend_config_secret_key_location'] !== 'Xinha:ExtendedFileManager')
371  {
372    trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data.  The special backend configuration has been ignored.  To resolve this, you should edit plugins/ExtendedFileManager/config.php and change the default key location from "Xinha:ExtendedFileManager" to your desired non default.  See: http://trac.xinha.org/ticket/1518', E_USER_ERROR);   
373  }
374  else
375  {
376  // Config specified from front end, check that it's valid
377  session_start();
378  if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION))
379    die("Backend security error.");
380
381  $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
382
383  if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
384  {
385    die("Backend security error.");
386  }
387
388  $to_merge = unserialize($_REQUEST['backend_config']);
389  if(!is_array($to_merge))
390  {
391    die("Backend config syntax error.");
392  }
393
394  $IMConfig = array_merge($IMConfig, $to_merge);
395
396   // changed config settings keys in relation to ImageManager
397  $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&';
398  $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&';
399  $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&';
400  }
401}
402if ($IMConfig['max_filesize_kb_link'] == "max")
403{
404  $IMConfig['max_filesize_kb_link'] = upload_max_filesize_kb();
405}
406
407if ($IMConfig['max_filesize_kb_image'] == "max")
408{
409  $IMConfig['max_filesize_kb_image'] = upload_max_filesize_kb();
410}
411// END
412
413?>
Note: See TracBrowser for help on using the repository browser.