PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/web aztheme.net/wp-content/plugins/ckeditor-for-wordpress/filemanager/connectors/php/config.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien
PHP | 148 lines | 35 code | 17 blank | 96 comment | 5 complexity | 0f23cb84c5e2413873e6f746e374c681 MD5 | raw file
  1. <?php
  2. /*
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2007 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. $error_reporting = error_reporting();
  25. error_reporting($error_reporting & ~E_STRICT);
  26. require_once(dirname(__FILE__). '/../../../../../../wp-config.php');
  27. require_once(dirname(__FILE__). '/../../../ckeditor_class.php');
  28. $Config = array();
  29. // SECURITY: You must explicitly enable this "connector". (Set it to "true").
  30. // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
  31. // authenticated users can access this file or use some kind of session checking.
  32. $Config['Enabled'] = $ckeditor_wordpress->file_browser == 'builtin' && $ckeditor_wordpress->can_upload();
  33. // Path to user files relative to the document root.
  34. $Config['UserFilesPath'] = $ckeditor_wordpress->user_files_url;
  35. // Fill the following value it you prefer to specify the absolute path for the
  36. // user files directory. Useful if you are using a virtual directory, symbolic
  37. // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  38. // Attention: The above 'UserFilesPath' must point to the same directory.
  39. $Config['UserFilesAbsolutePath'] = $ckeditor_wordpress->user_files_absolute_path;
  40. // Due to security issues with Apache modules, it is recommended to leave the
  41. // following setting enabled.
  42. $Config['ForceSingleExtension'] = true ;
  43. // Perform additional checks for image files
  44. // if set to true, validate image size (using getimagesize)
  45. $Config['SecureImageUploads'] = true;
  46. // After file is uploaded, sometimes it is required to change its permissions
  47. // so that it was possible to access it at the later time.
  48. // If possible, it is recommended to set more restrictive permissions, like 0755.
  49. // Set to 0 to disable this feature.
  50. // Note: not needed on Windows-based servers.
  51. $Config['ChmodOnUpload'] = 0644 ;
  52. // See comments above.
  53. // Used when creating folders that does not exist.
  54. $Config['ChmodOnFolderCreate'] = 0755 ;
  55. // What the user can do with this connector
  56. $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;
  57. // Allowed Resource Types
  58. $Config['ConfigAllowedTypes'] = array('Files', 'Images', 'Flash') ;
  59. // For security, HTML is allowed in the first Kb of data for files having the
  60. // following extensions only.
  61. $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;
  62. /*
  63. Configuration settings for each Resource Type
  64. - AllowedExtensions: the possible extensions that can be allowed.
  65. If it is empty then any file type can be uploaded.
  66. - DeniedExtensions: The extensions that won't be allowed.
  67. If it is empty then no restrictions are done here.
  68. For a file to be uploaded it has to fulfill both the AllowedExtensions
  69. and DeniedExtensions (that's it: not being denied) conditions.
  70. - FileTypesPath: the virtual folder relative to the document root where
  71. these resources will be located.
  72. Attention: It must start and end with a slash: '/'
  73. - FileTypesAbsolutePath: the physical path to the above folder. It must be
  74. an absolute path.
  75. If it's an empty string then it will be autocalculated.
  76. Useful if you are using a virtual directory, symbolic link or alias.
  77. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  78. Attention: The above 'FileTypesPath' must point to the same directory.
  79. Attention: It must end with a slash: '/'
  80. - QuickUploadPath: the virtual folder relative to the document root where
  81. these resources will be uploaded using the Upload tab in the resources
  82. dialogs.
  83. Attention: It must start and end with a slash: '/'
  84. - QuickUploadAbsolutePath: the physical path to the above folder. It must be
  85. an absolute path.
  86. If it's an empty string then it will be autocalculated.
  87. Useful if you are using a virtual directory, symbolic link or alias.
  88. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  89. Attention: The above 'QuickUploadPath' must point to the same directory.
  90. Attention: It must end with a slash: '/'
  91. NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
  92. "userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
  93. This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
  94. Example: if you click on "image button", select "Upload" tab and send image
  95. to the server, image will appear in FCKeditor correctly, but because it is placed
  96. directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
  97. The more expected behaviour would be to send images directly to "image" subfolder.
  98. To achieve that, simply change
  99. $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
  100. $Config['QuickUploadAbsolutePath']['Image'] = $Config['UserFilesAbsolutePath'] ;
  101. into:
  102. $Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'] ;
  103. $Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'] ;
  104. */
  105. $Config['AllowedExtensions']['Files'] = explode(',', $ckeditor_wordpress->options['upload']['files_allowed_ext']) ;
  106. $Config['DeniedExtensions']['Files'] = array() ;
  107. $Config['FileTypesPath']['Files'] = $Config['UserFilesPath'] . 'file/' ;
  108. $Config['FileTypesAbsolutePath']['Files']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
  109. $Config['QuickUploadPath']['Files'] = $Config['FileTypesPath']['Files'] ;
  110. $Config['QuickUploadAbsolutePath']['Files']= $Config['FileTypesAbsolutePath']['Files'] ;
  111. $Config['AllowedExtensions']['Images'] = explode(',', $ckeditor_wordpress->options['upload']['images_allowed_ext']) ;
  112. $Config['DeniedExtensions']['Images'] = array() ;
  113. $Config['FileTypesPath']['Images'] = $Config['UserFilesPath'] . 'image/' ;
  114. $Config['FileTypesAbsolutePath']['Images']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
  115. $Config['QuickUploadPath']['Images'] = $Config['FileTypesPath']['Images'] ;
  116. $Config['QuickUploadAbsolutePath']['Images']= $Config['FileTypesAbsolutePath']['Images'] ;
  117. $Config['AllowedExtensions']['Flash'] = explode(',', $ckeditor_wordpress->options['upload']['flash_allowed_ext']) ;
  118. $Config['DeniedExtensions']['Flash'] = array() ;
  119. $Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . 'flash/' ;
  120. $Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
  121. $Config['QuickUploadPath']['Flash'] = $Config['FileTypesPath']['Flash'] ;
  122. $Config['QuickUploadAbsolutePath']['Flash']= $Config['FileTypesAbsolutePath']['Flash'] ;
  123. ?>