config.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php
  2. /*
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  5. *
  6. * == BEGIN LICENSE ==
  7. *
  8. * Licensed under the terms of any of the following licenses at your
  9. * choice:
  10. *
  11. * - GNU General Public License Version 2 or later (the "GPL")
  12. * http://www.gnu.org/licenses/gpl.html
  13. *
  14. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15. * http://www.gnu.org/licenses/lgpl.html
  16. *
  17. * - Mozilla Public License Version 1.1 or later (the "MPL")
  18. * http://www.mozilla.org/MPL/MPL-1.1.html
  19. *
  20. * == END LICENSE ==
  21. *
  22. * Configuration file for the File Manager Connector for PHP.
  23. */
  24. global $Config ;
  25. define('NOTOKENRENEWAL',1); // Disables token renewal
  26. // We must include the main because this page is
  27. // a web page that require security controls and
  28. // is a security hole if anybody can access without
  29. // being an authenticated user.
  30. require_once '../../../../main.inc.php';
  31. $uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root);
  32. $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine
  33. if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
  34. define('DOL_URL_ROOT', $pos);
  35. // SECURITY: You must explicitly enable this "connector". (Set it to "true").
  36. // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
  37. // authenticated users can access this file or use some kind of session checking.
  38. $Config['Enabled'] = true ;
  39. // Path to user files relative to the document root.
  40. $Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&file=' ;
  41. // Fill the following value it you prefer to specify the absolute path for the
  42. // user files directory. Useful if you are using a virtual directory, symbolic
  43. // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  44. // Attention: The above 'UserFilesPath' must point to the same directory.
  45. $Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root.'/fckeditor/';
  46. // Due to security issues with Apache modules, it is recommended to leave the
  47. // following setting enabled.
  48. $Config['ForceSingleExtension'] = true ;
  49. // Perform additional checks for image files.
  50. // If set to true, validate image size (using getimagesize).
  51. $Config['SecureImageUploads'] = true;
  52. // What the user can do with this connector.
  53. $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder');
  54. // Allowed Resource Types.
  55. $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media');
  56. // For security, HTML is allowed in the first Kb of data for files having the
  57. // following extensions only.
  58. $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js");
  59. // After file is uploaded, sometimes it is required to change its permissions
  60. // so that it was possible to access it at the later time.
  61. // If possible, it is recommended to set more restrictive permissions, like 0755.
  62. // Set to 0 to disable this feature.
  63. // Note: not needed on Windows-based servers.
  64. $Config['ChmodOnUpload'] = 0775 ;
  65. // See comments above.
  66. // Used when creating folders that does not exist.
  67. $Config['ChmodOnFolderCreate'] = 0775 ;
  68. /*
  69. Configuration settings for each Resource Type
  70. - AllowedExtensions: the possible extensions that can be allowed.
  71. If it is empty then any file type can be uploaded.
  72. - DeniedExtensions: The extensions that won't be allowed.
  73. If it is empty then no restrictions are done here.
  74. For a file to be uploaded it has to fulfill both the AllowedExtensions
  75. and DeniedExtensions (that's it: not being denied) conditions.
  76. - FileTypesPath: the virtual folder relative to the document root where
  77. these resources will be located.
  78. Attention: It must start and end with a slash: '/'
  79. - FileTypesAbsolutePath: the physical path to the above folder. It must be
  80. an absolute path.
  81. If it's an empty string then it will be autocalculated.
  82. Useful if you are using a virtual directory, symbolic link or alias.
  83. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  84. Attention: The above 'FileTypesPath' must point to the same directory.
  85. Attention: It must end with a slash: '/'
  86. - QuickUploadPath: the virtual folder relative to the document root where
  87. these resources will be uploaded using the Upload tab in the resources
  88. dialogs.
  89. Attention: It must start and end with a slash: '/'
  90. - QuickUploadAbsolutePath: the physical path to the above folder. It must be
  91. an absolute path.
  92. If it's an empty string then it will be autocalculated.
  93. Useful if you are using a virtual directory, symbolic link or alias.
  94. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  95. Attention: The above 'QuickUploadPath' must point to the same directory.
  96. Attention: It must end with a slash: '/'
  97. NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
  98. "userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
  99. This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
  100. Example: if you click on "image button", select "Upload" tab and send image
  101. to the server, image will appear in FCKeditor correctly, but because it is placed
  102. directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
  103. The more expected behaviour would be to send images directly to "image" subfolder.
  104. To achieve that, simply change
  105. $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
  106. $Config['QuickUploadAbsolutePath']['Image'] = $Config['UserFilesAbsolutePath'] ;
  107. into:
  108. $Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'] ;
  109. $Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'] ;
  110. */
  111. $Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip');
  112. $Config['DeniedExtensions']['File'] = array();
  113. $Config['FileTypesPath']['File'] = $Config['UserFilesPath'] . 'file/' ;
  114. $Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
  115. $Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ;
  116. $Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;
  117. $Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png');
  118. $Config['DeniedExtensions']['Image'] = array();
  119. $Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image/' ;
  120. $Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
  121. $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
  122. $Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;
  123. $Config['AllowedExtensions']['Flash'] = array('swf','flv');
  124. $Config['DeniedExtensions']['Flash'] = array();
  125. $Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . 'flash/' ;
  126. $Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
  127. $Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath'] ;
  128. $Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;
  129. $Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv');
  130. $Config['DeniedExtensions']['Media'] = array();
  131. $Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . 'media/' ;
  132. $Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
  133. $Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ;
  134. $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;
  135. ?>