コード例 #1
0
ファイル: dzzcp.php プロジェクト: druphliu/dzzoffice
            echo json_encode_gbk($data);
            exit;
            showmessage('do_success', $refer . '', $data, array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1));
        }
    } elseif ($data = io_dzz::linktovideo($link, $pfid)) {
        //试图作为视频处理
        //作为网址处理
        if (!perm_check::checkperm_Container($pfid, 'video')) {
            $data['error'] = lang('message', 'target_not_accept_link');
            echo json_encode_gbk($data);
            exit;
        }
        echo json_encode_gbk($data);
        exit;
    } else {
        if (!perm_check::checkperm_Container($pfid, 'link')) {
            $data['error'] = lang('message', 'target_not_accept_link');
            echo json_encode_gbk($data);
            exit;
        }
        if ($data = io_dzz::linktourl($link, $pfid)) {
            echo json_encode_gbk($data);
            exit;
            showmessage('do_success', $refer . '', $data, array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1));
        } else {
            $data['error'] = lang('message', 'network_error');
            echo json_encode_gbk($data);
            exit;
        }
    }
}
コード例 #2
0
ファイル: saveto.php プロジェクト: druphliu/dzzoffice
    if (!$link) {
        topshowmessage('参数错误!');
    }
    //检查网址合法性
    if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{5,300}\$/i", $link)) {
        $parseurl = parse_url($link);
        if (!$parseurl['host']) {
            $link = $_G['siteurl'] . $link;
        } else {
            $link = 'http://' . preg_replace("/^(http|ftp|https|mms)\\:\\/\\//i", '', $link);
        }
    }
    if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{4,300}\$/i", $link)) {
        topshowmessage('网址格式错误!');
    }
    $icoarr = io_dzz::linktourl($link, $pfid);
} elseif ($_GET['type'] == 'dzzdoc') {
    $aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
    $attach = C::t('attachment')->fetch($aid);
    if (!$attach) {
        topshowmessage(lang('message', 'attachment_nonexistence'));
    }
    if (!empty($_GET['filename'])) {
        $attach['filename'] = trim($_GET['filename']);
    }
    $icoarr = IO::upload_by_content(IO::getFileContent('attach::' . $attach['aid']), $pfid, trim($attach['filename'], '.dzzdoc') . '.dzzdoc');
} else {
    $aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
    $attach = C::t('attachment')->fetch($aid);
    if (!$attach) {
        topshowmessage(lang('message', 'attachment_nonexistence'));