1#!/usr/bin/env python
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 Python
23"""
24
25# INSTALLATION NOTE: You must set up your server enviroment 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 standartd 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 explicitelly 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. Usefull 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 reccomended 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# Do not touch this 3 lines, see "Configuration settings for each Resource Type"
69AllowedExtensions = {}; DeniedExtensions = {};
70FileTypesPath = {}; FileTypesAbsolutePath = {};
71QuickUploadPath = {}; QuickUploadAbsolutePath = {};
72
73#	Configuration settings for each Resource Type
74#
75#	- AllowedExtensions: the possible extensions that can be allowed.
76#		If it is empty then any file type can be uploaded.
77#	- DeniedExtensions: The extensions that won't be allowed.
78#		If it is empty then no restrictions are done here.
79#
80#	For a file to be uploaded it has to fullfil both the AllowedExtensions
81#	and DeniedExtensions (that's it: not being denied) conditions.
82#
83#	- FileTypesPath: the virtual folder relative to the document root where
84#		these resources will be located.
85#		Attention: It must start and end with a slash: '/'
86#
87#	- FileTypesAbsolutePath: the physical path to the above folder. It must be
88#		an absolute path.
89#		If it's an empty string then it will be autocalculated.
90#		Usefull if you are using a virtual directory, symbolic link or alias.
91#		Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
92#		Attention: The above 'FileTypesPath' must point to the same directory.
93#		Attention: It must end with a slash: '/'
94#
95#
96#	- QuickUploadPath: the virtual folder relative to the document root where
97#		these resources will be uploaded using the Upload tab in the resources
98#		dialogs.
99#		Attention: It must start and end with a slash: '/'
100#
101#	- QuickUploadAbsolutePath: the physical path to the above folder. It must be
102#		an absolute path.
103#		If it's an empty string then it will be autocalculated.
104#		Usefull if you are using a virtual directory, symbolic link or alias.
105#		Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
106#		Attention: The above 'QuickUploadPath' must point to the same directory.
107#		Attention: It must end with a slash: '/'
108
109AllowedExtensions['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']
110DeniedExtensions['File'] 		= []
111FileTypesPath['File'] 			= UserFilesPath + 'file/'
112FileTypesAbsolutePath['File'] 	= (not UserFilesAbsolutePath == '') and (UserFilesAbsolutePath + 'file/') or ''
113QuickUploadPath['File']			= FileTypesPath['File']
114QuickUploadAbsolutePath['File']	= FileTypesAbsolutePath['File']
115
116AllowedExtensions['Image']		= ['bmp','gif','jpeg','jpg','png','psd','tif','tiff']
117DeniedExtensions['Image']		= []
118FileTypesPath['Image']			= UserFilesPath + 'image/'
119FileTypesAbsolutePath['Image']	= (not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'image/' or ''
120QuickUploadPath['Image']		= FileTypesPath['Image']
121QuickUploadAbsolutePath['Image']= FileTypesAbsolutePath['Image']
122
123AllowedExtensions['Flash']		= ['swf','fla']
124DeniedExtensions['Flash']		= []
125FileTypesPath['Flash']			= UserFilesPath + 'flash/'
126FileTypesAbsolutePath['Flash']	= ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'flash/' or ''
127QuickUploadPath['Flash']		= FileTypesPath['Flash']
128QuickUploadAbsolutePath['Flash']= FileTypesAbsolutePath['Flash']
129
130AllowedExtensions['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']
131DeniedExtensions['Media']		= []
132FileTypesPath['Media']			= UserFilesPath + 'media/'
133FileTypesAbsolutePath['Media']	= ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'media/' or ''
134QuickUploadPath['Media']		= FileTypesPath['Media']
135QuickUploadAbsolutePath['Media']= FileTypesAbsolutePath['Media']
136