~dangarner/xibo/334359

« back to all changes in this revision

Viewing changes to server/3rdparty/fckeditor/editor/filemanager/connectors/aspx/config.ascx

  • Committer: Alex Harrington
  • Date: 2009-02-23 08:34:26 UTC
  • mfrom: (1.1.85 Xibo)
  • Revision ID: alex@longhill.org.uk-20090223083426-kdq80nu0zucqjyu0
[server] Merged from lp:~dangarner/xibo/xibo-server for 1.0.0-rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %>
 
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 Browser Connector for ASP.NET.
 
23
--%>
 
24
<script runat="server">
 
25
        
 
26
        /**
 
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.
 
29
         */
 
30
        private bool CheckAuthentication()
 
31
        {
 
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...
 
35
                //
 
36
                //              return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
 
37
                //
 
38
                // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
 
39
                // user logs in your system.
 
40
 
 
41
                return false;
 
42
        }
 
43
 
 
44
        public override void SetConfig()
 
45
        {
 
46
                // SECURITY: You must explicitly enable this "connector". (Set it to "true").
 
47
                Enabled = CheckAuthentication();
 
48
 
 
49
                // URL path to user files.
 
50
                UserFilesPath = "/userfiles/";
 
51
 
 
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 = "";
 
57
 
 
58
                // Due to security issues with Apache modules, it is recommended to leave the
 
59
                // following setting enabled.
 
60
                ForceSingleExtension = true;
 
61
 
 
62
                // Allowed Resource Types
 
63
                AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
 
64
 
 
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" };
 
68
 
 
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%" );
 
75
 
 
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%" );
 
82
 
 
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%" );
 
89
 
 
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%" );
 
96
        }
 
97
        
 
98
</script>