\n";
//Display the path to this script
echo "PHP_SELF: ".$_SERVER['PHP_SELF']."
\n";
//Seperator
echo "\n
\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")."
";
//Check if PHP has GD Support
echo "Checking for GD support: ".((function_exists("imagecreate"))?"Yes":"No - you won't get thumbnails for images")."
";
echo " JPEG Support: ".((function_exists("imagecreatefromjpeg"))?"Yes":"No - you won't get thumbnails for jpeg images")."
";
echo " PNG Support: ".((function_exists("imagecreatefrompng"))?"Yes":"No - you won't get thumbnails for png images")."
";
echo " GIF Support: ".((function_exists("imagecreatefromgif"))?"Yes":"No - you won't get thumbnails for gif images")."
";
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")."
";
//Seperator
echo "\n
\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 ]
\n";
} else {
echo "[ Failed ]
Task: Create the user files folder in the webroot and point the$fckphp_config.php file to it.
\n";
echo "Skipping all other tests, fix this one first.";
exit(0);
}
//Seperator
echo "\n
\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:
\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 ]
\n";
$passed=true;
} else {
echo "[ Failed ]
Task: chmod this folder to make it writeable to the php processes user.
\n";
}
//Is the folder writeable by PHP
echo " $value writeable: ";
if ($passed) {
if (is_writeable(($actual_userfolder.$value))) {
echo "[ Passed ]
\n";
} else {
echo "[ Failed ]
Task: chmod this folder to make it writeable to the php processes user.
\n";
}
} else {
echo "[ Skipped ]
\n";
}
echo "
\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.").")
";
//Try to open the user files folder
echo "Trying an opendir on the user files folder: ".((opendir($actual_userfolder))?"[ Passed ]":"[ Failed ]")."
";
//Seperator
echo "\n
\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=/ :
\n
\n";
$test = implode("",file($uri."connector.php?Command=GetFolders&Type=Image&CurrentFolder=/"));
$test=htmlentities($test);
echo str_replace("\n","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\n";
//--------------------------------------------------------------------------------------------------------------------------------------------------
//Test GetFoldersAndFiles Command
echo "Requesting connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/ :
\n
\n";
$test = implode("",file($uri."connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/"));
$test=htmlentities($test);
echo str_replace("\n","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\n";
//--------------------------------------------------------------------------------------------------------------------------------------------------
//Test the CreateFolder command
echo "Requesting connector.php?Command=CreateFolder&Type=Image&CurrentFolder=/&NewFolderName=TestFolder99 :
\n
\n";
$test = implode("",file($uri."connector.php?Command=CreateFolder&Type=Image&CurrentFolder=/&NewFolderName=TestFolder99"));
$test=htmlentities($test);
echo str_replace("\n","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\n";
//--------------------------------------------------------------------------------------------------------------------------------------------------
//Test the RenameFolder Command
echo "Requesting connector.php?Command=RenameFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder99&NewName=TestFolder90 :
\n
\n";
$test = implode("",file($uri."connector.php?Command=RenameFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder99&NewName=TestFolder90"));
$test=htmlentities($test);
echo str_replace("\n","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\n";
//--------------------------------------------------------------------------------------------------------------------------------------------------
//Test the DeleteFolder Command
echo "Requesting connector.php?Command=DeleteFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder90 :
\n
\n";
$test = implode("",file($uri."connector.php?Command=DeleteFolder&Type=Image&CurrentFolder=/&FolderName=TestFolder90"));
$test=htmlentities($test);
echo str_replace("\n","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\n";
//--------------------------------------------------------------------------------------------------------------------------------------------------
//Test the Progress.cgi Command
echo "Requesting ".$fckphp_config['uploadProgressHandler']."?iTotal=0&iRead=0&iStatus=1&sessionid=92823&dtnow=".time()."&dtstart=".time()." :
\n
\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","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
0
0
1
0
00:00:00
00:00:01
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "EXAMPLE RESPONSE".$expect;
?>
\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 :
\n
\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","
",$test);
echo "
Please do a sanity check on this, it should be something like: \n
\n";
$expect="
";
$expect=htmlentities($expect);
$expect=str_replace(array("\n","\r"),"
",$expect);
echo "
EXAMPLE RESPONSE".$expect;
?>