PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

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

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