~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/web/static/htdocs/applets/FCKeditor/editor/filemanager/connectors/cfm/cf_connector.cfm

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
 
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
 * File Browser connector for ColdFusion (MX 6.0 and above).
 
23
 * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
 
24
 *
 
25
--->
 
26
 
 
27
<cfparam name="url.command">
 
28
<cfparam name="url.type">
 
29
<cfparam name="url.currentFolder">
 
30
 
 
31
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
 
32
 
 
33
<cfinclude template="config.cfm">
 
34
<cfinclude template="cf_util.cfm">
 
35
<cfinclude template="cf_io.cfm">
 
36
<cfinclude template="cf_basexml.cfm">
 
37
<cfinclude template="cf_commands.cfm">
 
38
 
 
39
<cfif not Config.Enabled>
 
40
        <cfset SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
 
41
</cfif>
 
42
 
 
43
<cfset REQUEST.Config = Config>
 
44
<cfif find( "/", getBaseTemplatePath() ) >
 
45
        <cfset REQUEST.Fs = "/">
 
46
<cfelse>
 
47
        <cfset REQUEST.Fs = "\">
 
48
</cfif>
 
49
 
 
50
<cfset DoResponse() >
 
51
 
 
52
<cffunction name="DoResponse" output="true" returntype="void">
 
53
 
 
54
        <!--- Get the main request informaiton. --->
 
55
        <cfset var sCommand     = "#URL.Command#" >
 
56
        <cfset var sResourceType        = URL.Type >
 
57
        <cfset var sCurrentFolder       = GetCurrentFolder() >
 
58
 
 
59
        <!--- Check if it is an allowed command --->
 
60
        <cfif not IsAllowedCommand( sCommand ) >
 
61
                <cfset SendError( 1, "The """ & sCommand & """ command isn't allowed" ) >
 
62
        </cfif>
 
63
 
 
64
        <!--- Check if it is an allowed type. --->
 
65
        <cfif not IsAllowedType( sResourceType ) >
 
66
                <cfset SendError( 1, 'Invalid type specified' ) >
 
67
        </cfif>
 
68
 
 
69
        <!--- File Upload doesn't have to Return XML, so it must be intercepted before anything. --->
 
70
        <cfif sCommand eq "FileUpload">
 
71
                <cfset FileUpload( sResourceType, sCurrentFolder, sCommand )>
 
72
                <cfabort>
 
73
        </cfif>
 
74
 
 
75
        <cfset CreateXmlHeader( sCommand, sResourceType, sCurrentFolder )>
 
76
 
 
77
        <!--- Execute the required command. --->
 
78
        <cfif sCommand eq "GetFolders">
 
79
                <cfset GetFolders( sResourceType, sCurrentFolder ) >
 
80
        <cfelseif sCommand eq "GetFoldersAndFiles">
 
81
                <cfset GetFoldersAndFiles( sResourceType, sCurrentFolder ) >
 
82
        <cfelseif sCommand eq "CreateFolder">
 
83
                <cfset CreateFolder( sResourceType, sCurrentFolder ) >
 
84
        </cfif>
 
85
 
 
86
        <cfset CreateXmlFooter()>
 
87
 
 
88
        <cfexit>
 
89
</cffunction>