PageRenderTime 23ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/sites/all/modules/ckeditor/ckfinder/config.php

https://bitbucket.org/bouldertech/myngl
PHP | 320 lines | 72 code | 36 blank | 212 comment | 0 complexity | 1b25a839a7097f7228c8758829b64c46 MD5 | raw file
  1. <?php
  2. /*
  3. * ### CKFinder : Configuration File - Basic Instructions
  4. *
  5. * In a generic usage case, the following tasks must be done to configure
  6. * CKFinder:
  7. * 1. Check the $baseUrl and $baseDir variables;
  8. * 2. If available, paste your license key in the "LicenseKey" setting;
  9. * 3. Create the CheckAuthentication() function that enables CKFinder for authenticated users;
  10. *
  11. * Other settings may be left with their default values, or used to control
  12. * advanced features of CKFinder.
  13. */
  14. /**
  15. * This function must check the user session to be sure that he/she is
  16. * authorized to upload and access files in the File Browser.
  17. *
  18. * @return boolean
  19. **/
  20. // LicenseKey : Paste your license key here. If left blank, CKFinder will be
  21. // fully functional, in demo mode.
  22. $config['LicenseName'] = '';
  23. $config['LicenseKey'] = '';
  24. /*
  25. Uncomment lines below to enable PHP error reporting and displaying PHP errors.
  26. Do not do this on a production server. Might be helpful when debugging why CKFinder does not work as expected.
  27. */
  28. // error_reporting(E_ALL);
  29. // ini_set('display_errors', 1);
  30. /*
  31. To make it easy to configure CKFinder, the $baseUrl and $baseDir can be used.
  32. Those are helper variables used later in this config file.
  33. */
  34. /*
  35. $baseUrl : the base path used to build the final URL for the resources handled
  36. in CKFinder. If empty, the default value (/userfiles/) is used.
  37. Examples:
  38. $baseUrl = 'http://example.com/ckfinder/files/';
  39. $baseUrl = '/userfiles/';
  40. ATTENTION: The trailing slash is required.
  41. $baseUrl = '/ckfinder/userfiles/';
  42. */
  43. $baseUrl = '/var/www/themyngl.com/web/sites/all/modules/ckeditor/ckfinder/userfiles/';
  44. /*
  45. $baseDir : the path to the local directory (in the server) which points to the
  46. above $baseUrl URL. This is the path used by CKFinder to handle the files in
  47. the server. Full write permissions must be granted to this directory.
  48. Examples:
  49. // You may point it to a directory directly:
  50. $baseDir = '/home/login/public_html/ckfinder/files/';
  51. $baseDir = 'C:/SiteDir/CKFinder/userfiles/';
  52. // Or you may let CKFinder discover the path, based on $baseUrl.
  53. // WARNING: resolveUrl() *will not work* if $baseUrl does not start with a slash ("/"),
  54. // for example if $baseDir is set to http://example.com/ckfinder/files/
  55. $baseDir = resolveUrl($baseUrl);
  56. ATTENTION: The trailing slash is required.
  57. */
  58. require_once '../../../../includes/filemanager.config.php';
  59. $baseDir = resolveUrl($baseUrl);
  60. /*
  61. * ### Advanced Settings
  62. */
  63. /*
  64. Thumbnails : thumbnails settings. All thumbnails will end up in the same
  65. directory, no matter the resource type.
  66. */
  67. $config['Thumbnails'] = Array(
  68. 'url' => $baseUrl . '_thumbs',
  69. 'directory' => $baseDir . '_thumbs',
  70. 'enabled' => true,
  71. 'directAccess' => false,
  72. 'maxWidth' => 100,
  73. 'maxHeight' => 100,
  74. 'bmpSupported' => false,
  75. 'quality' => 80);
  76. /*
  77. Set the maximum size of uploaded images. If an uploaded image is larger, it
  78. gets scaled down proportionally. Set to 0 to disable this feature.
  79. */
  80. $config['Images'] = Array(
  81. 'maxWidth' => 1600,
  82. 'maxHeight' => 1200,
  83. 'quality' => 80);
  84. /*
  85. RoleSessionVar : the session variable name that CKFinder must use to retrieve
  86. the "role" of the current user. The "role", can be used in the "AccessControl"
  87. settings (bellow in this page).
  88. To be able to use this feature, you must initialize the session data by
  89. uncommenting the following "session_start()" call.
  90. */
  91. $config['RoleSessionVar'] = 'CKFinder_UserRole';
  92. //session_start();
  93. /*
  94. AccessControl : used to restrict access or features to specific folders.
  95. Many "AccessControl" entries can be added. All attributes are optional.
  96. Subfolders inherit their default settings from their parents' definitions.
  97. - The "role" attribute accepts the special '*' value, which means
  98. "everybody".
  99. - The "resourceType" attribute accepts the special value '*', which
  100. means "all resource types".
  101. */
  102. $config['AccessControl'][] = Array(
  103. 'role' => '*',
  104. 'resourceType' => '*',
  105. 'folder' => '/',
  106. 'folderView' => true,
  107. 'folderCreate' => true,
  108. 'folderRename' => true,
  109. 'folderDelete' => true,
  110. 'fileView' => true,
  111. 'fileUpload' => true,
  112. 'fileRename' => true,
  113. 'fileDelete' => true);
  114. /*
  115. For example, if you want to restrict the upload, rename or delete of files in
  116. the "Logos" folder of the resource type "Images", you may uncomment the
  117. following definition, leaving the above one:
  118. $config['AccessControl'][] = Array(
  119. 'role' => '*',
  120. 'resourceType' => 'Images',
  121. 'folder' => '/Logos',
  122. 'folderView' => true,
  123. 'folderCreate' => true,
  124. 'folderRename' => true,
  125. 'folderDelete' => true,
  126. 'fileView' => true,
  127. 'fileUpload' => false,
  128. 'fileRename' => false,
  129. 'fileDelete' => false);
  130. */
  131. /*
  132. ResourceType : defines the "resource types" handled in CKFinder. A resource
  133. type is nothing more than a way to group files under different paths, each one
  134. having different configuration settings.
  135. Each resource type name must be unique.
  136. When loading CKFinder, the "type" querystring parameter can be used to display
  137. a specific type only. If "type" is omitted in the URL, the
  138. "DefaultResourceTypes" settings is used (may contain the resource type names
  139. separated by a comma). If left empty, all types are loaded.
  140. maxSize is defined in bytes, but shorthand notation may be also used.
  141. Available options are: G, M, K (case insensitive).
  142. 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte.
  143. Example: 'maxSize' => "8M",
  144. */
  145. $config['DefaultResourceTypes'] = '';
  146. $config['ResourceType'][] = Array(
  147. 'name' => 'Files', // Single quotes not allowed
  148. 'url' => $baseUrl . 'files',
  149. 'directory' => $baseDir . 'files',
  150. 'maxSize' => 0,
  151. 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
  152. 'deniedExtensions' => '');
  153. $config['ResourceType'][] = Array(
  154. 'name' => 'Images',
  155. 'url' => $baseUrl . 'images',
  156. 'directory' => $baseDir . 'images',
  157. 'maxSize' => 0,
  158. 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
  159. 'deniedExtensions' => '');
  160. $config['ResourceType'][] = Array(
  161. 'name' => 'Flash',
  162. 'url' => $baseUrl . 'flash',
  163. 'directory' => $baseDir . 'flash',
  164. 'maxSize' => 0,
  165. 'allowedExtensions' => 'swf,flv',
  166. 'deniedExtensions' => '');
  167. /*
  168. Due to security issues with Apache modules, it is recommended to leave the
  169. following setting enabled.
  170. How does it work? Suppose the following:
  171. - If "php" is on the denied extensions list, a file named foo.php cannot be
  172. uploaded.
  173. - If "rar" (or any other) extension is allowed, one can upload a file named
  174. foo.rar.
  175. - The file foo.php.rar has "rar" extension so, in theory, it can be also
  176. uploaded.
  177. In some conditions Apache can treat the foo.php.rar file just like any PHP
  178. script and execute it.
  179. If CheckDoubleExtension is enabled, each part of the file name after a dot is
  180. checked, not only the last part. In this way, uploading foo.php.rar would be
  181. denied, because "php" is on the denied extensions list.
  182. */
  183. $config['CheckDoubleExtension'] = true;
  184. /*
  185. Increases the security on an IIS web server.
  186. If enabled, CKFinder will disallow creating folders and uploading files whose names contain characters
  187. that are not safe under an IIS web server.
  188. */
  189. $config['DisallowUnsafeCharacters'] = false;
  190. /*
  191. If you have iconv enabled (visit http://php.net/iconv for more information),
  192. you can use this directive to specify the encoding of file names in your
  193. system. Acceptable values can be found at:
  194. http://www.gnu.org/software/libiconv/
  195. Examples:
  196. $config['FilesystemEncoding'] = 'CP1250';
  197. $config['FilesystemEncoding'] = 'ISO-8859-2';
  198. */
  199. $config['FilesystemEncoding'] = 'UTF-8';
  200. /*
  201. Perform additional checks for image files
  202. if set to true, validate image size
  203. */
  204. $config['SecureImageUploads'] = true;
  205. /*
  206. Indicates that the file size (maxSize) for images must be checked only
  207. after scaling them. Otherwise, it is checked right after uploading.
  208. */
  209. $config['CheckSizeAfterScaling'] = true;
  210. /*
  211. For security, HTML is allowed in the first Kb of data for files having the
  212. following extensions only.
  213. */
  214. $config['HtmlExtensions'] = array('html', 'htm', 'xml', 'js');
  215. /*
  216. Folders to not display in CKFinder, no matter their location.
  217. No paths are accepted, only the folder name.
  218. The * and ? wildcards are accepted.
  219. */
  220. $config['HideFolders'] = Array(".svn", "CVS");
  221. /*
  222. Files to not display in CKFinder, no matter their location.
  223. No paths are accepted, only the file name, including extension.
  224. The * and ? wildcards are accepted.
  225. */
  226. $config['HideFiles'] = Array(".*");
  227. /*
  228. After file is uploaded, sometimes it is required to change its permissions
  229. so that it was possible to access it at the later time.
  230. If possible, it is recommended to set more restrictive permissions, like 0755.
  231. Set to 0 to disable this feature.
  232. Note: not needed on Windows-based servers.
  233. */
  234. $config['ChmodFiles'] = 0777 ;
  235. /*
  236. See comments above.
  237. Used when creating folders that does not exist.
  238. */
  239. $config['ChmodFolders'] = 0755 ;
  240. /*
  241. Force ASCII names for files and folders.
  242. If enabled, characters with diactric marks, like å, ä, ö, ć, č, đ, š
  243. will be automatically converted to ASCII letters.
  244. */
  245. $config['ForceAscii'] = false;
  246. /*
  247. Send files using X-Sendfile module
  248. Mod X-Sendfile (or similar) is avalible on Apache2, Nginx, Cherokee, Lighttpd
  249. Enabling X-Sendfile option can potentially cause security issue.
  250. - server path to the file may be send to the browser with X-Sendfile header
  251. - if server is not configured properly files will be send with 0 length
  252. For more complex configuration options visit our Developer's Guide
  253. http://docs.cksource.com/CKFinder_2.x/Developers_Guide/PHP
  254. */
  255. $config['XSendfile'] = false;
  256. include_once "plugins/imageresize/plugin.php";
  257. include_once "plugins/fileeditor/plugin.php";
  258. include_once "plugins/zip/plugin.php";
  259. $config['plugin_imageresize']['smallThumb'] = '90x90';
  260. $config['plugin_imageresize']['mediumThumb'] = '120x120';
  261. $config['plugin_imageresize']['largeThumb'] = '180x180';