Home directory for Malawi's wwwroot
Duncan Ewan
2021-02-19 3e758c29e0fde36fc088efcfc88f9a3014432b64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<cfsetting enablecfoutputonly="Yes">
<!---
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * Configuration file for the ColdFusion Connector (all versions).
--->
 
<cfscript>
    Config = StructNew() ;
 
    // SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
    Config.Enabled = false ;
 
    // Path to uploaded files relative to the document root.
    Config.UserFilesPath = "/userfiles/" ;
 
    // Use this to force the server path if FCKeditor is not running directly off
    // the root of the application or the FCKeditor directory in the URL is a virtual directory
    // or a symbolic link / junction
    // Example: C:\inetpub\wwwroot\myDocs\
    Config.ServerPath = "" ;
 
    // Due to security issues with Apache modules, it is recommended to leave the
    // following setting enabled.
    Config.ForceSingleExtension = true ;
 
    // Perform additional checks for image files - if set to true, validate image size
    // (This feature works in MX 6.0 and above)
    Config.SecureImageUploads = true;
 
    // What the user can do with this connector
    Config.ConfigAllowedCommands             = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ;
 
    //Allowed Resource Types
    Config.ConfigAllowedTypes                 = "File,Image,Flash,Media" ;
 
    // For security, HTML is allowed in the first Kb of data for files having the
    // following extensions only.
    // (This feature works in MX 6.0 and above))
    Config.HtmlExtensions                    = "html,htm,xml,xsd,txt,js" ;
 
    //Due to known issues with GetTempDirectory function, it is
    //recommended to set this vairiable to a valid directory
    //instead of using the GetTempDirectory function
    //(used by MX 6.0 and above)
    Config.TempDirectory = GetTempDirectory();
 
//    Configuration settings for each Resource Type
//
//    - AllowedExtensions: the possible extensions that can be allowed.
//        If it is empty then any file type can be uploaded.
//    - DeniedExtensions: The extensions that won't be allowed.
//        If it is empty then no restrictions are done here.
//
//    For a file to be uploaded it has to fulfill both the AllowedExtensions
//    and DeniedExtensions (that's it: not being denied) conditions.
//
//    - FileTypesPath: the virtual folder relative to the document root where
//        these resources will be located.
//        Attention: It must start and end with a slash: '/'
//
//    - FileTypesAbsolutePath: the physical path to the above folder. It must be
//        an absolute path.
//        If it's an empty string then it will be autocalculated.
//        Usefull if you are using a virtual directory, symbolic link or alias.
//        Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
//        Attention: The above 'FileTypesPath' must point to the same directory.
//        Attention: It must end with a slash: '/'
//
//
//     - QuickUploadPath: the virtual folder relative to the document root where
//        these resources will be uploaded using the Upload tab in the resources
//        dialogs.
//        Attention: It must start and end with a slash: '/'
//
//     - QuickUploadAbsolutePath: the physical path to the above folder. It must be
//        an absolute path.
//        If it's an empty string then it will be autocalculated.
//        Usefull if you are using a virtual directory, symbolic link or alias.
//        Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
//        Attention: The above 'QuickUploadPath' must point to the same directory.
//        Attention: It must end with a slash: '/'
 
    Config.AllowedExtensions                 = StructNew() ;
    Config.DeniedExtensions                 = StructNew() ;
    Config.FileTypesPath                     = StructNew() ;
    Config.FileTypesAbsolutePath             = StructNew() ;
    Config.QuickUploadPath                     = StructNew() ;
    Config.QuickUploadAbsolutePath             = StructNew() ;
 
    Config.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" ;
    Config.DeniedExtensions["File"]         = "" ;
    Config.FileTypesPath["File"]             = Config.UserFilesPath & 'file/' ;
    Config.FileTypesAbsolutePath["File"]     = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ;
    Config.QuickUploadPath["File"]             = Config.FileTypesPath["File"] ;
    Config.QuickUploadAbsolutePath["File"]     = Config.FileTypesAbsolutePath["File"] ;
 
    Config.AllowedExtensions["Image"]         = "bmp,gif,jpeg,jpg,png" ;
    Config.DeniedExtensions["Image"]         = "" ;
    Config.FileTypesPath["Image"]             = Config.UserFilesPath & 'image/' ;
    Config.FileTypesAbsolutePath["Image"]     = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ;
    Config.QuickUploadPath["Image"]         = Config.FileTypesPath["Image"] ;
    Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ;
 
    Config.AllowedExtensions["Flash"]         = "swf,flv" ;
    Config.DeniedExtensions["Flash"]         = "" ;
    Config.FileTypesPath["Flash"]             = Config.UserFilesPath & 'flash/' ;
    Config.FileTypesAbsolutePath["Flash"]     = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ;
    Config.QuickUploadPath["Flash"]         = Config.FileTypesPath["Flash"] ;
    Config.QuickUploadAbsolutePath["Flash"] = Config.FileTypesAbsolutePath["Flash"] ;
 
    Config.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" ;
    Config.DeniedExtensions["Media"]         = "" ;
    Config.FileTypesPath["Media"]             = Config.UserFilesPath & 'media/' ;
    Config.FileTypesAbsolutePath["Media"]     = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ;
    Config.QuickUploadPath["Media"]         = Config.FileTypesPath["Media"] ;
    Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ;
</cfscript>
 
<cftry>
<!--- code to maintain backwards compatibility with previous version of cfm connector --->
<cfif isDefined("application.userFilesPath")>
 
    <cflock scope="application" type="readonly" timeout="5">
        <cfset config.userFilesPath = application.userFilesPath>
    </cflock>
 
<cfelseif isDefined("server.userFilesPath")>
 
    <cflock scope="server" type="readonly" timeout="5">
        <cfset config.userFilesPath = server.userFilesPath>
    </cflock>
 
</cfif>
 
<!--- look for config struct in application and server scopes --->
<cfif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
 
    <cflock scope="application" type="readonly" timeout="5">
    <cfset variables.FCKeditor = duplicate(application.FCKeditor)>
    </cflock>
 
<cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
 
    <cflock scope="server" type="readonly" timeout="5">
    <cfset variables.FCKeditor = duplicate(server.FCKeditor)>
    </cflock>
 
</cfif>
    <!--- catch potential "The requested scope application has not been enabled" exception --->
    <cfcatch type="any">
    </cfcatch>
</cftry>
 
<cfif isDefined("FCKeditor")>
 
    <!--- copy key values from external to local config (i.e. override default config as required) --->
    <cfscript>
        function structCopyKeys(stFrom, stTo) {
            for ( key in stFrom ) {
                if ( isStruct(stFrom[key]) ) {
                    structCopyKeys(stFrom[key],stTo[key]);
                } else {
                    stTo[key] = stFrom[key];
                }
            }
        }
        structCopyKeys(FCKeditor, config);
    </cfscript>
 
</cfif>