/EQT_V1/EQTWebApp/fckeditor/editor/filemanager/connectors/py/config.py

http://sgsoft-las.googlecode.com/ · Python · 146 lines · 48 code · 16 blank · 82 comment · 8 complexity · 3c782eb1f1aabecaac8753e93d7bf1bc MD5 · raw file

  1. #!/usr/bin/env python
  2. """
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2009 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 Python
  23. """
  24. # INSTALLATION NOTE: You must set up your server environment accordingly to run
  25. # python scripts. This connector requires Python 2.4 or greater.
  26. #
  27. # Supported operation modes:
  28. # * WSGI (recommended): You'll need apache + mod_python + modpython_gateway
  29. # or any web server capable of the WSGI python standard
  30. # * Plain Old CGI: Any server capable of running standard python scripts
  31. # (although mod_python is recommended for performance)
  32. # This was the previous connector version operation mode
  33. #
  34. # If you're using Apache web server, replace the htaccess.txt to to .htaccess,
  35. # and set the proper options and paths.
  36. # For WSGI and mod_python, you may need to download modpython_gateway from:
  37. # http://projects.amor.org/misc/svn/modpython_gateway.py and copy it in this
  38. # directory.
  39. # SECURITY: You must explicitly enable this "connector". (Set it to "True").
  40. # WARNING: don't just set "ConfigIsEnabled = True", you must be sure that only
  41. # authenticated users can access this file or use some kind of session checking.
  42. Enabled = False
  43. # Path to user files relative to the document root.
  44. UserFilesPath = '/userfiles/'
  45. # Fill the following value it you prefer to specify the absolute path for the
  46. # user files directory. Useful if you are using a virtual directory, symbolic
  47. # link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  48. # Attention: The above 'UserFilesPath' must point to the same directory.
  49. # WARNING: GetRootPath may not work in virtual or mod_python configurations, and
  50. # may not be thread safe. Use this configuration parameter instead.
  51. UserFilesAbsolutePath = ''
  52. # Due to security issues with Apache modules, it is recommended to leave the
  53. # following setting enabled.
  54. ForceSingleExtension = True
  55. # What the user can do with this connector
  56. ConfigAllowedCommands = [ 'QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder' ]
  57. # Allowed Resource Types
  58. ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media']
  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. ChmodOnUpload = 0755
  65. # See comments above.
  66. # Used when creating folders that does not exist.
  67. ChmodOnFolderCreate = 0755
  68. # Do not touch this 3 lines, see "Configuration settings for each Resource Type"
  69. AllowedExtensions = {}; DeniedExtensions = {};
  70. FileTypesPath = {}; FileTypesAbsolutePath = {};
  71. QuickUploadPath = {}; QuickUploadAbsolutePath = {};
  72. # Configuration settings for each Resource Type
  73. #
  74. # - AllowedExtensions: the possible extensions that can be allowed.
  75. # If it is empty then any file type can be uploaded.
  76. # - DeniedExtensions: The extensions that won't be allowed.
  77. # If it is empty then no restrictions are done here.
  78. #
  79. # For a file to be uploaded it has to fulfill both the AllowedExtensions
  80. # and DeniedExtensions (that's it: not being denied) conditions.
  81. #
  82. # - FileTypesPath: the virtual folder relative to the document root where
  83. # these resources will be located.
  84. # Attention: It must start and end with a slash: '/'
  85. #
  86. # - FileTypesAbsolutePath: the physical path to the above folder. It must be
  87. # an absolute path.
  88. # If it's an empty string then it will be autocalculated.
  89. # Useful if you are using a virtual directory, symbolic link or alias.
  90. # Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  91. # Attention: The above 'FileTypesPath' must point to the same directory.
  92. # Attention: It must end with a slash: '/'
  93. #
  94. #
  95. # - QuickUploadPath: the virtual folder relative to the document root where
  96. # these resources will be uploaded using the Upload tab in the resources
  97. # dialogs.
  98. # Attention: It must start and end with a slash: '/'
  99. #
  100. # - QuickUploadAbsolutePath: the physical path to the above folder. It must be
  101. # an absolute path.
  102. # If it's an empty string then it will be autocalculated.
  103. # Useful if you are using a virtual directory, symbolic link or alias.
  104. # Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  105. # Attention: The above 'QuickUploadPath' must point to the same directory.
  106. # Attention: It must end with a slash: '/'
  107. AllowedExtensions['File'] = ['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']
  108. DeniedExtensions['File'] = []
  109. FileTypesPath['File'] = UserFilesPath + 'file/'
  110. FileTypesAbsolutePath['File'] = (not UserFilesAbsolutePath == '') and (UserFilesAbsolutePath + 'file/') or ''
  111. QuickUploadPath['File'] = FileTypesPath['File']
  112. QuickUploadAbsolutePath['File'] = FileTypesAbsolutePath['File']
  113. AllowedExtensions['Image'] = ['bmp','gif','jpeg','jpg','png']
  114. DeniedExtensions['Image'] = []
  115. FileTypesPath['Image'] = UserFilesPath + 'image/'
  116. FileTypesAbsolutePath['Image'] = (not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'image/' or ''
  117. QuickUploadPath['Image'] = FileTypesPath['Image']
  118. QuickUploadAbsolutePath['Image']= FileTypesAbsolutePath['Image']
  119. AllowedExtensions['Flash'] = ['swf','flv']
  120. DeniedExtensions['Flash'] = []
  121. FileTypesPath['Flash'] = UserFilesPath + 'flash/'
  122. FileTypesAbsolutePath['Flash'] = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'flash/' or ''
  123. QuickUploadPath['Flash'] = FileTypesPath['Flash']
  124. QuickUploadAbsolutePath['Flash']= FileTypesAbsolutePath['Flash']
  125. AllowedExtensions['Media'] = ['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']
  126. DeniedExtensions['Media'] = []
  127. FileTypesPath['Media'] = UserFilesPath + 'media/'
  128. FileTypesAbsolutePath['Media'] = ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'media/' or ''
  129. QuickUploadPath['Media'] = FileTypesPath['Media']
  130. QuickUploadAbsolutePath['Media']= FileTypesAbsolutePath['Media']