• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pkwk_common_headers函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: plugin_ajaxrss_action

function plugin_ajaxrss_action()
{
    global $get;
    if ($get['t'] == 'js') {
        $output = plugin_ajaxrss_output_js();
        // Feeding start
        pkwk_common_headers();
        //		header('Content-type: text/javascript');
        print $output;
    } else {
        if ($get['t'] == 'url') {
            $output = plugin_ajaxrss_output_url(decode($get['q']));
            // Feeding start
            pkwk_common_headers();
            header('Content-type: application/xml');
            if (!preg_match('/\\<\\?xml/', $output, $matches)) {
                print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
            }
            print $output;
        } else {
            $output = plugin_ajaxrss_output_xml();
            // Feeding start
            pkwk_common_headers();
            header('Content-type: application/xml');
            if (!preg_match('/\\<\\?xml/', $output, $matches)) {
                print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
            }
            print $output;
        }
    }
    exit;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:32,代码来源:ajaxrss.inc.php


示例2: plugin_markdown_convert

/**
 * Markdon Syntax
 *
 * @author     sonots
 * @license    http://www.gnu.org/licenses/gpl.html GPL v2
 * @link       http://lsx.sourceforge.jp/?Plugin%2Fmarkdown.inc.php
 * @version    $Id: markdown.inc.php,v 1.2 2007-02-24 16:28:39Z sonots $
 * @package    plugin
 */
function plugin_markdown_convert()
{
    if (defined('PLUGIN_DIR') && file_exists(PLUGIN_DIR . 'markdown.php')) {
        $markdown = PLUGIN_DIR . 'markdown.php';
    } elseif (defined('EXT_PLUGIN_DIR') && file_exists(EXT_PLUGIN_DIR . 'markdown.php')) {
        $markdown = EXT_PLUGIN_DIR . 'markdown.php';
    } else {
        return "markdown(): markdown.php does not exist under " . PLUGIN_DIR . ' or ' . EXT_PLUGIN_DIR;
    }
    $args = func_get_args();
    $body = array_pop($args);
    $noskin = in_array("noskin", $args);
    global $vars;
    if (!(PKWK_READONLY > 0 or is_freeze($vars['page']) or plugin_markdown_is_edit_auth($vars['page']))) {
        $body = htmlspecialchars($body);
    }
    require_once $markdown;
    $body = Markdown($body);
    if ($noskin) {
        pkwk_common_headers();
        print $body;
        exit;
    }
    return $body;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:34,代码来源:markdown.inc.php


示例3: plugin_cache_ref_action

function plugin_cache_ref_action()
{
    global $vars;
    $usage = 'Usage: plugin=cache_ref&amp;src=filename';
    if (!isset($vars['src'])) {
        return array('msg' => 'Invalid argument', 'body' => $usage);
    }
    $filename = $vars['src'];
    $ref = CACHE_DIR . $filename;
    if (!file_exists($ref)) {
        return array('msg' => 'Cache file not found', 'body' => $usage);
    }
    $got = @getimagesize($ref);
    if (!isset($got[2])) {
        $got[2] = FALSE;
    }
    switch ($got[2]) {
        case 1:
            $type = 'image/gif';
            break;
        case 2:
            $type = 'image/jpeg';
            break;
        case 3:
            $type = 'image/png';
            break;
        case 4:
            $type = 'application/x-shockwave-flash';
            break;
        default:
            return array('msg' => 'Seems not an image', 'body' => $usage);
    }
    // Care for Japanese-character-included file name
    if (LANG == 'ja_JP') {
        switch (UA_NAME . '/' . UA_PROFILE) {
            case 'Opera/default':
                // Care for using _auto-encode-detecting_ function
                $filename = mb_convert_encoding($filename, 'UTF-8', 'auto');
                break;
            case 'MSIE/default':
                $filename = mb_convert_encoding($filename, 'SJIS', 'auto');
                break;
        }
    }
    $file = htmlspecialchars($filename);
    $size = filesize($ref);
    // Output
    pkwk_common_headers();
    header('Content-Disposition: inline; filename="' . $filename . '"');
    header('Content-Length: ' . $size);
    header('Content-Type: ' . $type);
    // @readfile($ref);
    plus_readfile($ref);
    exit;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:55,代码来源:cache_ref.inc.php


示例4: plugin_gmapfun_action

function plugin_gmapfun_action()
{
    global $vars;
    $page = $vars['page'];
    $body = '';
    if (is_page($page)) {
        $body = convert_html(get_source($page));
        $qt = get_qt();
        $before = $qt->getv('beforescript');
    }
    pkwk_common_headers();
    print $before . $body;
    exit;
}
开发者ID:big2men,项目名称:qhm,代码行数:14,代码来源:gmapfun.inc.php


示例5: 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


示例6: plugin_monobook_login_action

function plugin_monobook_login_action()
{
    global $vars, $auth_users, $_msg_auth, $_monobook_login_messages;
    if (!isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['PHP_AUTH_PW']) && isset($_SERVER['HTTP_AUTHORIZATION'])) {
        list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
    }
    if (auth::check_role('readonly') || !isset($_SERVER['PHP_AUTH_USER']) || !isset($auth_users[$_SERVER['PHP_AUTH_USER']]) || !isset($_SERVER['PHP_AUTH_PW']) || pkwk_hash_compute($_SERVER['PHP_AUTH_PW'], $auth_users[$_SERVER['PHP_AUTH_USER']]) !== $auth_users[$_SERVER['PHP_AUTH_USER']]) {
        pkwk_common_headers();
        header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"');
        header('HTTP/1.0 401 Unauthorized');
        $msg = $_monobook_login_messages['auth_failed'];
        return array('msg' => $msg, 'body' => '<p>' . $msg . '</p>');
    } elseif (isset($vars['refer']) && is_page($vars['refer'])) {
        header('Location: ' . get_script_uri() . '?' . rawurlencode($vars['refer']));
    }
    return;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:17,代码来源:monobook_login.inc.php


示例7: plugin_tooltip_action

function plugin_tooltip_action()
{
    global $vars;
    $term = $vars['q'];
    if (trim($term) == '') {
        exit;
    }
    $glossary = plugin_tooltip_get_glossary($term, '', TRUE);
    if ($glossary == FALSE) {
        exit;
    }
    $s_glossary = convert_html($glossary);
    pkwk_common_headers();
    header('Content-type: text/xml');
    print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
    print $s_glossary;
    exit;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:18,代码来源:tooltip.inc.php


示例8: plugin_htmlp_convert

function plugin_htmlp_convert()
{
    $args = func_get_args();
    $body = array_pop($args);
    if (substr($body, -1) != "\r") {
        return '<p>htmlp(): no argument(s).</p>';
    }
    require_once 'htmlpurifier/library/HTMLPurifier.auto.php';
    $purifier = new HTMLPurifier();
    $body = $purifier->purify($body);
    $noskin = in_array("noskin", $args);
    if ($noskin) {
        pkwk_common_headers();
        print $body;
        exit;
    }
    return $body;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:18,代码来源:htmlp.inc.php


示例9: plugin_xbel_action

function plugin_xbel_action()
{
    global $vars, $page_title, $rss_description, $whatsnew;
    $adm = empty($vars['adm']) ? 'page' : $vars['adm'];
    // ユーザ認証されていない
    $id = auth::check_auth();
    if (empty($id)) {
        $adm = 'recent';
    }
    $data = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
<xbel version="1.0">
<title><![CDATA[{$page_title}]]></title>
<desc><![CDATA[{$rss_description}]]></desc>


EOD;
    change_uri('', 1);
    // Force absoluteURI.
    switch ($adm) {
        case 'list':
            $pages = xbel::get_data();
            break;
        case 'recent':
            $pages = array($whatsnew);
            break;
            // list
        // list
        default:
            $page = empty($vars['page']) ? $whatsnew : $vars['page'];
            $pages = array($page);
            unset($page);
    }
    foreach ($pages as $page) {
        $links = xbel::get_link_list($page);
        $data .= xbel::put_body($links, $page);
    }
    $data .= "</xbel>\n";
    pkwk_common_headers();
    header('Content-type: application/xml');
    print $data;
    exit;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:44,代码来源:xbel.inc.php


示例10: action

 function action()
 {
     global $vars;
     list($page, $variables, $this->action_options) = $this->parse_args_action($vars, $this->default_action_options);
     if ($page == '') {
         return array('msg' => $this->plugin, 'body' => '<p class="alert alert-warning">#' . $this->plugin() . ': No page is specified.</p>');
     }
     $source = $this->htmlinsert($page, $variables);
     if ($this->error != "") {
         return array('msg' => $this->plugin, 'body' => '<p class="alert alert-warning">#' . $this->plugin() . ': ' . $this->error . '</p>');
     }
     // no skin
     pkwk_common_headers();
     if ($this->action_options['content_type'] != '') {
         header('Content-Type: ' . htmlsc($this->action_options['content_type']));
     }
     print $source;
     exit;
 }
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:19,代码来源:htmlinsert.inc.php


示例11: plugin_html_convert

/**
 * Write HTML
 *
 * @author     sonots
 * @license    http://www.gnu.org/licenses/gpl.html GPL v2
 * @link       http://lsx.sourceforge.jp/?Plugin%2Fhtml.inc.php
 * @version    $Id: html.inc.php,v 2.2 2007-03-20 23:44:19Z sonots $
 * @package    plugin
 */
function plugin_html_convert()
{
    $args = func_get_args();
    $body = array_pop($args);
    if (substr($body, -1) != "\r") {
        return '<p>html(): no argument(s).</p>';
    }
    $page = $GLOBALS['vars']['page'];
    if (!plugin_html_is_edit_restricted($page)) {
        return "<p>html(): Current page, {$page}, must be edit_authed or frozen or whole system must be PKWK_READONLY.</p>";
    }
    $noskin = in_array("noskin", $args);
    if ($noskin) {
        pkwk_common_headers();
        print $body;
        exit;
    }
    return $body;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:28,代码来源:html.inc.php


示例12: plugin_mceedit_realview

function plugin_mceedit_realview()
{
    global $vars;
    $vars['msg'] = preg_replace(PLUGIN_EDIT_FREEZE_REGEX, '', $vars['msg']);
    $postdata = $vars['msg'];
    if ($postdata) {
        $postdata = make_str_rules($postdata);
        $postdata = explode("\n", $postdata);
        $postdata = drop_submit(convert_html($postdata));
    }
    // Feeding start
    pkwk_common_headers();
    header('Content-type: text/xml; charset=UTF-8');
    print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
    print $postdata;
    $longtaketime = getmicrotime() - MUTIME;
    $taketime = sprintf('%01.03f', $longtaketime);
    print '<span class="small1">(Time:' . $taketime . ')</span>';
    exit;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:20,代码来源:mceedit.inc.php


示例13: action

 /**
  * Action Plugin Main Function
  */
 function action()
 {
     global $vars;
     $page = $vars['page'];
     unset($vars['page']);
     if (!isset($page) || $page == '') {
         return array('msg' => $this->plugin, 'body' => '<p>' . $this->error_message(5) . '</p>');
     }
     $argoptions = $vars;
     unset($argoptions['cmd']);
     list($options, $variables) = $this->evaluate_options($argoptions, $this->defoptions);
     $source = $this->htmlinsert($page, $variables);
     if (!is_string($source)) {
         return array('msg' => $this->plugin, 'body' => '<p>' . $this->error_message($source) . '</p>');
     }
     // no skin
     pkwk_common_headers();
     if (!empty($options['content_type'])) {
         header('Content-Type: ' . htmlspecialchars($options['content_type']));
     }
     print $source;
     exit;
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:26,代码来源:htmlinsert.inc.php


示例14: plugin_commu_html_convert

function plugin_commu_html_convert()
{
    global $vars;
    //キャッシュを無効に
    if (QHM_VERSION < 4.6) {
        global $enable_cache;
        $enable_cache = false;
    } else {
        $qt = get_qt();
        $qt->enable_cache = false;
    }
    $page = $vars['page'];
    if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_commu_html_is_edit_auth($page))) {
        return "<p>commu_html(): Current page, {$page}, must be edit_authed or frozen or whole system must be PKWK_READONLY.</p>";
    }
    $args = func_get_args();
    $body = array_pop($args);
    $noskin = in_array("noskin", $args);
    $s = array();
    $r = array();
    $cnt = 0;
    if (isset($_SESSION['commu_user'])) {
        foreach ($_SESSION['commu_user'] as $key => $val) {
            $s[$cnt] = '/<%' . $key . '%>/';
            $r[$cnt] = mb_convert_encoding($val, "UTF-8", "UTF-8,EUC-JP");
            $cnt++;
        }
        $body = preg_replace($s, $r, $body);
    }
    if ($noskin) {
        pkwk_common_headers();
        print $body;
        exit;
    }
    return $body;
}
开发者ID:big2men,项目名称:qhm,代码行数:36,代码来源:commu_html.inc.php


示例15: pkwk_output_noskin

 /**
  * Output contents without skin
  *
  * PukiWiki API Extension
  *
  * @access public
  * @static
  * @param string $body html
  * @param string $content_type e.g., 'text/html', 'text/css', 'text/javascript'
  * @return void exit
  * @uses pkwk_common_headers (PukiWiki lib/html.php)
  * @version $Id: v 1.0 2008-06-05 11:14:46 sonots $
  */
 function pkwk_output_noskin($body, $content_type = 'text/html')
 {
     pkwk_common_headers();
     header('Content-Type: ' . $content_type);
     print $body;
     exit;
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:20,代码来源:sonots.class.php


示例16: output_site_close_message

function output_site_close_message($site_name, $login_url)
{
    global $qhm_adminmenu;
    $qhm_sign = $qhm_adminmenu < 2 ? '<a href="' . h($login_url) . '">QHM</a>' : 'QHM';
    pkwk_common_headers();
    $qm = get_qm();
    $closetitle = $qm->m['func']['close_title'];
    $closemsg = $qm->m['func']['close_message'];
    header('Content-Type: text/html; charset=utf-8');
    print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>{$closetitle} : {$site_name} (Close this site)</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="GENERATOR" content="Quick Homepage Maker" />
  <style>
  body{
  \tbackground-color:#ccc;
  \tcolor:#333;
  \tfont-family: "Arial", "San-serif";
  \tfont-size: 10pt;
  \tline-height:1.5em;
  }
  #wrapper {
  \tbackground-color:#fff;
  \tpadding:20px;
  \tmargin:20px auto;
  \twidth:500px;
  \tborder: 1px solid #aaa;
  }
  #wrapper h1{
  \tfont-size:12pt;
  }
  #login{
  \t\tcolor:#999;
  \t\tfont-size:11px;
  \t\ttext-align:right;
  }
  #login a{
  \t\tcolor:#999;
\t\ttext-decoration:none;
  }
  </style>
 </head>
 <body>
 <div id="wrapper">
 <h1>{$closetitle}</h1>
 <p>{$closemsg}</p>
 <br />

 <h1>Closed</h1>
 <p>Sorry, but this site is now closed</p>

 <div id="login">powered by {$qhm_sign}</div>
 </div>
 </body>
</html>
EOD;
    exit;
}
开发者ID:big2men,项目名称:qhm,代码行数:61,代码来源:func.php


示例17: plugin_rss_action

function plugin_rss_action()
{
    global $vars, $rss_max, $page_title, $whatsnew, $trackback;
    $version = isset($vars['ver']) ? $vars['ver'] : '';
    switch ($version) {
        case '':
            $version = '0.91';
            break;
            // Default
        // Default
        case '1':
            $version = '1.0';
            break;
            // Sugar
        // Sugar
        case '2':
            $version = '2.0';
            break;
            // Sugar
        // Sugar
        case '0.91':
            /* FALLTHROUGH */
        /* FALLTHROUGH */
        case '1.0':
            /* FALLTHROUGH */
        /* FALLTHROUGH */
        case '2.0':
            break;
        default:
            die('Invalid RSS version!!');
    }
    $recent = CACHE_DIR . 'recent.dat';
    if (!file_exists($recent)) {
        die('recent.dat is not found');
    }
    $lang = LANG;
    $page_title_utf8 = mb_convert_encoding($page_title, 'UTF-8', SOURCE_ENCODING);
    $self = get_script_uri();
    // Creating <item>
    $items = $rdf_li = '';
    foreach (file_head($recent, $rss_max) as $line) {
        list($time, $page) = explode("\t", rtrim($line));
        $r_page = rawurlencode($page);
        $title = mb_convert_encoding($page, 'UTF-8', SOURCE_ENCODING);
        switch ($version) {
            case '0.91':
                /* FALLTHROUGH */
            /* FALLTHROUGH */
            case '2.0':
                $date = get_date('D, d M Y H:i:s T', $time);
                $date = $version == '0.91' ? ' <description>' . $date . '</description>' : ' <pubDate>' . $date . '</pubDate>';
                $items .= <<<EOD
<item>
 <title>{$title}</title>
 <link>{$self}?{$r_page}</link>
{$date}
</item>

EOD;
                break;
            case '1.0':
                // Add <item> into <items>
                $rdf_li .= '    <rdf:li rdf:resource="' . $self . '?' . $r_page . '" />' . "\n";
                $date = substr_replace(get_date('Y-m-d\\TH:i:sO', $time), ':', -2, 0);
                $trackback_ping = '';
                if ($trackback) {
                    $tb_id = md5($r_page);
                    $trackback_ping = ' <trackback:ping>' . $self . '?tb_id=' . $tb_id . '</trackback:ping>';
                }
                $items .= <<<EOD
<item rdf:about="{$self}?{$r_page}">
 <title>{$title}</title>
 <link>{$self}?{$r_page}</link>
 <dc:date>{$date}</dc:date>
 <dc:identifier>{$self}?{$r_page}</dc:identifier>
{$trackback_ping}
</item>

EOD;
                break;
        }
    }
    // Feeding start
    pkwk_common_headers();
    header('Content-type: application/xml');
    print '<?xml version="1.0" encoding="UTF-8"?>' . "\n\n";
    $r_whatsnew = rawurlencode($whatsnew);
    switch ($version) {
        case '0.91':
            print '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"' . ' "http://my.netscape.com/publish/formats/rss-0.91.dtd">' . "\n";
            /* FALLTHROUGH */
        /* FALLTHROUGH */
        case '2.0':
            print <<<EOD
<rss version="{$version}">
 <channel>
  <title>{$page_title_utf8}</title>
  <link>{$self}?{$r_whatsnew}</link>
  <description>PukiWiki RecentChanges</description>
  <language>{$lang}</language>
//.........这里部分代码省略.........
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:101,代码来源:rss.inc.php


示例18: plugin_movieviewer_action_download_hls_key

/**
 * [アクション] 動画(HLS)再生用のキーを返す
 *
 * 注意: exitを呼ぶので、処理の最後に呼び出すこと
 *
 * @return void
 */
function plugin_movieviewer_action_download_hls_key()
{
    pkwk_common_headers();
    header('Content-type: application/octet-stream');
    $settings = MovieViewerSettings::loadFromYaml(PLUGIN_MOVIEVIEWER_PATH_TO_SETTINGS);
    $decrypter = new MovieViewerAwsTranscorderEncriptionKeyDecypter($settings->aws['kms'], $settings->aws['transcoder']);
    print $decrypter->execute();
    exit;
}
开发者ID:montenshi,项目名称:pukiwiki-movieviewer,代码行数:16,代码来源:movieviewer.inc.php


示例19: plugin_tb_output_htmllist

function plugin_tb_output_htmllist($tb_id)
{
    pkwk_common_headers();
    echo 'This function had been removed now. It will be created soon.<br />' . "\n";
    echo 'Sorry for your inconvenience.';
    exit;
    // ----
    // Skeleton Logic
    global $script;
    global $_tb_date;
    $page = tb_id2page($tb_id);
    if ($page === false) {
        return false;
    }
    $data = tb_get(tb_get_filename($page));
    // Sort: The first is the latest
    usort($data, create_function('$a,$b', 'return $b[0] - $a[0];'));
    $tb_body = '';
    foreach ($data as $x) {
        if (count($x) != 5) {
            continue;
        }
        // Ignore incorrect record
        list($time, $url, $title, $excerpt, $blog_name) = $x;
        if ($title == '') {
            $title = 'no title';
        }
        $time = date($_tb_date, $time + LOCALZONE);
        // May 2, 2003 11:25 AM
        $tb_body .= <<<EOD
EOD;
    }
    // Output start
    pkwk_common_headers();
    // BugTrack/466 Care for MSIE trouble
    // Logically correct, but MSIE will treat the data like 'file downloading'
    //header('Content-type: application/xhtml+xml; charset=UTF-8');
    header('Content-type: text/html; charset=UTF-8');
    // Works well
    $meta_content_type = pkwk_output_dtd(PKWK_DTD_XHTML_1_0_TRANSITIONAL, 'UTF-8');
    $msg = <<<EOD
<head>
 {$meta_content_type}
</head>
<body>
 {$script}?tb_id={$tb_id}<br /><br />
 {$tb_body}
</body>
</html>
EOD;
    echo mb_convert_encoding($msg, 'UTF-8', SOURCE_ENCODING);
    exit;
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:53,代码来源:tb.inc.php


示例20: digest_auth

function digest_auth($page, $auth_flag, $exit_flag, $auth_pages, $title_cannot)
{
    global $auth_users, $auth_method_type, $auth_type;
    global $realm;
    if (auth::is_page_auth($page, $auth_flag, $auth_pages, '', '')) {
        return true;
    }
    // No limit
    //$user_list = get_auth_page_users($page, $auth_pages);
    //if (empty($user_list)) return true; // No limit
    if (!auth::check_role('role_adm_contents')) {
        return true;
    }
    // 既にコンテンツ管理者
    if (auth::auth_digest($auth_users)) {
        return true;
    }
    // Auth failed
    if ($auth_flag || $exit_flag) {
        pkwk_common_headers();
    }
    if ($auth_flag) {
        header('HTTP/1.1 401 Unauthorized');
        header('WWW-Authenticate: Digest realm="' . $realm . '", qop="auth", nonce="' . uniqid() . '", opaque="' . md5($realm) . '"');
    }
    if ($exit_flag) {
        $body = $title = str_replace('$1', htmlspecialchars(strip_bracket($page)), $title_cannot);
        $page = str_replace('$1', make_search($page), $title_cannot);
        catbody($title, $page, $body);
        exit;
    }
    return false;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:33,代码来源:auth.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pkwk_headers_sent函数代码示例发布时间:2022-05-15
下一篇:
PHP pkcs5_unpad函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap