Ejemplo n.º 1
0
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;
        case 'DelFile':
            DelFile($_GET['FileName']);
            break;
    }
    CreateXmlFooter();
    exit;
}
Ejemplo n.º 2
0
         empty($pattern) && alert("查找项不能为空~!");
         if ($field == "body") {
             $iCMS->db->query("UPDATE `#iCMS@__articledata` SET `body` = REPLACE(`body`, '{$pattern}', '{$replacement}') {$where}");
         } else {
             if ($field == "tkd") {
                 $iCMS->db->query("UPDATE `#iCMS@__article` SET `title` = REPLACE(`title`, '{$pattern}', '{$replacement}'),\r\n\t\t    \t`keywords` = REPLACE(`keywords`, '{$pattern}', '{$replacement}'),\r\n\t\t    \t`description` = REPLACE(`description`, '{$pattern}', '{$replacement}'){$where}");
             } else {
                 $iCMS->db->query("UPDATE `#iCMS@__article` SET `{$field}` = REPLACE(`{$field}`, '{$pattern}', '{$replacement}'){$where}");
             }
         }
         redirect($iCMS->db->rows_affected . "条记录被替换<br />操作完成!!", __SELF__ . "?do=database&operation=replace");
     }
     if (isset($_POST['delete'])) {
         foreach ($_POST['delete'] as $key => $value) {
             if (eregi("\\.sql\$", $value)) {
                 DelFile(iPATH . 'admin/data/' . $value);
             }
         }
         redirect("备份文件已删除!!", __SELF__ . "?do=database&operation=recover");
     }
     break;
 case 'bakin':
     $step = $_GET['step'];
     $count = $_GET['count'];
     $pre = $_GET['pre'];
     if (!$count) {
         $count = 0;
         $handle = opendir(iPATH . 'admin/data');
         while ($file = readdir($handle)) {
             if (eregi("^{$pre}", $file) && eregi("\\.sql\$", $file)) {
                 $count++;
Ejemplo n.º 3
0
        GetLangs();
        break;
    case 21:
        InsertDialect($param);
        break;
    case 22:
        DelDialect($param);
        break;
    case 23:
        UpdateDialect($param);
        break;
    case 24:
        GetDialects($param->lang);
        break;
    case 25:
        DelFile($param);
        break;
}
function DelFile($pp)
{
    $destpath = getcwd() . "\\..\\res\\" . $pp->fpath;
    if (file_exists($destpath)) {
        unlink($destpath);
    }
    $rr = array();
    $rr[0] = array("result" => "تم الحذف بنجاح");
    echo json_encode($rr);
}
///////////////////////////////////////////////////////////////////////
function GetCountries()
{
Ejemplo n.º 4
0
$lur = is_login();
$logininid = $lur['userid'];
$loginin = $lur['username'];
$loginrnd = $lur['rnd'];
$loginlevel = $lur['groupid'];
$loginadminstyleid = $lur['adminstyleid'];
hCheckEcmsRHash();
$incftp = 0;
if ($public_r['phpmode']) {
    include "../class/ftp.php";
    $incftp = 1;
}
require "../class/filefun.php";
if ($enews == "DelFile") {
    $fileid = $_GET['fileid'];
    DelFile($fileid, $logininid, $loginin);
} elseif ($enews == "DelFile_all" || $enews == "TDelFile_all") {
    $fileid = $_POST['fileid'];
    DelFile_all($fileid, $logininid, $loginin);
} elseif ($enews == "DelFreeFile") {
    DelFreeFile($logininid, $loginin);
} elseif ($enews == "DelPathFile") {
    $filename = $_POST['filename'];
    DelPathFile($filename, $logininid, $loginin);
} elseif ($enews == "DoMarkSmallPic") {
    DoMarkSmallPic($_POST, $logininid, $loginin);
} elseif ($enews == "TranMoreFile") {
    $file = $_FILES['file']['tmp_name'];
    $file_name = $_FILES['file']['name'];
    $file_type = $_FILES['file']['type'];
    $file_size = $_FILES['file']['size'];
Ejemplo n.º 5
0
function MFU_DoMergeFile_Normal($s_File)
{
    $s_File1 = $s_File . ".tmp1";
    $s_File2 = $s_File . ".tmp2";
    $f1 = fopen($s_File1, "ab");
    $f2 = fopen($s_File2, "rb");
    fwrite($f1, fread($f2, filesize($s_File2)));
    fclose($f2);
    fclose($f1);
    //del tmp2
    DelFile($s_File2);
}