1
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %>
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* Configuration file for the File Browser Connector for ASP.NET.
24
<script runat="server">
27
* This function must check the user session to be sure that he/she is
28
* authorized to upload and access files in the File Browser.
30
private bool CheckAuthentication()
32
// WARNING : DO NOT simply return "true". By doing so, you are allowing
33
// "anyone" to upload and list the files in your server. You must implement
34
// some kind of session validation here. Even something very simple as...
36
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
38
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
39
// user logs in your system.
44
public override void SetConfig()
46
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
47
Enabled = CheckAuthentication();
49
// URL path to user files.
50
UserFilesPath = "/userfiles/";
52
// The connector tries to resolve the above UserFilesPath automatically.
53
// Use the following setting it you prefer to explicitely specify the
54
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
55
// Attention: The above 'UserFilesPath' URL must point to the same directory.
56
UserFilesAbsolutePath = "";
58
// Due to security issues with Apache modules, it is recommended to leave the
59
// following setting enabled.
60
ForceSingleExtension = true;
62
// Allowed Resource Types
63
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
65
// For security, HTML is allowed in the first Kb of data for files having the
66
// following extensions only.
67
HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };
69
TypeConfig[ "File" ].AllowedExtensions = new string[] { "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" };
70
TypeConfig[ "File" ].DeniedExtensions = new string[] { };
71
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
72
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
73
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%";
74
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
76
TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
77
TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
78
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
79
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
80
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%";
81
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
83
TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
84
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
85
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
86
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
87
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
88
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
90
TypeConfig[ "Media" ].AllowedExtensions = new string[] { "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" };
91
TypeConfig[ "Media" ].DeniedExtensions = new string[] { };
92
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
93
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
94
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
95
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );