当前位置: 首页>>代码示例>>PHP>>正文


PHP check_readable函数代码示例

本文整理汇总了PHP中check_readable函数的典型用法代码示例。如果您正苦于以下问题:PHP check_readable函数的具体用法?PHP check_readable怎么用?PHP check_readable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_readable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugin_rewritemap_action

function plugin_rewritemap_action()
{
    global $vars;
    if (empty($vars['page'])) {
        return;
    }
    if (exist_plugin('statichtml')) {
        $vars['page'] = PluginStatichtml::decode($vars['page']);
    }
    $page = plugin_rewritemap_get_pagename($vars['page']);
    if (is_page($page)) {
        check_readable($page, true, true);
        header_lastmod($page);
        $vars['page'] = $page;
        return array('msg' => '', 'body' => '');
    }
    $redirect = plugin_rewritemap_get_redirect($page);
    $nextpage = plugin_rewritemap_get_pagename($redirect);
    if (is_page($nextpage)) {
        header('HTTP/1.0 301 Moved Permanently');
        header('Location: ' . plugin_rewritemap_url($nextpage));
        exit;
    } else {
        header('HTTP/1.0 404 Not Found');
        exit('404 - Not Found');
    }
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:27,代码来源:rewritemap.inc.php

示例2: plugin_diff_action

function plugin_diff_action()
{
    global $vars, $script;
    global $layout_pages, $style_name;
    $editable = edit_auth($page, FALSE, FALSE);
    if (!$editable) {
        header("Location: {$script}");
        exit;
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_readable($page, true, true);
    //レイアウト部品の場合、スタイルを変更する
    $is_layout = FALSE;
    if (isset($layout_pages) && isset($layout_pages[$page])) {
        $style_name = '..';
        $is_layout = TRUE;
    }
    $action = isset($vars['action']) ? $vars['action'] : '';
    switch ($action) {
        case 'delete':
            $retval = plugin_diff_delete($page);
            break;
        default:
            $retval = plugin_diff_view($page);
            break;
    }
    return $retval;
}
开发者ID:big2men,项目名称:qhm,代码行数:28,代码来源:diff.inc.php

示例3: plugin_skeylist_convert

function plugin_skeylist_convert()
{
    global $vars;
    global $_skeylist_msg;
    global $referer;
    if (!$referer) {
        return '';
    }
    list($page, $max) = func_get_args();
    if (empty($page)) {
        $page = htmlspecialchars($vars['page'], ENT_QUOTES);
    }
    check_readable($page, false);
    $max = empty($max) ? 10 : htmlspecialchars($max, ENT_QUOTES);
    // $data = tb_get(tb_get_filename($page,'.ref'));
    $data = ref_get_data($page);
    if (count($data) == 0) {
        return '';
    }
    //  データ無し
    $data = skeylist_analysis($data);
    // 0:検索キー 1:参照カウンタ
    usort($data, create_function('$a,$b', 'return $b[1] - $a[1];'));
    $data = skeylist_print($data, $max);
    return '<div>' . $data . "</div>\n";
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:26,代码来源:skeylist.inc.php

示例4: plugin_read_action

function plugin_read_action()
{
    global $vars, $_title_invalidwn, $_msg_invalidiwn;
    $page = isset($vars['page']) ? $vars['page'] : '';
    if (is_page($page)) {
        // ページを表示
        check_readable($page, true, true);
        header_lastmod($page);
        return array('msg' => '', 'body' => '');
    } else {
        if (!PKWK_SAFE_MODE && is_interwiki($page)) {
            return do_plugin_action('interwiki');
            // InterWikiNameを処理
        } else {
            if (is_pagename($page)) {
                $vars['cmd'] = 'edit';
                return do_plugin_action('edit');
                // 存在しないので、編集フォームを表示
            } else {
                // 無効なページ名
                return array('msg' => $_title_invalidwn, 'body' => str_replace('$1', htmlsc($page), str_replace('$2', 'WikiName', $_msg_invalidiwn)));
            }
        }
    }
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:25,代码来源:read.inc.php

示例5: plugin_read_action

function plugin_read_action()
{
    global $vars, $_title_invalidwn, $_msg_invalidiwn;
    $page = isset($vars['page']) ? $vars['page'] : '';
    if (is_page($page)) {
        // ページを表示
        check_readable($page, true, true);
        header_lastmod($page);
        return array('msg' => '', 'body' => '');
        // } else if (! PKWK_SAFE_MODE && is_interwiki($page)) {
    } else {
        if (!auth::check_role('safemode') && is_interwiki($page)) {
            return do_plugin_action('interwiki');
            // InterWikiNameを処理
        } else {
            if (is_pagename($page)) {
                $realpages = get_autoaliases($page);
                if (count($realpages) == 1) {
                    $realpage = $realpages[0];
                    if (is_page($realpage)) {
                        header('HTTP/1.0 301 Moved Permanently');
                        header('Location: ' . get_page_location_uri($realpage));
                        return;
                    } elseif (is_url($realpage)) {
                        header('HTTP/1.0 301 Moved Permanently');
                        header('Location: ' . $realpage);
                        return;
                    } elseif (is_interwiki($realpage)) {
                        header('HTTP/1.0 301 Moved Permanently');
                        $vars['page'] = $realpage;
                        return do_plugin_action('interwiki');
                        // header('Location');
                    } else {
                        // 存在しない場合、直接編集フォームに飛ばす // To avoid infinite loop
                        header('Location: ' . get_location_uri('edit', $realpage));
                        return;
                    }
                } elseif (count($realpages) >= 2) {
                    $body = '<p>';
                    $body .= _('This pagename is an alias to') . '<br />';
                    $link = '';
                    foreach ($realpages as $realpage) {
                        $link .= '[[' . $realpage . '>' . $realpage . ']]&br;';
                    }
                    $body .= make_link($link);
                    $body .= '</p>';
                    return array('msg' => _('Redirect'), 'body' => $body);
                }
                $vars['cmd'] = 'edit';
                return do_plugin_action('edit');
                // 存在しないので、編集フォームを表示
            } else {
                // 無効なページ名
                return array('msg' => $_title_invalidwn, 'body' => str_replace('$1', htmlspecialchars($page), str_replace('$2', 'WikiName', $_msg_invalidiwn)));
            }
        }
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:58,代码来源:read.inc.php

示例6: check_page

 /**
  * Check validity of page
  *
  * @access static
  * @param string $page
  * @param array $options
  * @return $options
  */
 function check_page($page, $current)
 {
     $page = get_fullname($page, $current);
     if (!is_page($page)) {
         sonots::mythrow('Page "' . htmlspecialchars($page) . '" does not exist.');
         return;
     }
     if (!check_readable($page, FALSE, FALSE)) {
         sonots::mythrow('Page "' . htmlspecialchars($page) . '" is not readable.');
         return;
     }
     return $page;
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:21,代码来源:contentsx.inc.php

示例7: plugin_source_action

function plugin_source_action()
{
    global $vars, $_source_messages;
    if (PKWK_SAFE_MODE) {
        die_message('PKWK_SAFE_MODE prohibits this');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    $vars['refer'] = $page;
    if (!is_page($page) || !check_readable($page, false, false)) {
        return array('msg' => $_source_messages['msg_notfound'], 'body' => $_source_messages['err_notfound']);
    }
    return array('msg' => $_source_messages['msg_title'], 'body' => '<pre id="source">' . htmlsc(join('', get_source($page))) . '</pre>');
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:13,代码来源:source.inc.php

示例8: plugin_code_action

function plugin_code_action()
{
    global $vars;
    global $_source_messages;
    // if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibits this');
    if (auth::check_role('safemode')) {
        die_message('PKWK_SAFE_MODE prohibits this');
    }
    $vars['refer'] = $vars['page'];
    if (!is_page($vars['page']) || !check_readable($vars['page'], false, false)) {
        return array('msg' => $_source_messages['msg_notfound'], 'body' => $_source_messages['err_notfound']);
    }
    return array('msg' => $_source_messages['msg_title'], 'body' => plugin_code_convert('pukiwiki', join('', get_source($vars['page'])) . "\n"));
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:14,代码来源:code.inc.php

示例9: plugin_read_action

function plugin_read_action()
{
    global $vars, $script;
    global $post;
    $qm = get_qm();
    $qt = get_qt();
    $page = isset($vars['page']) ? $vars['page'] : '';
    //キャッシュを無効化
    if (isset($vars['word'])) {
        $qt->enable_cache = false;
    }
    if (is_page($page)) {
        // ページを表示
        check_readable($page, true, true);
        header_lastmod($page);
        return array('msg' => '', 'body' => '');
    } else {
        if (!PKWK_SAFE_MODE && is_interwiki($page)) {
            return do_plugin_action('interwiki');
            // InterWikiNameを処理
        } else {
            if (is_pagename($page)) {
                $vars['cmd'] = 'edit';
                // 編集権限があれば、編集モードへ。なければ、メッセージを表示
                $editable = edit_auth($page, FALSE, FALSE);
                if ($editable) {
                    return do_plugin_action('edit');
                    // 存在しないので、編集フォームを表示
                } else {
                    //404 NOT FOUND
                    header('HTTP/1.1 404 Not Found');
                    return array('msg' => $qm->m['fmt_err_notfoundpage_title'], 'body' => $qm->replace('fmt_err_notfoundpage', $script));
                }
            } else {
                //EUCエンコーディングかチェック
                if (mb_detect_encoding($post['page'], 'UTF-8,EUC-JP') == 'EUC-JP') {
                    $u_page = mb_convert_encoding($post['page'], 'UTF-8', 'EUC-JP');
                    $enc_page = rawurlencode($u_page);
                    //redirect
                    header("HTTP/1.1 301 Moved Permanently");
                    header('Location: ' . $script . '?' . $enc_page);
                    exit;
                }
                // 無効なページ名
                return array('msg' => $qm->m['fmt_title_invalidiwn'], 'body' => $qm->replace('fmt_err_invalidiwn', h($page), 'WikiName'));
            }
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:49,代码来源:read.inc.php

示例10: plugin_diff_action

function plugin_diff_action()
{
    global $vars;
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_readable($page, true, true);
    $action = isset($vars['action']) ? $vars['action'] : '';
    switch ($action) {
        case 'delete':
            $retval = plugin_diff_delete($page);
            break;
        default:
            $retval = plugin_diff_view($page);
            break;
    }
    return $retval;
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:16,代码来源:diff.inc.php

示例11: plugin_preview_action

function plugin_preview_action()
{
    global $vars;
    $page = isset($vars['page']) ? $vars['page'] : '';
    if (is_page($page)) {
        check_readable($page, true, true);
        $source = get_source($page);
        array_splice($source, 10);
        $body = convert_html($source);
        pkwk_common_headers();
        header('Content-type: text/xml');
        print '<' . '?xml version="1.0" encoding="UTF-8"?' . ">\n";
        print $body;
    }
    exit;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:16,代码来源:preview.inc.php

示例12: plugin_source_action

function plugin_source_action()
{
    global $vars;
    //, $_source_messages;
    // if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibits this');
    if (auth::check_role('safemode')) {
        die_message('PKWK_SAFE_MODE prohibits this');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    $vars['refer'] = $page;
    if (!is_page($page) || !check_readable($page, false, false)) {
        return array('msg' => _(' $1 was not found.'), 'body' => _('cannot display the page source.'));
    }
    $source = join('', get_source($page));
    auth::is_role_page($source);
    return array('msg' => _('Source of  $1'), 'body' => '<pre id="source">' . htmlspecialchars($source) . '</pre>');
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:17,代码来源:source.inc.php

示例13: plugin_source_action

function plugin_source_action()
{
    global $vars, $script;
    if (PKWK_SAFE_MODE) {
        die_message('PKWK_SAFE_MODE prohibits this');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    $vars['refer'] = $page;
    $editable = ss_admin_check();
    if (!$editable) {
        header("Location: {$script}");
        exit;
    }
    $qm = get_qm();
    if (!is_page($page) || !check_readable($page, false, false)) {
        return array('msg' => $qm->m['plg_source']['title_notfound'], 'body' => $qm->m['plg_source']['err_notfound']);
    }
    return array('msg' => $qm->m['plg_source']['title'], 'body' => '<pre id="source">' . htmlspecialchars(join('', get_source($page))) . '</pre>');
}
开发者ID:big2men,项目名称:qhm,代码行数:19,代码来源:source.inc.php

示例14: plugin_referer_action

function plugin_referer_action()
{
    global $vars, $referer;
    global $_referer_msg;
    // Setting: Off
    if (!$referer) {
        return array('msg' => '', 'body' => '');
    }
    if (isset($vars['page']) && is_page($vars['page'])) {
        check_readable($vars['page'], false);
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort));
    }
    $pages = auth::get_existpages(REFERER_DIR, '.ref');
    if (empty($pages)) {
        return array('msg' => '', 'body' => '');
    } else {
        return array('msg' => 'referer list', 'body' => page_list($pages, 'referer', FALSE));
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:20,代码来源:referer.inc.php

示例15: plugin_grepall_grep

function plugin_grepall_grep()
{
    global $vars, $defaultpage;
    $page = isset($vars['page']) ? $vars['page'] : $defultpage;
    $filter = isset($vars['filter']) ? $vars['filter'] : '';
    $grep = isset($vars['grep']) ? $vars['grep'] : '';
    // page lists
    if ($page !== '') {
        if (!is_page($page)) {
            $body = '<p>' . htmlspecialchars($page) . ' does not exist.</p>';
            return $body;
        }
        $pages = (array) $page;
    } else {
        $pages = get_existpages();
        if ($filter !== '') {
            $pages = preg_grep('/' . preg_quote($filter, '/') . '/', $pages);
        }
    }
    // grep
    $body = '';
    foreach ($pages as $page) {
        if (!check_readable($page)) {
            $body = '<p>' . htmlspecialchars($page) . ' is not readable.</p>';
            return $body;
        }
        $lines = get_source($page);
        $lines = preg_grep('/' . preg_quote($grep, '/') . '/', $lines);
        if (empty($lines)) {
            continue;
        }
        $contents = '';
        foreach ($lines as $i => $line) {
            $contents .= sprintf('%04d:', $i) . htmlspecialchars($line);
        }
        $body .= make_pagelink($page) . '<br />' . "\n";
        $body .= '<pre>' . htmlspecialchars($contents) . '</pre>';
    }
    return $body;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:40,代码来源:grepall.inc.php


注:本文中的check_readable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。