本文整理汇总了PHP中IsAllowedCommand函数的典型用法代码示例。如果您正苦于以下问题:PHP IsAllowedCommand函数的具体用法?PHP IsAllowedCommand怎么用?PHP IsAllowedCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsAllowedCommand函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoResponse
function DoResponse()
{
global $Config;
if (!isset($_GET)) {
global $_GET;
}
if (!isset($_GET['Command']) || !isset($_GET['Type']) || !isset($_GET['CurrentFolder'])) {
return;
}
// Get the main request informaiton.
$sCommand = $_GET['Command'];
$sResourceType = $_GET['Type'];
$sCurrentFolder = GetCurrentFolder();
// Check if it is an allowed command
if (!IsAllowedCommand($sCommand)) {
SendError(1, 'Команда "' . $sCommand . '" недоступна');
}
// Check if it is an allowed type.
if (!IsAllowedType($sResourceType)) {
SendError(1, 'Неверный тип');
}
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ($sCommand == 'FileUpload') {
FileUpload($sResourceType, $sCurrentFolder, $sCommand);
return;
}
CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder);
// Execute the required command.
switch ($sCommand) {
case 'GetFolders':
GetFolders($sResourceType, $sCurrentFolder);
break;
case 'GetFoldersAndFiles':
GetFoldersAndFiles($sResourceType, $sCurrentFolder);
break;
case 'CreateFolder':
CreateFolder($sResourceType, $sCurrentFolder);
break;
case 'FileDelete':
if ($Config['Delete']) {
FileDelete($sResourceType, $sCurrentFolder, $sCommand);
}
break;
case 'FolderDelete':
if ($Config['Delete']) {
FolderDelete($sResourceType, $sCurrentFolder, $sCommand);
}
break;
}
CreateXmlFooter();
exit;
}
示例2: DoResponse
function DoResponse()
{
if (!isset($_GET)) {
global $_GET;
}
if (!isset($_GET['Command']) || !isset($_GET['Type']) || !isset($_GET['CurrentFolder'])) {
return;
}
// Get the main request informaiton.
$sCommand = urlencode($_GET['Command']);
$sResourceType = urlencode($_GET['Type']);
$sCurrentFolder = GetCurrentFolder();
// Check if it is an allowed command
if (!IsAllowedCommand($sCommand)) {
SendError(1, 'FileBrowserError_Command' . ';;' . $sCommand);
}
// Check if it is an allowed type.
if (!IsAllowedType($sResourceType)) {
SendError(1, 'FileBrowserError_Type' . ';;' . $sResourceType);
}
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ($sCommand == 'FileUpload') {
FileUpload($sResourceType, $sCurrentFolder, $sCommand);
return;
}
if ($sCommand == 'GetDwfckNs') {
GetDwfckNs();
return;
}
CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder);
// Execute the required command.
switch ($sCommand) {
case 'GetFolders':
GetFolders($sResourceType, $sCurrentFolder);
break;
case 'GetFoldersAndFiles':
GetFoldersAndFiles($sResourceType, $sCurrentFolder);
break;
case 'CreateFolder':
CreateFolder($sResourceType, $sCurrentFolder);
break;
case 'UnlinkFile':
UnlinkFile($sResourceType, $sCurrentFolder, $sCommand, $_GET['file']);
break;
}
CreateXmlFooter();
exit;
}
示例3: DoResponse
function DoResponse()
{
if (!isset($_GET)) {
global $_GET;
}
if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) )
return ;
// Get the main request informaiton.
$sCommand = $_GET['Command'] ;
$sResourceType = $_GET['Type'] ;
$sCurrentFolder = GetCurrentFolder() ;
// Check if it is an allowed command
if ( ! IsAllowedCommand( $sCommand ) )
SendError( 1, 'The "' . $sCommand . '" command isn\'t allowed' ) ;
// Check if it is an allowed type.
if ( !IsAllowedType( $sResourceType ) )
SendError( 1, 'Invalid type specified' ) ;
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ( $sCommand == 'FileUpload' )
{
FileUpload( $sResourceType, $sCurrentFolder, $sCommand ) ;
return ;
}
CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ;
// Execute the required command.
switch ( $sCommand )
{
case 'GetFolders' :
GetFolders( $sResourceType, $sCurrentFolder ) ;
break ;
case 'GetFoldersAndFiles' :
GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ;
break ;
case 'CreateFolder' :
CreateFolder( $sResourceType, $sCurrentFolder ) ;
break ;
}
CreateXmlFooter() ;
exit ;
}
示例4: DoResponse
function DoResponse()
{
if (!isset($_GET)) {
global $_GET;
}
if (!isset($_GET['Command']) || !isset($_GET['Type']) || !isset($_GET['CurrentFolder'])) {
return;
}
//require_once(GetRootPath() . '\\conlive_8_12\\site\\config\\project.php');
//$con = new Project();
$f = fopen("cok2.txt", "w");
fprintf($f, $_SESSION['em']);
// Get the main request informaiton.
$sCommand = $_GET['Command'];
$sResourceType = $_GET['Type'];
$sCurrentFolder = GetCurrentFolder();
// Check if it is an allowed command
if (!IsAllowedCommand($sCommand)) {
SendError(1, 'The "' . $sCommand . '" command isn\'t allowed');
}
// Check if it is an allowed type.
if (!IsAllowedType($sResourceType)) {
SendError(1, 'Invalid type specified');
}
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ($sCommand == 'FileUpload') {
FileUpload($sResourceType, $sCurrentFolder, $sCommand);
return;
}
CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder);
// Execute the required command.
switch ($sCommand) {
case 'GetFolders':
GetFolders($sResourceType, $sCurrentFolder);
break;
case 'GetFoldersAndFiles':
GetFoldersAndFiles($sResourceType, $sCurrentFolder);
break;
case 'CreateFolder':
CreateFolder($sResourceType, $sCurrentFolder);
break;
}
CreateXmlFooter();
exit;
}
示例5: DoResponse
function DoResponse()
{
if (!isset($_GET)) {
global $_GET;
}
if (!isset($_GET['Command']) || !isset($_GET['Type']) || !isset($_GET['CurrentFolder'])) {
return;
}
$sCommand = $_GET['Command'];
$sResourceType = $_GET['Type'];
$sCurrentFolder = GetCurrentFolder();
if (!IsAllowedCommand($sCommand)) {
SendError(1, 'The "' . $sCommand . '" command isn\'t allowed');
}
if (!IsAllowedType($sResourceType)) {
SendError(1, 'Invalid type specified');
}
if ($sCommand == 'FileUpload') {
FileUpload($sResourceType, $sCurrentFolder, $sCommand);
return;
}
CreateXmlHeader($sCommand, $sResourceType, $sCurrentFolder);
switch ($sCommand) {
case 'GetFolders':
GetFolders($sResourceType, $sCurrentFolder);
break;
case 'GetFoldersAndFiles':
GetFoldersAndFiles($sResourceType, $sCurrentFolder);
break;
case 'CreateFolder':
CreateFolder($sResourceType, $sCurrentFolder);
break;
}
CreateXmlFooter();
exit;
}
示例6: SendError
*
* == END LICENSE ==
*
* This is the "File Uploader" for PHP.
*/
require './config.php';
require './util.php';
require './io.php';
require './commands.php';
require './phpcompat.php';
function SendError($number, $text)
{
SendUploadResults($number, '', '', $text);
}
// Check if this uploader has been enabled.
if (!$Config['Enabled']) {
SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file');
}
$sCommand = 'QuickUpload';
// The file type (from the QueryString, by default 'File').
$sType = isset($_GET['Type']) ? $_GET['Type'] : 'File';
$sCurrentFolder = GetCurrentFolder();
// Is enabled the upload?
if (!IsAllowedCommand($sCommand)) {
SendUploadResults('1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed');
}
// Check if it is an allowed type.
if (!IsAllowedType($sType)) {
SendUploadResults(1, '', '', 'Invalid type specified');
}
FileUpload($sType, $sCurrentFolder, $sCommand);