[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_ext/fckeditor/editor/filemanager/connectors/php/ -> upload.php (source)

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


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7