phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] news_admin/js/fckeditor/editor/filemanager/browser/d


From: skwashd
Subject: [Phpgroupware-cvs] news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php basexml.php, 1.2 config.php, 1.2 commands.php, 1.2 connector.php, 1.2 io.php, 1.2 util.php, 1.2
Date: Thu, 4 Aug 2005 05:54:00 +0200

Update of 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php

Modified Files:
     Branch: MAIN
            basexml.php lines: +34 -5
            config.php lines: +8 -8
            commands.php lines: +5 -6
            connector.php lines: +10 -19
            io.php lines: +3 -9
            util.php lines: +3 -5

Log Message:
new newsletter builder, updated FCK and a few other things

====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php:1.1
   Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php
       Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -11,15 +12,31 @@
  * File Name: basexml.php
  *     This is the File Manager Connector for ASP.
  *
- * Version:  2.0 RC3
- * Modified: 2004-12-10 17:49:19
- *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)
  */

+function SetXmlHeaders()
+{
+       // Prevent the browser from caching the result.
+       // Date in the past
+       header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
+       // always modified
+       header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
+       // HTTP/1.1
+       header('Cache-Control: no-store, no-cache, must-revalidate') ;
+       header('Cache-Control: post-check=0, pre-check=0', false) ;
+       // HTTP/1.0
+       header('Pragma: no-cache') ;
+
+       // Set the response format.
+       header( 'Content-Type:text/xml; charset=utf-8' ) ;
+}
+
 function CreateXmlHeader( $command, $resourceType, $currentFolder )
 {
+       SetXmlHeaders() ;
+
        // Create the XML document header.
        echo '<?xml version="1.0" encoding="utf-8" ?>' ;

@@ -33,5 +50,17 @@
 function CreateXmlFooter()
 {
        echo '</Connector>' ;
+}
+
+function SendError( $number, $text )
+{
+       SetXmlHeaders() ;
+
+       // Create the XML document header
+       echo '<?xml version="1.0" encoding="utf-8" ?>' ;
+
+       echo '<Connector><Error number="' . $number . '" text="' . 
htmlspecialchars( $text ) . '" /></Connector>' ;
+
+       exit ;
 }
 ?>

====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/config.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/config.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/config.php:1.1
    Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
        Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -11,21 +12,20 @@
  * File Name: config.php
  *     Configuration file for the File Manager Connector for PHP.
  *
- * Version:  2.0 RC3
- * Modified: 2005-02-08 12:01:53
- *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)
  */

 global $Config ;

+// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
+$Config['Enabled'] = false ;
+
 // Path to user files relative to the document root.
-// SECURITY TIP: Uncomment the following line to set a fixed path.
-//$Config['UserFilesPath'] = '/UserFiles/' ;
+$Config['UserFilesPath'] = '/UserFiles/' ;

 $Config['AllowedExtensions']['File']   = array() ;
-$Config['DeniedExtensions']['File']            = 
array('php','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg') 
;
+$Config['DeniedExtensions']['File']            = 
array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi')
 ;

 $Config['AllowedExtensions']['Image']  = array('jpg','gif','jpeg','png') ;
 $Config['DeniedExtensions']['Image']   = array() ;

====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php:1.1
  Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php
      Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -9,10 +10,7 @@
  *             http://www.fckeditor.net/
  *
  * File Name: commands.php
- *     This is the File Manager Connector for ASP.
- *
- * Version:  2.0 RC3
- * Modified: 2005-02-19 16:02:38
+ *     This is the File Manager Connector for PHP.
  *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)
@@ -138,6 +136,7 @@
                $sFileName = $oFile['name'] ;
                $sOriginalFileName = $sFileName ;
                $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 
1 ) ) ;
+               $sExtension = strtolower( $sExtension ) ;

                global $Config ;


====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php:1.1
 Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
     Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -11,9 +12,6 @@
  * File Name: connector.php
  *     This is the File Manager Connector for PHP.
  *
- * Version:  2.0 RC3
- * Modified: 2005-02-08 11:48:55
- *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)
  */
@@ -24,6 +22,9 @@
 include('basexml.php') ;
 include('commands.php') ;

+if ( !$Config['Enabled'] )
+       SendError( 1, 'This connector is disabled. Please check the 
"editor/filemanager/browser/default/connectors/php/config.php" file' ) ;
+
 // Get the "UserFiles" path.
 $GLOBALS["UserFilesPath"] = '' ;

@@ -61,26 +62,16 @@
        if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
        if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . 
$sCurrentFolder ;

+       // Check for invalid folder paths (..)
+       if ( strpos( $sCurrentFolder, '..' ) )
+               SendError( 102, "" ) ;
+
        // File Upload doesn't have to Return XML, so it must be intercepted 
before anything.
        if ( $sCommand == 'FileUpload' )
        {
                FileUpload( $sResourceType, $sCurrentFolder ) ;
                return ;
        }
-
-       // Prevent the browser from caching the result.
-       // Date in the past
-       header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
-       // always modified
-       header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
-       // HTTP/1.1
-       header('Cache-Control: no-store, no-cache, must-revalidate') ;
-       header('Cache-Control: post-check=0, pre-check=0', false) ;
-       // HTTP/1.0
-       header('Pragma: no-cache') ;
-
-       // Set the response format.
-       header( 'Content-Type:text/xml; charset=utf-8' ) ;

        CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ;


====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/io.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/io.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/io.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/io.php:1.1
        Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/io.php
    Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -11,9 +12,6 @@
  * File Name: io.php
  *     This is the File Manager Connector for ASP.
  *
- * Version:  2.0 RC3
- * Modified: 2005-02-19 16:03:39
- *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)
  */
@@ -34,14 +32,12 @@
 function ServerMapFolder( $resourceType, $folderPath )
 {
        // Get the resource type directory.
-//     $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . 
'\\' ;
        $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . 
'/' ;

        // Ensure that the directory exists.
        CreateServerFolder( $sResourceTypePath ) ;

        // Return the resource type directory combined with the required path.
-//     return $sResourceTypePath . str_replace( '/', '\\', RemoveFromStart( 
$folderPath, '/' ) ) ;
        return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
 }

@@ -91,9 +87,7 @@
 {
        $sRealPath = realpath( './' ) ;

-//     $sSelfPath = str_replace( '/', '\\', $_SERVER['PHP_SELF'] ) ;
        $sSelfPath = $_SERVER['PHP_SELF'] ;
-//     $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '\\' ) ) ;
        $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;

        return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath 
) ) ;

====================================================
Index: 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/util.php
diff -u 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/util.php:1.1
 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/util.php:1.2
--- 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/util.php:1.1
      Tue May 24 14:32:53 2005
+++ 
news_admin/js/fckeditor/editor/filemanager/browser/default/connectors/php/util.php
  Thu Aug  4 03:54:32 2005
@@ -1,6 +1,7 @@
-<?php 
/*
+<?php
+/*
  * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2004 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  *
  * Licensed under the terms of the GNU Lesser General Public License:
  *             http://www.opensource.org/licenses/lgpl-license.php
@@ -10,9 +11,6 @@
  *
  * File Name: util.php
  *     This is the File Manager Connector for ASP.
- *
- * Version:  2.0 RC3
- * Modified: 2004-12-10 17:46:39
  *
  * File Authors:
  *             Frederico Caldeira Knabben (address@hidden)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]