本文整理汇总了PHP中pkwk_headers_sent函数的典型用法代码示例。如果您正苦于以下问题:PHP pkwk_headers_sent函数的具体用法?PHP pkwk_headers_sent怎么用?PHP pkwk_headers_sent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pkwk_headers_sent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_newpage_action
function plugin_newpage_action()
{
global $vars;
$_btn_edit = _('Edit');
$_msg_newpage = _('New page');
// if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
if (auth::check_role('readonly')) {
die_message(_('PKWK_READONLY prohibits editing'));
}
if (auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
if ($vars['page'] == '') {
$retvars['msg'] = $_msg_newpage;
$retvars['body'] = plugin_newpage_convert();
return $retvars;
} else {
$page = strip_bracket($vars['page']);
if (isset($vars['refer'])) {
$r_page = get_fullname($page, $vars['refer']);
$r_refer = 'refer=' . $vars['refer'];
} else {
$r_page = $page;
$r_refer = '';
}
pkwk_headers_sent();
header('Location: ' . get_page_location_uri($r_page, $r_refer));
exit;
}
}
示例2: plugin_lookup_action
function plugin_lookup_action()
{
global $post;
// Deny GET method to avlid GET loop
$qm = get_qm();
$page = isset($post['page']) ? $post['page'] : '';
$inter = isset($post['inter']) ? $post['inter'] : '';
if ($page == '') {
return FALSE;
}
// Do nothing
if ($inter == '') {
return array('msg' => $qm->m['plg_lookup']['err_invalid_access'], 'body' => '');
}
$url = get_interwiki_url($inter, $page);
if ($url === FALSE) {
$msg = $qm->replace('fmt_err_iw_not_found', $inter);
$msg = h($msg);
return array('msg' => $qm->m['plg_lookup']['title_not_found'], 'body' => $msg);
}
pkwk_headers_sent();
header('Location: ' . $url);
// Publish as GET method
exit;
}
示例3: plugin_newpage_action
function plugin_newpage_action()
{
global $vars;
$qm = get_qm();
if (PKWK_READONLY) {
die_message($qm->m['fmt_err_pkwk_readonly']);
}
if ($vars['page'] == '') {
$retvars['msg'] = $qm->m['plg_newpage']['label'];
$retvars['body'] = plugin_newpage_convert();
if (preg_match('/id="([^"]+)"/', $retvars['body'], $ms)) {
$domid = $ms[1];
//jquery ライブラリの読み込み
$qt = get_qt();
$qt->setv('jquery_include', true);
$addscript = <<<EOS
<script type="text/javascript">
jQuery(function(){
\tjQuery("#{$domid}").focus().select();
});
</script>
EOS;
$qt->appendv_once('plugin_select_fsize', 'beforescript', $addscript);
}
return $retvars;
} else {
$page = strip_bracket($vars['page']);
$r_page = rawurlencode(isset($vars['refer']) ? get_fullname($page, $vars['refer']) : $page);
$r_refer = rawurlencode($vars['refer']);
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
exit;
}
}
示例4: plugin_rss10_action
function plugin_rss10_action()
{
pkwk_headers_sent();
header('Status: 301 Moved Permanently');
header('Location: ' . get_script_uri() . '?cmd=rss&ver=1.0');
// HTTP
exit;
}
示例5: plugin_rss10_action
function plugin_rss10_action()
{
pkwk_headers_sent();
header('Status: 301 Moved Permanently');
header('Location: ' . get_location_uri('rss', '', 'ver=1.0'));
// HTTP
exit;
}
示例6: plugin_touchgraph_action
function plugin_touchgraph_action()
{
global $vars;
pkwk_headers_sent();
header('Content-type: text/plain');
if (isset($vars['reverse'])) {
plugin_touchgraph_ref();
} else {
plugin_touchgraph_rel();
}
exit;
}
示例7: plugin_interwiki_action
function plugin_interwiki_action()
{
global $vars, $InterWikiName;
if (PKWK_SAFE_MODE) {
die_message('InterWiki plugin is not allowed');
}
$match = array();
if (!preg_match("/^{$InterWikiName}\$/", $vars['page'], $match)) {
return plugin_interwiki_invalid();
}
$url = get_interwiki_url($match[2], $match[3]);
if ($url === FALSE) {
return plugin_interwiki_invalid();
}
pkwk_headers_sent();
header('Location: ' . $url);
exit;
}
示例8: plugin_pcomment_action
function plugin_pcomment_action()
{
global $vars;
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits editing');
}
if (!isset($vars['msg']) || $vars['msg'] == '') {
return array();
}
$refer = isset($vars['refer']) ? $vars['refer'] : '';
$retval = plugin_pcomment_insert();
if ($retval['collided']) {
$vars['page'] = $refer;
return $retval;
}
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurlencode($refer));
exit;
}
示例9: plugin_newpage_action
function plugin_newpage_action()
{
global $vars, $_btn_edit, $_msg_newpage;
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits editing');
}
if ($vars['page'] == '') {
$retvars['msg'] = $_msg_newpage;
$retvars['body'] = plugin_newpage_convert();
return $retvars;
} else {
$page = strip_bracket($vars['page']);
$r_page = rawurlencode(isset($vars['refer']) ? get_fullname($page, $vars['refer']) : $page);
$r_refer = rawurlencode($vars['refer']);
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
exit;
}
}
示例10: plugin_pcomment_action
function plugin_pcomment_action()
{
global $post, $vars;
// if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
if (auth::check_role('readonly')) {
die_message('PKWK_READONLY prohibits editing');
}
// Petit SPAM Check (Client(Browser)-Server Ticket Check)
$b = FALSE;
if (!isset($post['encode_hint']) && PKWK_ENCODING_HINT == '') {
$b = TRUE;
} elseif (isset($post['encode_hint']) && $post['encode_hint'] == PKWK_ENCODING_HINT) {
$b = TRUE;
}
if ($b === FALSE) {
honeypot_write();
return array('msg' => '', 'body' => '');
// Do nothing
}
if (!isset($vars['msg']) || $vars['msg'] == '') {
return array();
}
// Validate
if (is_spampost(array('msg'))) {
honeypot_write();
return array('msg' => '', 'body' => '');
// Do nothing
}
$refer = isset($vars['refer']) ? $vars['refer'] : '';
if (!is_page($refer) && auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
$retval = plugin_pcomment_insert();
if ($retval['collided']) {
$vars['page'] = $refer;
return $retval;
}
pkwk_headers_sent();
header('Location: ' . get_page_location_uri($refer));
exit;
}
示例11: plugin_lookup_action
function plugin_lookup_action()
{
global $post;
// Deny GET method to avlid GET loop
$page = isset($post['page']) ? $post['page'] : '';
$inter = isset($post['inter']) ? $post['inter'] : '';
if ($page == '') {
return false;
}
// Do nothing
if ($inter == '') {
return array('msg' => 'Invalid access', 'body' => '');
}
$url = get_interwiki_url($inter, $page);
if ($url === false) {
$msg = sprintf('InterWikiName "%s" not found', $inter);
$msg = htmlsc($msg);
return array('msg' => 'Not found', 'body' => $msg);
}
pkwk_headers_sent();
header('Location: ' . $url);
// Publish as GET method
exit;
}
示例12: plugin_tracker_action
function plugin_tracker_action()
{
global $post, $vars, $now;
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits editing');
}
$config_name = array_key_exists('_config', $post) ? $post['_config'] : '';
$config = new Config('plugin/tracker/' . $config_name);
if (!$config->read()) {
return "<p>config file '" . htmlsc($config_name) . "' not found.</p>";
}
$config->config_name = $config_name;
$source = $config->page . '/page';
$refer = array_key_exists('_refer', $post) ? $post['_refer'] : $post['_base'];
if (!is_pagename($refer)) {
return array('msg' => 'cannot write', 'body' => 'page name (' . htmlsc($refer) . ') is not valid.');
}
if (!is_page($source)) {
return array('msg' => 'cannot write', 'body' => 'page template (' . htmlsc($source) . ') is not exist.');
}
// ページ名を決定
$base = $post['_base'];
$num = 0;
$name = array_key_exists('_name', $post) ? $post['_name'] : '';
if (array_key_exists('_page', $post)) {
$page = $real = $post['_page'];
} else {
$real = is_pagename($name) ? $name : ++$num;
$page = get_fullname('./' . $real, $base);
}
if (!is_pagename($page)) {
$page = $base;
}
while (is_page($page)) {
$real = ++$num;
$page = "{$base}/{$real}";
}
// ページデータを生成
$postdata = plugin_tracker_get_source($source);
// 規定のデータ
$_post = array_merge($post, $_FILES);
$_post['_date'] = $now;
$_post['_page'] = $page;
$_post['_name'] = $name;
$_post['_real'] = $real;
// $_post['_refer'] = $_post['refer'];
$fields = plugin_tracker_get_fields($page, $refer, $config);
// Creating an empty page, before attaching files
touch(get_filename($page));
foreach (array_keys($fields) as $key) {
$value = array_key_exists($key, $_post) ? $fields[$key]->format_value($_post[$key]) : '';
foreach (array_keys($postdata) as $num) {
if (trim($postdata[$num]) == '') {
continue;
}
$postdata[$num] = str_replace("[{$key}]", ($postdata[$num][0] == '|' or $postdata[$num][0] == ':') ? str_replace('|', '|', $value) : $value, $postdata[$num]);
}
}
// Writing page data, without touch
page_write($page, join('', $postdata));
$r_page = rawurlencode($page);
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . $r_page);
exit;
}
示例13: plugin_amazon_action
function plugin_amazon_action()
{
global $vars, $script, $edit_auth, $edit_auth_users;
global $amazon_body, $asin, $asin_all;
$qm = get_qm();
if (PKWK_READONLY) {
die_message($qm->m['fmt_err_pkwk_readonly']);
}
$s_page = isset($vars['refer']) ? $vars['refer'] : '';
$asin_all = isset($vars['asin']) ? htmlspecialchars(rawurlencode(strip_bracket($vars['asin']))) : '';
if (!is_asin()) {
$retvars['msg'] = $qm->m['plg_amazon']['review_title'];
$retvars['refer'] =& $s_page;
$retvars['body'] = plugin_amazon_convert();
return $retvars;
} else {
$r_page = $s_page . '/' . $asin;
$r_page_url = rawurlencode($r_page);
$auth_user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '';
pkwk_headers_sent();
if ($edit_auth && ($auth_user == '' || !isset($edit_auth_users[$auth_user]) || $edit_auth_users[$auth_user] != $_SERVER['PHP_AUTH_PW'])) {
// Edit-auth failed. Just look the page
header('Location: ' . get_script_uri() . '?' . $r_page_url);
} else {
$title = plugin_amazon_get_asin_title();
if ($title == '' || preg_match('#^/#', $s_page)) {
// Invalid page name
header('Location: ' . get_script_uri() . '?' . rawurlencode($s_page));
} else {
$body = '#amazon(' . $asin_all . ',,image)' . "\n" . '*' . $title . "\n" . $amazon_body;
plugin_amazon_review_save($r_page, $body);
header('Location: ' . get_script_uri() . '?cmd=edit&page=' . $r_page_url);
}
}
exit;
}
}
示例14: plugin_approve_action
function plugin_approve_action()
{
global $vars, $post;
if (auth::check_role('readonly')) {
die_message(_('PKWK_READONLY prohibits editing'));
}
if (auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
// Petit SPAM Check (Client(Browser)-Server Ticket Check)
$spam = FALSE;
if (function_exists('pkwk_session_start') && pkwk_session_start() != 0) {
$s_tracker = md5(get_ticket() . 'Approve');
error_log("\$s_tracker: " . $s_tracker);
error_log("\$_SESSION['tracker']: " . $_SESSION['tracker']);
} else {
if (isset($post['encode_hint']) && $post['encode_hint'] != '') {
error_log("\$post['encode_hint']: " . $post['encode_hint']);
if (PKWK_ENCODING_HINT != $post['encode_hint']) {
$spam = TRUE;
}
} else {
error_log("PKWK_ENCODING_HINT: " . PKWK_ENCODING_HINT);
if (PKWK_ENCODING_HINT != '') {
$spam = TRUE;
}
}
error_log("is_spampost: " . is_spampost(array('body'), PLUGIN_TRACKER_REJECT_SPAMCOUNT));
if (is_spampost(array('body'), PLUGIN_TRACKER_REJECT_SPAMCOUNT)) {
$spam = TRUE;
}
}
error_log("isSpam: " . $spam);
if ($spam) {
honeypot_write();
return array('msg' => 'cannot write', 'body' => '<p>prohibits editing</p>');
}
$name = isset($post['name']) ? $post['name'] : '';
$page = isset($post['_page']) ? $post['_page'] : '';
if ($name == '') {
return '<p>approve(): empty name.</p>';
}
if ($page == '') {
return '<p>approve(): empty page.</p>';
}
$config_path = PLUGIN_APPROVE_CONFIG_ROOT . $name;
$config = new YamlConfig($config_path);
if (!$config->read()) {
return array('msg' => 'Approve', 'body' => '<p>approve(): failed to load config. "' . $config_path . '"</p>');
}
$pattern = $config[PLUGIN_APPROVE_KEY_PATTERN];
$replace = $config[PLUGIN_APPROVE_KEY_REPLACE];
$page_regex = $config[PLUGIN_APPROVE_KEY_PAGE_REGEX];
if ($page == '') {
return array('msg' => 'Approve', 'body' => '<p>approve(): empty page.</p>');
}
if ($pattern == '') {
return array('msg' => 'Approve', 'body' => '<p>approve(): empty pattern.</p>');
}
if ($page_regex == '') {
return array('msg' => 'Approve', 'body' => '<p>approve(): empty page_regex.</p>');
}
if (!preg_match($page_regex, $page)) {
return array('msg' => 'Approve', 'body' => '<p>approve(): page not match.</p>');
}
if (PKWK_READONLY > 0 || is_freeze($vars['page']) || !plugin_approve_is_edit_authed($page)) {
return array('msg' => 'Approve', 'body' => '<p>approve(): prohibit editing. "' . $page . '"</p>');
}
$source = get_source($page, TRUE, TRUE);
if ($source === FALSE) {
return array('msg' => 'Approve', 'body' => '<p>approve(): failed to load page. "' . $page . '"</p>');
}
if (strpos($source, $pattern) === FALSE) {
return array('msg' => 'Approve', 'body' => '<p>approve(): pattern not match.</p>');
}
$source = str_replace($pattern, $replace, $source);
//return array('msg'=>'Approve', 'body'=>$source);
page_write($page, $source);
pkwk_headers_sent();
header('Location: ' . get_page_location_uri($page));
exit;
}
示例15: plugin_bugtrack_action
function plugin_bugtrack_action()
{
global $post;
global $_plugin_bugtrack;
// if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
if (auth::check_role('readonly')) {
die_message('PKWK_READONLY prohibits editing');
}
if (auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
if ($post['mode'] != 'submit') {
return FALSE;
}
// Petit SPAM Check (Client(Browser)-Server Ticket Check)
$spam = FALSE;
if (isset($post['encode_hint']) && $post['encode_hint'] != '') {
if (PKWK_ENCODING_HINT != $post['encode_hint']) {
$spam = TRUE;
}
} else {
if (PKWK_ENCODING_HINT != '') {
$spam = TRUE;
}
}
// Vaildation foreign values(by miko)
if (!in_array($post['priority'], $_plugin_bugtrack['priority_list'])) {
$spam = TRUE;
}
if (!in_array($post['state'], $_plugin_bugtrack['state_list'])) {
$spam = TRUE;
}
if ($spam) {
honeypot_write();
return array('msg' => 'cannot write', 'body' => '<p>prohibits editing</p>');
}
$page = plugin_bugtrack_write($post['base'], $post['pagename'], $post['summary'], $post['name'], $post['priority'], $post['state'], $post['category'], $post['version'], $post['body']);
pkwk_headers_sent();
header('Location: ' . get_page_location_uri($page));
exit;
}