Project

General

Profile

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.
45
Enabled = False
46

    
47
# Path to user files relative to the document root.
48
UserFilesPath = '/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.
56
UserFilesAbsolutePath = ''
57

    
58
# Due to security issues with Apache modules, it is recommended to leave the
59
# following setting enabled.
60
ForceSingleExtension = True
61

    
62
# What the user can do with this connector
63
ConfigAllowedCommands = [ 'QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder' ]
64

    
65
# Allowed Resource Types
66
ConfigAllowedTypes = ['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.
73
ChmodOnUpload = 0755
74

    
75
# See comments above.
76
# Used when creating folders that does not exist.
77
ChmodOnFolderCreate = 0755
78

    
79
# Do not touch this 3 lines, see "Configuration settings for each Resource Type"
80
AllowedExtensions = {}; DeniedExtensions = {};
81
FileTypesPath = {}; FileTypesAbsolutePath = {};
82
QuickUploadPath = {}; 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

    
120
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']
121
DeniedExtensions['File'] 		= []
122
FileTypesPath['File'] 			= UserFilesPath + 'file/'
123
FileTypesAbsolutePath['File'] 	= (not UserFilesAbsolutePath == '') and (UserFilesAbsolutePath + 'file/') or ''
124
QuickUploadPath['File']			= FileTypesPath['File']
125
QuickUploadAbsolutePath['File']	= FileTypesAbsolutePath['File']
126

    
127
AllowedExtensions['Image']		= ['bmp','gif','jpeg','jpg','png']
128
DeniedExtensions['Image']		= []
129
FileTypesPath['Image']			= UserFilesPath + 'image/'
130
FileTypesAbsolutePath['Image']	= (not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'image/' or ''
131
QuickUploadPath['Image']		= FileTypesPath['Image']
132
QuickUploadAbsolutePath['Image']= FileTypesAbsolutePath['Image']
133

    
134
AllowedExtensions['Flash']		= ['swf','flv']
135
DeniedExtensions['Flash']		= []
136
FileTypesPath['Flash']			= UserFilesPath + 'flash/'
137
FileTypesAbsolutePath['Flash']	= ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'flash/' or ''
138
QuickUploadPath['Flash']		= FileTypesPath['Flash']
139
QuickUploadAbsolutePath['Flash']= FileTypesAbsolutePath['Flash']
140

    
141
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']
142
DeniedExtensions['Media']		= []
143
FileTypesPath['Media']			= UserFilesPath + 'media/'
144
FileTypesAbsolutePath['Media']	= ( not UserFilesAbsolutePath == '') and UserFilesAbsolutePath + 'media/' or ''
145
QuickUploadPath['Media']		= FileTypesPath['Media']
146
QuickUploadAbsolutePath['Media']= FileTypesAbsolutePath['Media']
(1-1/10)