4 # FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
5 # Copyright (C) 2003-2010 Frederico Caldeira Knabben
\r
7 # == BEGIN LICENSE ==
\r
9 # Licensed under the terms of any of the following licenses at your
\r
12 # - GNU General Public License Version 2 or later (the "GPL")
\r
13 # http://www.gnu.org/licenses/gpl.html
\r
15 # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
16 # http://www.gnu.org/licenses/lgpl.html
\r
18 # - Mozilla Public License Version 1.1 or later (the "MPL")
\r
19 # http://www.mozilla.org/MPL/MPL-1.1.html
\r
23 # This is the File Manager Connector for Perl.
\r
27 # ATTENTION: To enable this connector, look for the "SECURITY" comment in config.pl.
\r
30 ## START: Hack for Windows (Not important to understand the editor code... Perl specific).
\r
31 if(Windows_check()) {
\r
32 chdir(GetScriptPath($0));
\r
38 $www_server_os = $^O;
\r
40 if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
\r
42 if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
\r
44 if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
\r
45 if($www_server_os=~ /win/i) { return(1); }
\r
51 if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
\r
54 ## END: Hack for IIS
\r
58 require 'basexml.pl';
\r
59 require 'commands.pl';
\r
60 require 'upload_fck.pl';
\r
61 require 'config.pl';
\r
68 # Get the main request information.
\r
69 $sCommand = 'FileUpload';
\r
70 $sResourceType = &specialchar_cnv($FORM{'Type'});
\r
71 $sCurrentFolder = "/";
\r
73 if ($sResourceType eq '') {
\r
74 $sResourceType = 'File' ;
\r
77 if ( !($sResourceType =~ /^(File|Image|Flash|Media)$/) ) {
\r
78 SendError( 1, "Invalid type specified" ) ;
\r
81 # File Upload doesn't have to Return XML, so it must be intercepted before anything.
\r
82 if($sCommand eq 'FileUpload') {
\r
83 FileUpload($sResourceType,$sCurrentFolder);
\r