From: Thyamad c. <th...@us...> - 2005-09-29 19:50:05
|
Update of /cvsroot/thyapi/thyapi/thywidgets/external/fckeditor/editor/filemanager/browser/mcpuk/connectors/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv563/thywidgets/external/fckeditor/editor/filemanager/browser/mcpuk/connectors/php Added Files: config.php connector.php test.html.suspended testme.php.suspended Log Message: Commiting file additions and modification from SVN revision 2028 to 2029... Changes made by frank on 2005-09-29 21:42:57 +0200 (Thu, 29 Sep 2005) corresponding to SVN revision 2029 with message: updating fckeditor in dynapi --- NEW FILE: connector.php --- <?php /* * FCKeditor - The text editor for internet * 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 * * For further information visit: * http://www.fckeditor.net/ * * File Name: connector.php * Main connector file, implements the State Pattern to * redirect requests to the appropriate class based on * the command name passed. * * File Authors: * Grant French (gr...@mc...) */ //Errors in the config.php could still cause problems. global $fckphp_config; require_once "config.php"; error_reporting(E_ALL); function errorHandler ($errno, $errstr, $errfile, $errline, $errcontext) { $reported=false; if (strpos($errstr,"var: Deprecated.")===false) { global $fckphp_config; if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Errors']===true) { $oldData=implode("",file($fckphp_config['DebugOutput'])); if ($fh=fopen($fckphp_config['DebugOutput'],"w")) { fwrite($fh,"\n".date("d/m/Y H:i:s")."\n"); fwrite($fh,"PHP ERROR::: Error Number: $errno Error Message: $errstr Error File: $errfile Error Line: $errline\n"); if ($fckphp_config['Debug_Trace']) fwrite($fh," Error Context: ".print_r($errcontext,true)."\n"); if ($fckphp_config['Debug_GET']) fwrite($fh,"\n\$_GET::\n".print_r($_GET,true)."\n"); if ($fckphp_config['Debug_POST']) fwrite($fh,"\n\$_POST::\n".print_r($_POST,true)."\n"); if ($fckphp_config['Debug_SERVER']) fwrite($fh,"\n\$_SERVER::\n".print_r($_SERVER,true)."\n"); if ($fckphp_config['Debug_SESSIONS']) fwrite($fh,"\n\$_SESSIONS::\n".print_r($_SESSION,true)."\n"); fwrite($fh,"\n-------------------------------------------------------\n\n\n"); fwrite($fh,$oldData); $oldData=""; fclose($fh); $reported=true; } } if (!$reported) { //display error instead. echo("PHP ERROR::: <br /> Error Number: $errno <br /> Error Message: $errstr <br /> Error File: $errfile <br /> Error Line: $errline <br />"); if ($fckphp_config['Debug_Trace']) echo "Error Context: ".print_r($errcontext,true)."\n"; if ($fckphp_config['Debug_GET']) echo "\$_GET::\n".print_r($_GET,true)."<br />\n"; if ($fckphp_config['Debug_POST']) echo "\$_POST::\n".print_r($_POST,true)."<br />\n"; if ($fckphp_config['Debug_SERVER']) echo "\$_SERVER::\n".print_r($_SERVER,true)."<br />\n"; if ($fckphp_config['Debug_SESSIONS']) echo "\$_SESSIONS::\n".print_r($_SESSION,true)."<br />\n"; echo "<br />\n<br />\n"; } } } set_error_handler('errorHandler'); if (!isset($_SERVER['DOCUMENT_ROOT'])) $_SERVER["DOCUMENT_ROOT"] = $fckphp_config['basedir']; if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) ob_start(); outputHeaders(); //These are the commands we may expect $valid_commands=$fckphp_config['Commands']; $valid_resource_types=$fckphp_config['ResourceTypes']; //Get the passed data $command=( ((isset($_GET['Command']))&&($_GET['Command']!=""))? $_GET['Command']: "" ); $type=( ((isset($_GET['Type']))&&($_GET['Type']!=""))? $_GET['Type']: "File" ); $cwd=str_replace("..","", ( ((isset($_GET['CurrentFolder']))&&($_GET['CurrentFolder']!=""))? $_GET['CurrentFolder']: "/" ) ); $cwd=str_replace("..","",$cwd); $extra=( ((isset($_GET['ExtraParams']))&&($_GET['ExtraParams']!=""))? $_GET['ExtraParams']: "" ); if (in_array($command,$valid_commands)) { if ($fckphp_config['auth']['Req']) { require_once "./Auth/".$fckphp_config['auth']['HandlerClass'].".php"; $auth=new Auth(); $fckphp_config=$auth->authenticate($extra,$fckphp_config); if ($fckphp_config['authSuccess']!==true) { header ("content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"; ?> <Connector command="authentication_failed" resourceType="authentication_failed"> <CurrentFolder path="authentication_failed" url="authentication_failed" /> <Error number="-1" /> </Connector><?php if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) recordOutput(); exit(0); } } //bit of validation if (!in_array($type,$valid_resource_types)) { echo "Invalid resource type."; if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) recordOutput(); exit(0); } require_once "Commands/$command.php"; $action=new $command($fckphp_config,$type,$cwd); $action->run(); if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) recordOutput(); } else { //No reason for me to be here. echo "Invalid command."; echo str_replace("\n","<br />",print_r($_GET,true)); if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) recordOutput(); exit(0); } function recordOutput() { global $fckphp_config; if ($fckphp_config['Debug']===true && $fckphp_config['Debug_Output']) { $contents=ob_get_contents(); if (strlen($contents)>0) { $oldData=implode("",file($fckphp_config['DebugOutput'])); if ($fh=fopen($fckphp_config['DebugOutput'],"w")) { fwrite($fh,"\n".date("d/m/Y H:i:s")."\n"); if ($fckphp_config['Debug_GET']) fwrite($fh,"\n\$_GET::\n".print_r($_GET,true)."\n"); if ($fckphp_config['Debug_POST']) fwrite($fh,"\n\$_POST::\n".print_r($_POST,true)."\n"); if ($fckphp_config['Debug_SERVER']) fwrite($fh,"\n\$_SERVER::\n".print_r($_SERVER,true)."\n"); if ($fckphp_config['Debug_SESSIONS']) fwrite($fh,"\n\$_SESSIONS::\n".print_r($_SESSION,true)."\n"); fwrite($fh,$contents); fwrite($fh,"\n-------------------------------------------------------\n\n\n"); fwrite($fh,$oldData); $oldData=""; fclose($fh); } } ob_flush(); } } function outputHeaders() { //Anti browser caching headers //Borrowed from fatboy's implementation (fa...@co...) // ensure file is never cached // 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"); } ?> --- NEW FILE: config.php --- <?php /* * FCKeditor - The text editor for internet * 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 * * For further information visit: * http://www.fckeditor.net/ * * File Name: config.php * Configuration file * * File Authors: * Grant French (gr...@mc...) */ session_start(); /*------------------------------------------------------------------------------*/ /* HTTP over SSL Detection (shouldnt require changing) */ /*------------------------------------------------------------------------------*/ $fckphp_config['prot']="http"; $fckphp_config['prot'].=((isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']=='on')?"s":""); $fckphp_config['prot'].="://"; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* The physical path to the document root, Set manually if not using apache */ /*------------------------------------------------------------------------------*/ //$fckphp_config['basedir']=$_SERVER['DOCUMENT_ROOT']; $fckphp_config['basedir'] = 'D:\Work\FCKeditor\www\FCKeditor.V2\editor\filemanager\browser\mcpuk' ; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Prefix added to image path before sending back to editor */ /*------------------------------------------------------------------------------*/ $fckphp_config['urlprefix']=$fckphp_config['prot'].$_SERVER['SERVER_NAME']; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Path to user files relative to the document root (no trailing slash) */ /*------------------------------------------------------------------------------*/ $fckphp_config['UserFilesPath'] = "/UserFiles" ; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Progressbar handler (script that monitors upload progress) (''=none) /*------------------------------------------------------------------------------*/ // $fckphp_config['uploadProgressHandler']=''; //No upload progress handler $fckphp_config['uploadProgressHandler']=$fckphp_config['prot'].$_SERVER['SERVER_NAME']."/cgi-bin/progress.cgi"; //Perl upload progress handler /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Authentication (auth) :- */ /* - Req :: Boolean, whether authentication is required */ /* - HandlerClass :: Name of class to handle authentication in connector */ /*------------------------------------------------------------------------------*/ $fckphp_config['auth']['Req']=false; $fckphp_config['auth']['HandlerClass']='Default'; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Settings for authentication handler :- */ /* - SharedKey :: Shared encryption key (as set in test.php in example) */ /*------------------------------------------------------------------------------*/ $fckphp_config['auth']['Handler']['SharedKey']="->Shared_K3y-F0R*5enD1NG^auth3nt1caT10n'Info/To\FILE,Brow5er--!"; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Per resource area settings:- */ /* - AllowedExtensions :: Array, allowed file extensions (in lowercase) */ /* - AllowedMIME :: Array, allowed mime types (in lowercase) */ /* - MaxSize :: Number, Maximum size of file uploads in KBytes */ /* - DiskQuota :: Number, Maximum size allowed for the resource area */ /* - HideFolders :: Array, RegExp, matching folder names will be hidden */ /* - HideFiles :: Array, RegExp, matching file names will be hidden */ /* - AllowImageEditing :: Boolean, whether images in this area may be edited */ /*------------------------------------------------------------------------------*/ //First area options are commented //File Area $fckphp_config['ResourceAreas']['File'] =array( //Files(identified by extension) that may be uploaded to this area 'AllowedExtensions' => array("zip","doc","xls","pdf","rtf","csv","jpg","gif","jpeg","png","avi","mpg","mpeg","swf","fla"), //Not implemented yet 'AllowedMIME' => array(), //Set the maximum single upload to this area to 2MB (2048Kb) 'MaxSize' => 2048, //Set disk quota for this resource area to 20MB 'DiskQuota' => 20, //By Default hide all folders starting with a . (Unix standard) 'HideFolders' => array("^\."), //By Default hide all files starting with a . (Unix standard) 'HideFiles' => array("^\."), //Do not allow images to be edited in this resource area 'AllowImageEditing' => false ); //Image area $fckphp_config['ResourceAreas']['Image'] =array( 'AllowedExtensions' => array("jpg","gif","jpeg","png","tiff","tif",), 'AllowedMIME' => array(), 'MaxSize' => 1024, 'DiskQuota' => 5, 'HideFolders' => array("^\."), 'HideFiles' => array("^\."), 'AllowImageEditing' => false //Not yet complete, but you can take a look and see ); //Flash area $fckphp_config['ResourceAreas']['Flash'] =array( 'AllowedExtensions' => array("swf","fla"), 'AllowedMIME' => array(), 'MaxSize' => 1024, 'DiskQuota' => 5, 'HideFolders' => array("^\."), 'HideFiles' => array("^\."), 'AllowImageEditing' => false ); //Media area $fckphp_config['ResourceAreas']['Media'] =array( 'AllowedExtensions' => array("swf","fla","jpg","gif","jpeg","png","avi","mpg","mpeg"), 'AllowedMIME' => array(), 'MaxSize' => 5120, 'DiskQuota' => 20, 'HideFolders' => array("^\."), 'HideFiles' => array("^\."), 'AllowImageEditing' => false ); /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Global Disk Quota - Max size of all resource areas */ /*------------------------------------------------------------------------------*/ $fckphp_config['DiskQuota']['Global']=50; //In MBytes (default: 50mb) /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Directory and File Naming :- */ /* -MaxDirNameLength :: Maximum allowed length of a directory name */ /* -DirNameAllowedChars :: Array of characters allowed in a directory name */ /* -FileNameAllowedChars :: Array of characters allowed in a file name */ /*------------------------------------------------------------------------------*/ $fckphp_config['MaxDirNameLength']=25; $fckphp_config['DirNameAllowedChars']=array(); //Allow numbers for($i=48;$i<58;$i++) array_push($fckphp_config['DirNameAllowedChars'],chr($i)); //Allow lowercase letters for($i=97;$i<123;$i++) array_push($fckphp_config['DirNameAllowedChars'],chr($i)); //Allow uppercase letters for($i=65;$i<91;$i++) array_push($fckphp_config['DirNameAllowedChars'],chr($i)); //Allow space,dash,underscore,dot array_push($fckphp_config['DirNameAllowedChars']," ","-","_","."); $fckphp_config['FileNameAllowedChars']=$fckphp_config['DirNameAllowedChars']; array_push($fckphp_config['FileNameAllowedChars'],')','(','[',']','~'); /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Debugging :- */ /* - Debug :: Boolean, if set to true a copy of the connector output is */ /* sent to a file as well as to the client. */ /* - DebugOutput :: File to send debug output to (absolute path) */ /*------------------------------------------------------------------------------*/ $fckphp_config['Debug']=false; $fckphp_config['DebugOutput']="/var/www/fckeditor/htdocs/FCKeditor/data/fck_conn_dbg"; #Log PHP errors $fckphp_config['Debug_Errors']=false; $fckphp_config['Debug_Trace']=false; #Log Connector output $fckphp_config['Debug_Output']=false; #With each logged event display contents of /* $_GET */ $fckphp_config['Debug_GET']=false; /* $_POST */ $fckphp_config['Debug_POST']=false; /* $_SERVER */ $fckphp_config['Debug_SERVER']=false; /* $_SESSIONS */ $fckphp_config['Debug_SESSIONS']=false; /*==============================================================================*/ /*------------------------------------------------------------------------------*/ /* Internals :- */ /* ResourceTypes :: Array of valid resource areas */ /* Commands :: Array of valid commands accepted by the connector */ /*------------------------------------------------------------------------------*/ $fckphp_config['ResourceTypes'] = array('File','Image','Flash','Media'); $fckphp_config['Commands'] = array( "CreateFolder", "GetFolders", "GetFoldersAndFiles", "FileUpload", "Thumbnail", "DeleteFile", "DeleteFolder", "GetUploadProgress", "RenameFile", "RenameFolder" ); /*==============================================================================*/ ?> --- NEW FILE: testme.php.suspended --- <html> <head> <title>Test PHP Connector</title> </head> <body> <?php error_reporting(E_ALL); include "config.php"; $resources=$fckphp_config['ResourceTypes']; $dr=$fckphp_config['basedir']; $actual_userfolder=str_replace("//","/",$dr."/".$fckphp_config['UserFilesPath']."/"); //Display base directory set in the$fckphp_config echo "Base Dir is set to: $dr<br />\n"; //Display the path to this script echo "PHP_SELF: ".$_SERVER['PHP_SELF']."<br />\n"; //Seperator echo "\n<br /><hr /><br />\n"; //Check if PHP has MIME-Magic Support echo "Checking for mime magic support: ".((function_exists("mime_content_type"))?"Yes":"No - you won't get icons by mime type")."<br />"; //Check if PHP has GD Support echo "Checking for GD support: ".((function_exists("imagecreate"))?"Yes":"No - you won't get thumbnails for images")."<br />"; echo " JPEG Support: ".((function_exists("imagecreatefromjpeg"))?"Yes":"No - you won't get thumbnails for jpeg images")."<br />"; echo " PNG Support: ".((function_exists("imagecreatefrompng"))?"Yes":"No - you won't get thumbnails for png images")."<br />"; echo " GIF Support: ".((function_exists("imagecreatefromgif"))?"Yes":"No - you won't get thumbnails for gif images")."<br />"; echo " Image Write Support: ".((function_exists("imagegif") || function_exists("imagepng") || function_exists("imagejpeg"))?"Yes":"No - you won't get thumbnails for any images, as i cant write GIFs, PNGs or JPEGs")."<br />"; //Seperator echo "\n<br /><hr /><br />\n"; //Check if the user files folder set in the$fckphp_config exists echo "Checking if user files folder exists ($actual_userfolder): "; if (is_dir($actual_userfolder)) { echo "[ Passed ]<br />\n"; } else { echo "[ Failed ] <br />Task: Create the user files folder in the webroot and point the$fckphp_config.php file to it.<br />\n"; echo "Skipping all other tests, fix this one first."; exit(0); } //Seperator echo "\n<br /><hr /><br />\n"; //Check if the File,Image,Flash,Media folders exist in the user files folder and are writeable echo "Checking for resource type folders under user file folder: <br />\n"; foreach ($resources as $value) { //Does the folder exist $passed=false; echo " $value exists (".($actual_userfolder.$value).": "; if (is_dir(($actual_userfolder.$value))) { echo "[ Passed ]<br />\n"; $passed=true; } else { echo "[ Failed ]<br /> Task: chmod this folder to make it writeable to the php processes user.<br />\n"; } //Is the folder writeable by PHP echo " $value writeable: "; if ($passed) { if (is_writeable(($actual_userfolder.$value))) { echo "[ Passed ]<br />\n"; } else { echo "[ Failed ]<br /> Task: chmod this folder to make it writeable to the php processes user.<br />\n"; } } else { echo "[ Skipped ]<br />\n"; } echo "<br />\n"; } //Check if PHP is$fckphp_configured to use open_basedir echo "Checking if open_basedir restriction in place: (".((($bd=ini_get("open_basedir"))==null)?"Not Set":$bd." - This may cause you some troubles.").")<br />"; //Try to open the user files folder echo "Trying an opendir on the user files folder: ".((opendir($actual_userfolder))?"[ Passed ]":"[ Failed ]")."<br />"; //Seperator echo "\n<br /><hr /><br />\n"; //Compose the url to the connector $uri="http".(((isset($_SERVER['HTTPS']))&&(strtolower($_SERVER['HTTPS'])!='off'))?"s":"")."://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the GetFolders Command echo "Requesting connector.php?Command=GetFolders&Type=Image&CurrentFolder=/ :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=GetFolders&Type=Image&CurrentFolder=/")); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\"GetFolders\" resourceType=\"Image\"> <CurrentFolder path=\"/\" url=\"/data/resources/Image/\" /> <Folders> </Folders> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test GetFoldersAndFiles Command echo "Requesting connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/ :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/")); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\"GetFoldersAndFiles\" resourceType=\"Image\"> <CurrentFolder path=\"/\" url=\"/data/resources/Image/\" /> <Folders> </Folders> <Files> </Files> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the CreateFolder command echo "Requesting connector.php?Command=CreateFolder&Type=Image&CurrentFolder=/&NewFolderName=TestFolder99 :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=CreateFolder&Type=Image&CurrentFolder=/&NewFolderName=TestFolder99")); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\CreateFolder\" resourceType=\"Image\"> <CurrentFolder path=\"/\" url=\"/data/resources/Image/\" /> <Error number=\"0\" /> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the RenameFolder Command echo "Requesting connector.php?Command=RenameFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder99&NewName=TestFolder90 :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=RenameFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder99&NewName=TestFolder90")); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\"RenameFolder\" resourceType=\"Image\"> <CurrentFolder path=\"/\" url=\"/data/resources/Image/\" /> <Error number=\"0\" /> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the DeleteFolder Command echo "Requesting connector.php?Command=DeleteFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder90 :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=DeleteFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder90")); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\"DeleteFolder\" resourceType=\"Image\"> <CurrentFolder path=\"/\" url=\"/data/resources/Image/\" /> <Error number=\"0\" /> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the Progress.cgi Command echo "Requesting ".$fckphp_config['uploadProgressHandler']."?iTotal=0&iRead=0&iStatus=1&sessionid=92823&dtnow=".time()."&dtstart=".time()." :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($fckphp_config['uploadProgressHandler']."?iTotal=0&iRead=0&iStatus=1&sessionid=92823&dtnow=".time()."&dtstart=".time())); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <UploadProgress sessionID=\"92823\"> <RefreshURL><![CDATA[".$fckphp_config['uploadProgressHandler']."?iTotal=0&iRead=0&iStatus=1&sessionid=92823&dtnow=1098477167&dtstart=1098477166]]></RefreshURL> <TotalBytes>0</TotalBytes> <ReadBytes>0</ReadBytes> <Status>1</Status> <Speed>0</Speed> <TimeRemaining>00:00:00</TimeRemaining> <TimeElapsed>00:00:01</TimeElapsed> </UploadProgress>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- //Seperator echo "\n<br /><hr /><br />\n"; //-------------------------------------------------------------------------------------------------------------------------------------------------- //Test the GetUploadProgress Command echo "Requesting connector.php?Command=GetUploadProgress&Type=File&CurrentFolder=/Docs/&uploadID=19382&refreshURL=".$fckphp_config['uploadProgressHandler']."?uploadID=19382&read=30&total=100 :<br />\n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $test = implode("",file($uri."connector.php?Command=GetUploadProgress&Type=File&CurrentFolder=/Docs/&uploadID=19382&refreshURL=".$fckphp_config['uploadProgressHandler']."?uploadID=19382&read=30&total=100")); $test=str_replace("&","&",$test); $test=htmlentities($test); echo str_replace("\n","<br />",$test); echo "</div> Please do a sanity check on this, it should be something like: \n <div style=\"border-style:solid;border-width:1px;border-color:#000000\">\n"; $expect=" <?xml version=\"1.0\" encoding=\"utf-8\" ?> <Connector command=\"GetUploadProgress\" resourceType=\"File\"> <CurrentFolder path=\"/Docs/\" url=\"/data/resources/File/Docs/\" /> <Progress max=\"0\" value=\"0\" /> <RefreshURL url=\"".$fckphp_config['uploadProgressHandler']."?iTotal=&iRead=&iStatus=&sessionid=&dtnow=1098478692&dtstart=\" /> </Connector>"; $expect=htmlentities($expect); $expect=str_replace(array("\n","\r"),"<br />",$expect); echo "<b>EXAMPLE RESPONSE</b>".$expect; ?> </div> <br /><br /> <?php //-------------------------------------------------------------------------------------------------------------------------------------------------- ?> </body> </html> --- NEW FILE: test.html.suspended --- <html><head><title>File Upload Test</title></head> <body> <form enctype="multipart/form-data" method="post" action="/cgi-bin/upload.cgi?uploadID=58484&Connector=/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php&Command=FileUpload&Type=Image&CurrentFolder=/&ExtraParams=313131323934373331357c5e5345505e7c3139322e3136382e302e327c5e5345505e7c61646d696e7c5e5345505e7c3338316139376339633638303937393566343665313463613738383230626439"> <input type="file" name="NewFile" /> <input type="submit" value="Upload" /> </form> </body></html> |