📄 connector.php
字号:
<?php
function doresponse( )
{
if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) )
{
return;
}
$sCommand = $_GET['Command'];
$sResourceType = $_GET['Type'];
$sCurrentFolder = $_GET['CurrentFolder'];
if ( !in_array( $sResourceType, array( "File", "Image", "Flash", "Media" ) ) )
{
return;
}
if ( !ereg( "/\$", $sCurrentFolder ) )
{
$sCurrentFolder .= "/";
}
if ( strpos( $sCurrentFolder, "/" ) !== 0 )
{
$sCurrentFolder = "/".$sCurrentFolder;
}
if ( strpos( $sCurrentFolder, ".." ) )
{
senderror( 102, "" );
}
if ( $sCommand == "FileUpload" )
{
fileupload( $sResourceType, $sCurrentFolder );
}
else
{
createxmlheader( $sCommand, $sResourceType, $sCurrentFolder );
switch ( $sCommand )
{
case "GetFolders" :
getfolders( $sResourceType, $sCurrentFolder );
break;
case "GetFoldersAndFiles" :
getfoldersandfiles( $sResourceType, $sCurrentFolder );
break;
case "CreateFolder" :
createfolder( $sResourceType, $sCurrentFolder );
}
createxmlfooter( );
exit( );
}
}
ob_start( );
include( "config.php" );
include( "util.php" );
include( "io.php" );
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" );
}
$GLOBALS['UserFilesPath'] = "";
if ( isset( $Config['UserFilesPath'] ) )
{
$GLOBALS['UserFilesPath'] = $Config['UserFilesPath'];
}
else if ( isset( $_GET['ServerPath'] ) )
{
$GLOBALS['UserFilesPath'] = $_GET['ServerPath'];
}
else
{
$GLOBALS['UserFilesPath'] = "/userfiles/";
}
if ( !ereg( "/\$", $GLOBALS['UserFilesPath'] ) )
{
$UserFilesPath .= "/";
}
if ( 0 < strlen( $Config['UserFilesAbsolutePath'] ) )
{
$GLOBALS['UserFilesDirectory'] = $Config['UserFilesAbsolutePath'];
if ( !ereg( "/\$", $GLOBALS['UserFilesDirectory'] ) )
{
$UserFilesDirectory .= "/";
}
}
else
{
$GLOBALS['UserFilesDirectory'] = getrootpath( ).$UserFilesPath;
}
doresponse( );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -