1
|
<%@ CodePage=65001 Language="VBScript"%>
|
2
|
<%
|
3
|
Option Explicit
|
4
|
Response.Buffer = True
|
5
|
%>
|
6
|
<%
|
7
|
' FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
8
|
' Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
9
|
'
|
10
|
' == BEGIN LICENSE ==
|
11
|
'
|
12
|
' Licensed under the terms of any of the following licenses at your
|
13
|
' choice:
|
14
|
'
|
15
|
' - GNU General Public License Version 2 or later (the "GPL")
|
16
|
' http://www.gnu.org/licenses/gpl.html
|
17
|
'
|
18
|
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
19
|
' http://www.gnu.org/licenses/lgpl.html
|
20
|
'
|
21
|
' - Mozilla Public License Version 1.1 or later (the "MPL")
|
22
|
' http://www.mozilla.org/MPL/MPL-1.1.html
|
23
|
'
|
24
|
' == END LICENSE ==
|
25
|
'
|
26
|
' This is the File Manager Connector for ASP.
|
27
|
%>
|
28
|
<!--#include file="config.asp"-->
|
29
|
<!--#include file="util.asp"-->
|
30
|
<!--#include file="io.asp"-->
|
31
|
<!--#include file="basexml.asp"-->
|
32
|
<!--#include file="commands.asp"-->
|
33
|
<!--#include file="class_upload.asp"-->
|
34
|
<%
|
35
|
|
36
|
If ( ConfigIsEnabled = False ) Then
|
37
|
SendError 1, "This connector is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file"
|
38
|
End If
|
39
|
|
40
|
DoResponse
|
41
|
|
42
|
Sub DoResponse()
|
43
|
Dim sCommand, sResourceType, sCurrentFolder
|
44
|
|
45
|
' Get the main request information.
|
46
|
sCommand = Request.QueryString("Command")
|
47
|
|
48
|
sResourceType = Request.QueryString("Type")
|
49
|
If ( sResourceType = "" ) Then sResourceType = "File"
|
50
|
|
51
|
sCurrentFolder = GetCurrentFolder()
|
52
|
|
53
|
' Check if it is an allowed command
|
54
|
if ( Not IsAllowedCommand( sCommand ) ) then
|
55
|
SendError 1, "The """ & sCommand & """ command isn't allowed"
|
56
|
end if
|
57
|
|
58
|
' Check if it is an allowed resource type.
|
59
|
if ( Not IsAllowedType( sResourceType ) ) Then
|
60
|
SendError 1, "Invalid type specified"
|
61
|
end if
|
62
|
|
63
|
' File Upload doesn't have to Return XML, so it must be intercepted before anything.
|
64
|
If ( sCommand = "FileUpload" ) Then
|
65
|
FileUpload sResourceType, sCurrentFolder, sCommand
|
66
|
Exit Sub
|
67
|
End If
|
68
|
|
69
|
SetXmlHeaders
|
70
|
|
71
|
CreateXmlHeader sCommand, sResourceType, sCurrentFolder, GetUrlFromPath( sResourceType, sCurrentFolder, sCommand)
|
72
|
|
73
|
' Execute the required command.
|
74
|
Select Case sCommand
|
75
|
Case "GetFolders"
|
76
|
GetFolders sResourceType, sCurrentFolder
|
77
|
Case "GetFoldersAndFiles"
|
78
|
GetFoldersAndFiles sResourceType, sCurrentFolder
|
79
|
Case "CreateFolder"
|
80
|
CreateFolder sResourceType, sCurrentFolder
|
81
|
End Select
|
82
|
|
83
|
CreateXmlFooter
|
84
|
|
85
|
Response.End
|
86
|
End Sub
|
87
|
|
88
|
%>
|