本文整理汇总了PHP中generate_form_token函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_form_token函数的具体用法?PHP generate_form_token怎么用?PHP generate_form_token使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_form_token函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Show the contact page
* @param string $lang
*/
public function index($lang = "")
{
// https://css-tricks.com/serious-form-security/
$this->to_tpl['errors'] = array();
$this->to_tpl['success'] = false;
$this->set_language($lang);
if ($lang == "sr") {
$this->template = "contact-sr";
} else {
$this->template = "contact-en";
}
$this->set_page_name($this->language_titles["contact"][$lang]);
if (isset($_POST['submit'])) {
if (verify_form_token('contact')) {
// Building a whitelist array with keys which will send through the form,
// no others would be accepted later on
$whitelist = array('token', 'name', 'email', 'message', 'submit');
// Building an array with the $_POST-superglobal
foreach ($_POST as $key => $item) {
// Check if the value $key (fieldname from $_POST)
// can be found in the whitelisting array,
// if not, die with a short message to the hacker
if (!in_array($key, $whitelist)) {
write_log('Unknown form fields');
die("Hack-Attempt detected. Please use only the fields in the form.");
}
}
// if pass, send email
$from_name = stripcleantohtml($_POST['name']);
$from_email = stripcleantohtml($_POST['email']);
$message = cleantohtml($_POST['message']);
$errors = $this->check_input($from_name, $from_email, $message);
if (!empty($errors)) {
$this->to_tpl['errors'] = $errors;
$this->to_tpl['token'] = $_POST['token'];
return;
}
$send = $this->phpmailer($from_name, $from_email, $message);
if ($send === true) {
$this->to_tpl['success'] = true;
} else {
var_dump($send);
die;
//write_log('PHP Mailer error: ' . $send);
}
} else {
write_log('Formtoken');
die("Hack-Attempt detected.");
}
return;
}
// Generate a new token for the $_SESSION superglobal
// and put them in a hidden field
$this->to_tpl['token'] = generate_form_token('contact');
return;
}
示例2: vt_row_pre_post_actions_merge
/**
* Hook vt_row_pre_post_actions_merge
* Create block thanks info
*
* @param array $cur_post
* @param $forum_user
* @internal param array $forum_page
*/
public static function vt_row_pre_post_actions_merge($cur_post, $forum_user)
{
if ($cur_post['poster_id'] != 1 && $forum_user['g_thanks_enable'] == 1 && $cur_post['thanks_enable'] == 1 && $forum_user['thanks_disable_adm'] == 0 && $forum_user['thanks_enable'] == 1) {
App::$forum_page['author_info']['thanks'] = '<li><a href="' . forum_link(App::$forum_url['thanks_view'], $cur_post['poster_id']) . '">' . App::$lang['Thanks'] . '</a><strong>: <span id="thp' . $cur_post['id'] . '" class="thu' . $cur_post['poster_id'] . '">' . $cur_post['thanks_user'] . '</span></strong></li>';
if (!$forum_user['is_guest'] and $forum_user['id'] != $cur_post['poster_id']) {
if ($forum_user['g_thanks_min'] <= App::$forum_user['num_posts']) {
App::$forum_page['post_actions']['thanks'] = '<span><a class="thanks_info_link thl' . $cur_post['id'] . '" href="' . forum_link(App::$forum_url['thanks'], array($cur_post['id'], $cur_post['poster_id'], generate_form_token('thanks' . $cur_post['id'] . $cur_post['poster_id']))) . '">' . App::$lang['Thanks on post'] . '</a></span>';
}
}
}
}
示例3: generate_form_token
?>
<div class="row">
<div class="bs-callout bs-callout-danger">
<h4>Creation Error</h4>
<?php
echo $error_message;
?>
</div>
</div>
<?php
}
?>
<form name="join-form" action="" method="POST">
<?php
//Get a form token
$token = generate_form_token();
?>
<div class="row">
<?php
if (!empty($answer[0])) {
?>
<div class="form-group has-error">
<input type="text" name="username" class="form-control" placeholder="Username" required="required" value="<?php
echo $username;
?>
">
<label class="control-label form-error-label"><?php
echo $answer[0];
?>
</label>
</div>
示例4: generate_search_crumbs
function generate_search_crumbs($action = null)
{
global $forum_page, $lang_common, $lang_search, $forum_url, $forum_user, $num_hits, $search_set, $search_id, $show_as;
$return = ($hook = get_hook('sf_fn_generate_search_crumbs_start')) ? eval($hook) : null;
if ($return != null) {
return;
}
switch ($action) {
case 'show_new':
$forum_page['crumbs'][] = $lang_search['Topics with new'];
$forum_page['items_info'] = generate_items_info($lang_search['Topics found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
$forum_page['main_foot_options']['mark_all'] = '<span' . (empty($forum_page['main_foot_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['mark_read'], generate_form_token('markread' . $forum_user['id'])) . '">' . $lang_common['Mark all as read'] . '</a></span>';
// Add link for show all topics, not only new (updated)
if ($search_id != -1) {
$forum_page['main_head_options']['show_all'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['forum'], $search_set[0]['forum_id']) . '">' . $lang_search['All Topics'] . '</a></span>';
}
break;
case 'show_recent':
$forum_page['crumbs'][] = $lang_search['Recently active topics'];
$forum_page['items_info'] = generate_items_info($lang_search['Topics found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
case 'show_unanswered':
$forum_page['crumbs'][] = $lang_search['Unanswered topics'];
$forum_page['items_info'] = generate_items_info($lang_search['Topics found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
case 'show_user_posts':
$forum_page['crumbs'][] = sprintf($lang_search['Posts by'], $search_set[0]['pposter'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['items_info'] = generate_items_info($lang_search['Posts found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['user_topics'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search_user_topics'], $search_id) . '">' . sprintf($lang_search['Topics by'], forum_htmlencode($search_set[0]['pposter'])) . '</a></span>';
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
case 'show_user_topics':
$forum_page['crumbs'][] = sprintf($lang_search['Topics by'], $search_set[0]['poster']);
$forum_page['items_info'] = generate_items_info($lang_search['Topics found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['user_posts'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search_user_posts'], $search_id) . '">' . sprintf($lang_search['Posts by'], forum_htmlencode($search_set[0]['poster'])) . '</a></span>';
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
case 'show_subscriptions':
$forum_page['crumbs'][] = $lang_search['Subscriptions'];
$forum_page['items_info'] = generate_items_info($lang_search['Topics found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
case 'show_forum_subscriptions':
$forum_page['crumbs'][] = $lang_search['Forum subscriptions'];
$forum_page['items_info'] = generate_items_info($lang_search['Forums found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['defined_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['User defined search'] . '</a></span>';
break;
default:
$forum_page['crumbs'][] = $lang_search['Search results'];
$forum_page['items_info'] = generate_items_info($show_as == 'topics' ? $lang_search['Topics found'] : $lang_search['Posts found'], $forum_page['start_from'] + 1, $num_hits);
$forum_page['main_head_options']['new_search'] = '<span' . (empty($forum_page['main_head_options']) ? ' class="first-item"' : '') . '><a href="' . forum_link($forum_url['search']) . '">' . $lang_search['Perform new search'] . '</a></span>';
break;
}
}
示例5: get_hook
($hook = get_hook('li_forgot_pass_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT . 'footer.php';
}
}
}
if (!$forum_user['is_guest']) {
header('Location: ' . forum_link($forum_url['index']));
}
// Setup form
$forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
$forum_page['form_action'] = forum_link($forum_url['login']);
$forum_page['hidden_fields'] = array('form_sent' => '<input type="hidden" name="form_sent" value="1" />', 'redirect_url' => '<input type="hidden" name="redirect_url" value="' . forum_htmlencode($forum_user['prev_url']) . '" />', 'csrf_token' => '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />');
// Setup breadcrumbs
$forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), sprintf($lang_login['Login info'], $forum_config['o_board_title']));
($hook = get_hook('li_login_pre_header_load')) ? eval($hook) : null;
define('FORUM_PAGE', 'login');
require FORUM_ROOT . 'header.php';
// START SUBST - <!-- forum_main -->
ob_start();
($hook = get_hook('li_login_output_start')) ? eval($hook) : null;
?>
<div class="main-head">
<h2 class="hn"><span><?php
echo sprintf($lang_login['Login info'], $forum_config['o_board_title']);
?>
</span></h2>
</div>
示例6: forum_htmlencode
$forum_page['ban_info']['message'] = '<li><span>' . $lang_admin_bans['Message'] . '</span> <strong>' . forum_htmlencode($cur_ban['message']) . '</strong></li>';
}
($hook = get_hook('aba_view_ban_pre_display')) ? eval($hook) : null;
?>
<div class="ct-set set<?php
echo ++$forum_page['item_num'];
?>
">
<div class="ct-box">
<div class="ct-legend">
<h3 class=""><span><?php
printf($lang_admin_bans['Current ban head'], $forum_page['ban_creator']);
?>
</span></h3>
<p><?php
printf($lang_admin_bans['Edit or remove'], '<a href="' . forum_link($forum_url['admin_bans']) . '?edit_ban=' . $cur_ban['id'] . '">' . $lang_admin_bans['Edit ban'] . '</a>', '<a href="' . forum_link($forum_url['admin_bans']) . '?del_ban=' . $cur_ban['id'] . '&csrf_token=' . generate_form_token('del_ban' . $cur_ban['id']) . '">' . $lang_admin_bans['Remove ban'] . '</a>');
?>
</p>
</div>
<?php
if (!empty($forum_page['ban_info'])) {
?>
<ul>
<?php
echo implode("\n", $forum_page['ban_info']) . "\n";
?>
</ul>
<?php
}
?>
</div>
示例7: get_hook
($hook = get_hook('acs_add_word_fieldset_end')) ? eval($hook) : null;
?>
</fieldset>
</form>
<?php
if (!empty($forum_censors)) {
// Reset
$forum_page['group_count'] = $forum_page['item_count'] = 0;
?>
<form class="frm-form" method="post" accept-charset="utf-8" action="<?php
echo forum_link($forum_url['admin_censoring']);
?>
?action=foo">
<div class="hidden">
<input type="hidden" name="csrf_token" value="<?php
echo generate_form_token(forum_link($forum_url['admin_censoring']) . '?action=foo');
?>
" />
</div>
<fieldset class="frm-group group<?php
echo ++$forum_page['group_count'];
?>
">
<legend class="group-legend"><span><?php
echo $lang_admin_censoring['Edit censored word legend'];
?>
</span></legend>
<?php
foreach ($forum_censors as $censor_key => $cur_word) {
($hook = get_hook('acs_pre_edit_word_fieldset')) ? eval($hook) : null;
?>
示例8: csrf_confirm_form
function csrf_confirm_form()
{
global $forum_db, $forum_url, $lang_common, $forum_config, $base_url, $forum_start, $tpl_main, $forum_user, $forum_page, $forum_updates, $forum_flash, $forum_loader;
// If we've disabled the CSRF check for this page, we have nothing to do here.
if (defined('FORUM_DISABLE_CSRF_CONFIRM')) {
return;
}
// User pressed the cancel button
if (isset($_POST['confirm_cancel'])) {
redirect(forum_htmlencode($_POST['prev_url']), $lang_common['Cancel redirect']);
}
// A helper function for csrf_confirm_form. It takes a multi-dimensional array and returns it as a
// single-dimensional array suitable for use in hidden fields.
function _csrf_confirm_form($key, $values)
{
$fields = array();
if (is_array($values)) {
foreach ($values as $cur_key => $cur_values) {
$fields = array_merge($fields, _csrf_confirm_form($key . '[' . $cur_key . ']', $cur_values));
}
return $fields;
} else {
$fields[$key] = $values;
}
return $fields;
}
$return = ($hook = get_hook('fn_csrf_confirm_form_start')) ? eval($hook) : null;
if ($return != null) {
return;
}
// Setup breadcrumbs
$forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), $lang_common['Confirm action']);
$forum_page['form_action'] = get_current_url();
$forum_page['hidden_fields'] = array('csrf_token' => '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />', 'prev_url' => '<input type="hidden" name="prev_url" value="' . forum_htmlencode($forum_user['prev_url']) . '" />');
foreach ($_POST as $submitted_key => $submitted_val) {
if ($submitted_key != 'csrf_token' && $submitted_key != 'prev_url') {
$hidden_fields = _csrf_confirm_form($submitted_key, $submitted_val);
foreach ($hidden_fields as $field_key => $field_val) {
$forum_page['hidden_fields'][$field_key] = '<input type="hidden" name="' . forum_htmlencode($field_key) . '" value="' . forum_htmlencode($field_val) . '" />';
}
}
}
define('FORUM_PAGE', 'dialogue');
require FORUM_ROOT . 'header.php';
// START SUBST - <!-- forum_main -->
ob_start();
($hook = get_hook('fn_csrf_confirm_form_pre_header_load')) ? eval($hook) : null;
?>
<div id="brd-main" class="main">
<div class="main-head">
<h2 class="hn"><span><?php
echo $lang_common['Confirm action head'];
?>
</span></h2>
</div>
<div class="main-content main-frm">
<div class="ct-box info-box">
<p><?php
echo $lang_common['CSRF token mismatch'];
?>
</p>
</div>
<form class="frm-form" method="post" accept-charset="utf-8" action="<?php
echo forum_htmlencode($forum_page['form_action']);
?>
">
<div class="hidden">
<?php
echo implode("\n\t\t\t\t", $forum_page['hidden_fields']) . "\n";
?>
</div>
<div class="frm-buttons">
<span class="submit primary"><input type="submit" value="<?php
echo $lang_common['Confirm'];
?>
" /></span>
<span class="cancel"><input type="submit" name="confirm_cancel" value="<?php
echo $lang_common['Cancel'];
?>
" /></span>
</div>
</form>
</div>
</div>
<?php
($hook = get_hook('fn_csrf_confirm_form_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT . 'footer.php';
}
示例9: get_hook
</div>
<?php
($hook = get_hook('vt_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
// Display quick post if enabled
if ($forum_config['o_quickpost'] == '1' && !$forum_user['is_guest'] && ($cur_topic['post_replies'] == '1' || $cur_topic['post_replies'] == '' && $forum_user['g_post_replies'] == '1') && ($cur_topic['closed'] == '0' || $forum_page['is_admmod'])) {
// START SUBST - <!-- forum_qpost -->
ob_start();
($hook = get_hook('vt_qpost_output_start')) ? eval($hook) : null;
// Setup form
$forum_page['form_action'] = forum_link($forum_url['new_reply'], $id);
$forum_page['form_attributes'] = array();
$forum_page['hidden_fields'] = array('form_sent' => '<input type="hidden" name="form_sent" value="1" />', 'form_user' => '<input type="hidden" name="form_user" value="' . (!$forum_user['is_guest'] ? forum_htmlencode($forum_user['username']) : 'Guest') . '" />', 'csrf_token' => '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />');
if (!$forum_user['is_guest'] && $forum_config['o_subscriptions'] == '1' && ($forum_user['auto_notify'] == '1' || $cur_topic['is_subscribed'])) {
$forum_page['hidden_fields']['subscribe'] = '<input type="hidden" name="subscribe" value="1" />';
}
// Setup help
$forum_page['main_head_options'] = array();
if ($forum_config['p_message_bbcode'] == '1') {
$forum_page['text_options']['bbcode'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'bbcode') . '" title="' . sprintf($lang_common['Help page'], $lang_common['BBCode']) . '">' . $lang_common['BBCode'] . '</a></span>';
}
if ($forum_config['p_message_img_tag'] == '1') {
$forum_page['text_options']['img'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'img') . '" title="' . sprintf($lang_common['Help page'], $lang_common['Images']) . '">' . $lang_common['Images'] . '</a></span>';
}
if ($forum_config['o_smilies'] == '1') {
$forum_page['text_options']['smilies'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'smilies') . '" title="' . sprintf($lang_common['Help page'], $lang_common['Smilies']) . '">' . $lang_common['Smilies'] . '</a></span>';
}
($hook = get_hook('vt_quickpost_pre_display')) ? eval($hook) : null;
示例10: pun_pm_send_form
function pun_pm_send_form($username = '', $subject = '', $body = '', $message_id = false, $reply_form = false, $notice = false, $preview = false)
{
global $forum_config, $forum_url, $lang_common, $lang_pun_pm, $forum_user, $pun_pm_errors, $ext_info, $forum_head, $forum_loader;
// need JS
$forum_loader->add_js($ext_info['url'] . '/js/pun_pm.shortcut.min.js', array('type' => 'url', 'async' => true));
$username = forum_htmlencode($username);
$subject = forum_htmlencode($subject);
$body = forum_htmlencode($body);
// Setup the form
$forum_page['item_count'] = $forum_page['fld_count'] = 0;
$forum_page['form_action'] = forum_link($forum_url['pun_pm_send']);
$forum_page['hidden_fields']['csrf_token'] = '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />';
$forum_page['hidden_fields']['send_action'] = '<input type="hidden" name="send_action" value="" />';
if ($message_id !== false) {
// Edit message
$forum_page['hidden_fields']['message_id'] = '<input type="hidden" name="message_id" value="' . $message_id . '" />';
$forum_page['heading'] = $lang_pun_pm['Edit message'];
} elseif ($reply_form !== false) {
$forum_page['heading'] = $lang_pun_pm['Quick reply'];
$forum_page['hidden_fields']['pm_receiver'] = '<input type="hidden" name="pm_receiver" value="' . $username . '" />';
} else {
$forum_page['heading'] = $lang_pun_pm['New message'];
}
// Setup help
$forum_page['text_options'] = array();
if ($forum_config['p_message_bbcode'] == '1') {
$forum_page['text_options']['bbcode'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'bbcode') . '" title="' . sprintf($lang_common['Help page'], $lang_common['BBCode']) . '">' . $lang_common['BBCode'] . '</a></span>';
}
if ($forum_config['p_message_img_tag'] == '1') {
$forum_page['text_options']['img'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'img') . '" title="' . sprintf($lang_common['Help page'], $lang_common['Images']) . '">' . $lang_common['Images'] . '</a></span>';
}
if ($forum_config['o_smilies'] == '1') {
$forum_page['text_options']['smilies'] = '<span' . (empty($forum_page['text_options']) ? ' class="first-item"' : '') . '><a class="exthelp" href="' . forum_link($forum_url['help'], 'smilies') . '" title="' . sprintf($lang_common['Help page'], $lang_common['Smilies']) . '">' . $lang_common['Smilies'] . '</a></span>';
}
($hook = get_hook('pun_pm_fn_send_form_pre_output')) ? eval($hook) : null;
ob_start();
if ($preview !== false) {
echo $preview;
}
?>
<div class="main-subhead">
<h2 class="hn"><span><?php
echo $forum_page['heading'];
?>
</span></h2>
</div>
<div class="main-content main-frm">
<?php
if (!empty($forum_page['text_options'])) {
echo "\t\t" . '<p class="ct-options options">' . sprintf($lang_common['You may use'], implode(' ', $forum_page['text_options'])) . '</p>' . "\n";
}
if (!empty($pun_pm_errors)) {
$forum_page['errors'] = array();
foreach ($pun_pm_errors as $cur_error) {
$forum_page['errors'][] = '<li class="warn"><span>' . $cur_error . '</span></li>';
}
?>
<div class="ct-box error-box">
<h2 class="warn hn"><?php
echo $lang_pun_pm['Messsage send errors'];
?>
</h2>
<ul class="error-list">
<?php
echo implode("\n\t\t\t\t", $forum_page['errors']) . "\n";
?>
</ul>
</div>
<?php
}
?>
<form id="afocus" class="frm-form" name="pun_pm_sendform" method="post" accept-charset="utf-8" action="<?php
echo $forum_page['form_action'];
?>
">
<?php
if ($notice !== false) {
echo $notice;
}
?>
<div class="hidden">
<?php
echo implode("\n\t\t\t\t", $forum_page['hidden_fields']) . "\n";
?>
</div>
<fieldset class="frm-group group1">
<legend class="group-legend"><span><?php
echo $forum_page['heading'];
?>
</span></legend>
<?php
if ($reply_form === false) {
?>
<div class="sf-set set<?php
echo ++$forum_page['item_count'];
?>
">
<div class="sf-box text required">
<label for="fld<?php
echo ++$forum_page['fld_count'];
//.........这里部分代码省略.........
示例11: error
$forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_flash->add_info($lang_misc['Subscribe redirect']);
($hook = get_hook('mi_forum_subscribe_pre_redirect')) ? eval($hook) : null;
redirect(forum_link($forum_url['forum'], array($forum_id, sef_friendly($forum_name))), $lang_misc['Subscribe redirect']);
} else {
if (isset($_GET['forum_unsubscribe'])) {
if ($forum_user['is_guest'] || $forum_config['o_subscriptions'] != '1') {
message($lang_common['No permission']);
}
$forum_id = intval($_GET['forum_unsubscribe']);
if ($forum_id < 1) {
message($lang_common['Bad request']);
}
// We validate the CSRF token. If it's set in POST and we're at this point, the token is valid.
// If it's in GET, we need to make sure it's valid.
if (!isset($_POST['csrf_token']) && (!isset($_GET['csrf_token']) || $_GET['csrf_token'] !== generate_form_token('forum_unsubscribe' . $forum_id . $forum_user['id']))) {
csrf_confirm_form();
}
($hook = get_hook('mi_forum_unsubscribe_selected')) ? eval($hook) : null;
// Make sure the user can view the forum
$query = array('SELECT' => 'f.forum_name', 'FROM' => 'forums AS f', 'JOINS' => array(array('LEFT JOIN' => 'forum_perms AS fp', 'ON' => '(fp.forum_id=f.id AND fp.group_id=' . $forum_user['g_id'] . ')')), 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.id=' . $forum_id);
($hook = get_hook('mi_forum_unsubscribe_qr_check_subscribed')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_name = $forum_db->result($result);
if (!$forum_name) {
message($lang_misc['Not subscribed']);
}
$query = array('DELETE' => 'forum_subscriptions', 'WHERE' => 'user_id=' . $forum_user['id'] . ' AND forum_id=' . $forum_id);
($hook = get_hook('mi_unsubscribe_qr_delete_subscription')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_flash->add_info($lang_misc['Unsubscribe redirect']);
示例12: ob_start
ob_start();
?>
<div class="main-content main-frm">
<form class="frm-form" method="post" accept-charset="utf-8" action="<?php
echo forum_link($attach_url['admin_options_attach']);
?>
">
<div class="content-head">
<h2 class="hn"><span><?php
echo $lang_attach['Main options'];
?>
</span></h2>
</div>
<div class="hidden">
<input type="hidden" name="csrf_token" value="<?php
echo generate_form_token(forum_link($attach_url['admin_options_attach']));
?>
" />
<input type="hidden" name="form_sent" value="1" />
</div>
<fieldset class="frm-group group1">
<div class="sf-set set<?php
echo ++$forum_page['item_count'];
?>
">
<div class="sf-box checkbox">
<span class="fld-input"><input type="checkbox" id="fld<?php
echo ++$forum_page['fld_count'];
?>
" name="form[disable_attach]" value="1"<?php
if ($forum_config['attach_disable_attach']) {
示例13: array
}
}
// Setup main options
$forum_page['main_head_options'] = $forum_page['main_foot_options'] = array();
if (!empty($topics)) {
$forum_page['main_head_options']['feed'] = '<span class="feed first-item"><a class="feed" href="' . forum_link($forum_url['forum_rss'], $id) . '">' . $lang_forum['RSS forum feed'] . '</a></span>';
}
if (!$forum_user['is_guest'] && $forum_config['o_subscriptions'] == '1') {
if ($cur_forum['is_subscribed']) {
$forum_page['main_head_options']['unsubscribe'] = '<span><a class="sub-option" href="' . forum_link($forum_url['forum_unsubscribe'], array($id, generate_form_token('forum_unsubscribe' . $id . $forum_user['id']))) . '"><em>' . $lang_forum['Unsubscribe'] . '</em></a></span>';
} else {
$forum_page['main_head_options']['subscribe'] = '<span><a class="sub-option" href="' . forum_link($forum_url['forum_subscribe'], array($id, generate_form_token('forum_subscribe' . $id . $forum_user['id']))) . '" title="' . $lang_forum['Subscribe info'] . '">' . $lang_forum['Subscribe'] . '</a></span>';
}
}
if (!$forum_user['is_guest'] && !empty($topics)) {
$forum_page['main_foot_options']['mark_read'] = '<span class="first-item"><a href="' . forum_link($forum_url['mark_forum_read'], array($id, generate_form_token('markforumread' . $id . $forum_user['id']))) . '">' . $lang_forum['Mark forum read'] . '</a></span>';
if ($forum_page['is_admmod']) {
$forum_page['main_foot_options']['moderate'] = '<span' . (empty($forum_page['main_foot_options']) ? ' class="first-item"' : '') . '><a href="' . forum_sublink($forum_url['moderate_forum'], $forum_url['page'], $forum_page['page'], $id) . '">' . $lang_forum['Moderate forum'] . '</a></span>';
}
}
// Setup breadcrumbs
$forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), $cur_forum['forum_name']);
// Setup main header
$forum_page['main_title'] = '<a class="permalink" href="' . forum_link($forum_url['forum'], array($id, sef_friendly($cur_forum['forum_name']))) . '" rel="bookmark" title="' . $lang_forum['Permalink forum'] . '">' . forum_htmlencode($cur_forum['forum_name']) . '</a>';
if ($forum_page['num_pages'] > 1) {
$forum_page['main_head_pages'] = sprintf($lang_common['Page info'], $forum_page['page'], $forum_page['num_pages']);
}
($hook = get_hook('vf_pre_header_load')) ? eval($hook) : null;
define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'viewforum');
require FORUM_ROOT . 'header.php';
示例14: generate_form_token
}
if (isset($display_group_buttons) && $display_group_buttons && !empty($inst_exts)) {
?>
<div class="ct-box info-box">
<p><?php
echo $lang_pun_man_ext_improved['Ext note'];
?>
</p>
</div>
<div class="hidden">
<input type="hidden" name="csrf_token" value="<?php
echo generate_form_token($base_url . '/admin/extensions.php?section=manage&multy');
?>
"/>
</div>
<div class="frm-buttons">
<span class="submit"><input type="submit" name="disable_selected" value="<?php
echo $lang_pun_man_ext_improved['Button disable'];
?>
" /></span>
<span class="submit"><input type="submit" name="enable_selected" value="<?php
echo $lang_pun_man_ext_improved['Button enable'];
?>
" /></span>
<span class="submit"><input type="submit" name="uninstall_selected" value="<?php
echo $lang_pun_man_ext_improved['Button uninstall'];
?>
示例15: forum_link
</span></h2>
</div>
<div class="main-content main-frm">
<div class="ct-box">
<p><?php
echo $lang_admin_reindex['Reindex info'];
?>
</p>
</div>
<form class="frm-form" method="get" accept-charset="utf-8" action="<?php
echo forum_link($forum_url['admin_reindex']);
?>
">
<div class="hidden">
<input type="hidden" name="csrf_token" value="<?php
echo generate_form_token('reindex' . $forum_user['id']);
?>
" />
</div>
<?php
($hook = get_hook('ari_pre_rebuild_fieldset')) ? eval($hook) : null;
?>
<fieldset class="frm-group group<?php
echo ++$forum_page['group_count'];
?>
">
<legend class="group-legend"><span><?php
echo $lang_admin_reindex['Rebuild index legend'];
?>
</span></legend>
<?php