1<?php
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 * This is the "File Uploader" for PHP.
23 */
24
25require('./config.php') ;
26require('./util.php') ;
27require('./io.php') ;
28require('./commands.php') ;
29require('./phpcompat.php') ;
30require_once('./SafeFN.class.php');
31require_once 'input_utils.php';
32
33function SendError( $number, $text )
34{
35	SendUploadResults( $number, '', '', $text ) ;
36}
37
38
39// Check if this uploader has been enabled.
40if ( !$Config['Enabled'] )
41	SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ;
42
43$sCommand = 'QuickUpload' ;
44
45// The file type (from the QueryString, by default 'File').
46$sType =  input_strval('Type');
47if(!$sType) $sType = 'File' ;
48$sCurrentFolder	= "/" ;
49
50// Is enabled the upload?
51if ( ! IsAllowedCommand( $sCommand ) )
52	SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' ) ;
53
54// Check if it is an allowed type.
55if ( !IsAllowedType( $sType ) )
56    SendUploadResults( 1, '', '', 'Invalid type specified' ) ;
57
58
59FileUpload( $sType, $sCurrentFolder, $sCommand );
60
61?>
62