本文整理汇总了PHP中form_security_purge函数的典型用法代码示例。如果您正苦于以下问题:PHP form_security_purge函数的具体用法?PHP form_security_purge怎么用?PHP form_security_purge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_security_purge函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: require_api
* @uses config_api.php
* @uses constant_inc.php
* @uses form_api.php
* @uses gpc_api.php
* @uses helper_api.php
* @uses lang_api.php
* @uses print_api.php
* @uses project_api.php
*/
require_once 'core.php';
require_api('access_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
form_security_validate('adm_config_delete');
$f_user_id = gpc_get_int('user_id');
$f_project_id = gpc_get_int('project_id');
$f_config_option = gpc_get_string('config_option');
access_ensure_global_level(config_get('set_configuration_threshold'));
if ($f_project_id != ALL_PROJECTS) {
project_ensure_exists($f_project_id);
}
helper_ensure_confirmed(lang_get('delete_config_sure_msg'), lang_get('delete_link'));
config_delete($f_config_option, $f_user_id, $f_project_id);
form_security_purge('adm_config_delete');
print_successful_redirect('adm_config_report.php');
示例2: AND
# Delete the users who have never logged in and are older than 1 week
$days_old = (int)7 * SECONDS_PER_DAY;
$query = "SELECT id, access_level
FROM $t_user_table
WHERE ( login_count = 0 ) AND ( date_created = last_visit ) AND " . db_helper_compare_days( 0, "date_created", "> $days_old" );
$result = db_query_bound($query, Array( db_now() ) );
if ( !$result ) {
trigger_error( ERROR_GENERIC, ERROR );
}
$count = db_num_rows( $result );
if ( $count > 0 ) {
helper_ensure_confirmed( lang_get( 'confirm_account_pruning' ),
lang_get( 'prune_accounts_button' ) );
}
for ($i=0; $i < $count; $i++) {
$row = db_fetch_array( $result );
# Don't prune accounts with a higher global access level than the current user
if ( access_has_global_level( $row['access_level'] ) ) {
user_delete($row['id']);
}
}
form_security_purge( 'manage_user_prune' );
print_header_redirect( 'manage_user_page.php' );
示例3: define
* @uses print_api.php
*/
/** @ignore */
define('PLUGINS_DISABLED', true);
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('database_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
form_security_validate('manage_plugin_update');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$t_plugin_table = db_get_table('plugin');
$t_query = "SELECT basename FROM {$t_plugin_table}";
$t_result = db_query_bound($t_query);
while ($t_row = db_fetch_array($t_result)) {
$t_basename = $t_row['basename'];
$f_change = gpc_get_bool('change_' . $t_basename, 0);
if (!$f_change) {
continue;
}
$f_priority = gpc_get_int('priority_' . $t_basename, 3);
$f_protected = gpc_get_bool('protected_' . $t_basename, 0);
$t_query = "UPDATE {$t_plugin_table} SET priority=" . db_param() . ', protected=' . db_param() . ' WHERE basename=' . db_param();
db_query_bound($t_query, array($f_priority, $f_protected, $t_basename));
}
form_security_purge('manage_plugin_update');
print_successful_redirect('manage_plugin_page.php');
示例4: utf8_strtolower
}
if (ON == config_get('signup_use_captcha') && get_gd_version() > 0 && helper_call_custom_function('auth_can_change_password', array())) {
# captcha image requires GD library and related option to ON
$t_key = utf8_strtolower(utf8_substr(md5(config_get('password_confirm_hash_magic_string') . $t_form_key), 1, 5));
if ($t_key != $f_captcha) {
trigger_error(ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR);
}
# Clear captcha cache
session_delete(CAPTCHA_IMG);
}
email_ensure_not_disposable($f_email);
# notify the selected group a new user has signed-up
if (user_signup($f_username, $f_email)) {
email_notify_new_account($f_username, $f_email);
}
form_security_purge('signup');
html_page_top1();
html_page_top2a();
?>
<br />
<div align="center">
<table class="width50" cellspacing="1">
<tr>
<td class="center">
<b><?php
echo lang_get('signup_done_title');
?>
</b><br />
<?php
echo "[{$f_username} - {$f_email}] ";
示例5: form_security_validate
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
/**
* @package MantisBT
* @copyright Copyright (C) 2002 - 2013 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
/**
* requires tag_api
*/
require_once 'tag_api.php';
form_security_validate('tag_detach');
$f_tag_id = gpc_get_int('tag_id');
$f_bug_id = gpc_get_int('bug_id');
tag_bug_detach($f_tag_id, $f_bug_id);
event_signal('EVENT_TAG_DETACHED', array($f_bug_id, array($f_tag_id)));
form_security_purge('tag_detach');
print_successful_redirect_to_bug($f_bug_id);
示例6: config_get
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'custom_field_api.php';
form_security_validate('manage_custom_field_delete');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_custom_fields_threshold'));
$f_field_id = gpc_get_int('field_id');
$f_return = strip_tags(gpc_get_string('return', 'manage_custom_field_page.php'));
$t_definition = custom_field_get_definition($f_field_id);
if (0 < count(custom_field_get_project_ids($f_field_id))) {
helper_ensure_confirmed(lang_get('confirm_used_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
} else {
helper_ensure_confirmed(lang_get('confirm_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
}
custom_field_destroy($f_field_id);
form_security_purge('manage_custom_field_delete');
html_page_top1();
html_meta_redirect($f_return);
html_page_top2();
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link($f_return, lang_get('proceed'));
?>
</div>
<?php
html_page_bottom1(__FILE__);
示例7: news_ensure_enabled
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
require_once 'news_api.php';
require_once 'print_api.php';
news_ensure_enabled();
form_security_validate('news_add');
access_ensure_project_level(config_get('manage_news_threshold'));
$f_view_state = gpc_get_int('view_state');
$f_headline = gpc_get_string('headline');
$f_announcement = gpc_get_bool('announcement');
$f_body = gpc_get_string('body');
$t_news_id = news_create(helper_get_current_project(), auth_get_current_user_id(), $f_view_state, $f_announcement, $f_headline, $f_body);
form_security_purge('news_add');
$t_news_row = news_get_row($t_news_id);
html_page_top();
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link('news_menu_page.php', lang_get('proceed'));
echo '<br /><br />';
print_news_entry_from_row($t_news_row);
?>
</div>
<?php
示例8: require_api
* @uses print_api.php
* @uses project_api.php
*/
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
form_security_validate('manage_user_proj_delete');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_user_id = gpc_get_int('user_id');
user_ensure_exists($f_user_id);
$t_user = user_get_row($f_user_id);
access_ensure_project_level(config_get('project_user_threshold'), $f_project_id);
access_ensure_project_level($t_user['access_level'], $f_project_id);
$t_project_name = project_get_name($f_project_id);
# Confirm with the user
helper_ensure_confirmed(lang_get('remove_user_sure_msg') . '<br/>' . lang_get('project_name_label') . lang_get('word_separator') . $t_project_name, lang_get('remove_user_button'));
project_remove_user($f_project_id, $f_user_id);
form_security_purge('manage_user_proj_delete');
$t_redirect_url = 'manage_user_edit_page.php?user_id=' . $f_user_id;
html_page_top(null, $t_redirect_url);
html_operation_successful($t_redirect_url);
html_page_bottom();
示例9: auth_reauthenticate
auth_reauthenticate();
$f_project_id = gpc_get_int( 'project_id' );
$f_other_project_id = gpc_get_int( 'other_project_id' );
$f_copy_from = gpc_get_bool( 'copy_from' );
$f_copy_to = gpc_get_bool( 'copy_to' );
if ( $f_copy_from ) {
$t_src_project_id = $f_other_project_id;
$t_dst_project_id = $f_project_id;
} else if ( $f_copy_to ) {
$t_src_project_id = $f_project_id;
$t_dst_project_id = $f_other_project_id;
} else {
/** @todo Should this become a separate error? */
trigger_error( ERROR_CATEGORY_NO_ACTION, ERROR );
}
# We should check both since we are in the project section and an
# admin might raise the first threshold and not realize they need
# to raise the second
access_ensure_project_level( config_get( 'manage_project_threshold' ), $t_dst_project_id );
access_ensure_project_level( config_get( 'project_user_threshold' ), $t_dst_project_id );
project_copy_users( $t_dst_project_id, $t_src_project_id, access_get_project_level( $t_dst_project_id ) );
form_security_purge( 'manage_proj_user_copy' );
print_header_redirect( 'manage_proj_edit_page.php?project_id=' . $f_project_id );
示例10: require_api
require_api('error_api.php');
require_api('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('string_api.php');
form_security_validate('bugnote_update');
$f_bugnote_id = gpc_get_int('bugnote_id');
$f_bugnote_text = gpc_get_string('bugnote_text', '');
$f_time_tracking = gpc_get_string('time_tracking', '0:00');
# Check if the current user is allowed to edit the bugnote
$t_user_id = auth_get_current_user_id();
$t_reporter_id = bugnote_get_field($f_bugnote_id, 'reporter_id');
if ($t_user_id == $t_reporter_id) {
access_ensure_bugnote_level(config_get('bugnote_user_edit_threshold'), $f_bugnote_id);
} else {
access_ensure_bugnote_level(config_get('update_bugnote_threshold'), $f_bugnote_id);
}
# Check if the bug is readonly
$t_bug_id = bugnote_get_field($f_bugnote_id, 'bug_id');
if (bug_is_readonly($t_bug_id)) {
error_parameters($t_bug_id);
trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
$f_bugnote_text = trim($f_bugnote_text) . "\n\n";
bugnote_set_text($f_bugnote_id, $f_bugnote_text);
bugnote_set_time_tracking($f_bugnote_id, $f_time_tracking);
# Plugin integration
event_signal('EVENT_BUGNOTE_EDIT', array($t_bug_id, $f_bugnote_id));
form_security_purge('bugnote_update');
print_successful_redirect(string_get_bug_view_url($t_bug_id) . '#bugnotes');
示例11: implode
}
# get user id
$t_user_id = $f_user_id;
$c_export = implode('',$t_prefs_arr);
# update preferences
$t_user_print_pref_table = db_get_table( 'user_print_pref' );
$query = "UPDATE $t_user_print_pref_table
SET print_pref=" . db_param() . "
WHERE user_id=" . db_param();
$result = db_query_bound( $query, Array( $c_export, $t_user_id ) );
form_security_purge( 'print_all_bug_options_update' );
html_page_top( null, $f_redirect_url );
echo '<br /><div>';
if ( $result ) {
print lang_get( 'operation_successful' );
} else {
print error_string( ERROR_GENERIC );
}
echo '<br />';
print_bracket_link( $f_redirect_url, lang_get( 'proceed' ) );
echo '<br /></div>';
html_page_bottom();
示例12: file_copy_attachments
if ($f_copy_attachments_from_parent) {
file_copy_attachments($f_master_bug_id, $t_bug_id);
}
}
helper_call_custom_function('issue_create_notify', array($t_bug_id));
# Allow plugins to post-process bug data with the new bug ID
event_signal('EVENT_REPORT_BUG', array($t_bug_data, $t_bug_id));
email_new_bug($t_bug_id);
// log status and resolution changes if they differ from the default
if ($t_bug_data->status != config_get('bug_submit_status')) {
history_log_event($t_bug_id, 'status', config_get('bug_submit_status'));
}
if ($t_bug_data->resolution != config_get('default_bug_resolution')) {
history_log_event($t_bug_id, 'resolution', config_get('default_bug_resolution'));
}
form_security_purge('bug_report');
html_page_top1();
if (!$f_report_stay) {
html_meta_redirect('view_all_bug_page.php');
}
html_page_top2();
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link(string_get_bug_view_url($t_bug_id), sprintf(lang_get('view_submitted_bug_link'), $t_bug_id));
print_bracket_link('view_all_bug_page.php', lang_get('view_bugs_link'));
if ($f_report_stay) {
?>
<p>
示例13: require_api
require_api('form_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
form_security_validate('query_delete');
auth_ensure_user_authenticated();
compress_enable();
$f_query_id = gpc_get_int('source_query_id');
$t_redirect_url = 'query_view_page.php';
if (!filter_db_can_delete_filter($f_query_id)) {
print_header_redirect($t_redirect_url);
} else {
html_page_top();
filter_db_delete_filter($f_query_id);
form_security_purge('query_delete');
?>
<br />
<div class="center">
<strong><?php
print filter_db_get_name($f_query_id) . ' ' . lang_get('query_deleted');
?>
</strong>
<form method="post" action="<?php
print $t_redirect_url;
?>
">
<?php
# CSRF protection not required here - form does not result in modifications
?>
<input type="submit" class="button" value="<?php
示例14: gpc_get_int
$f_user_id = gpc_get_int('user_id');
user_ensure_exists($f_user_id);
$t_user = user_get_row($f_user_id);
# Ensure that the account to be reset is of equal or lower access to the
# current user.
access_ensure_global_level($t_user['access_level']);
# If the password can be changed, we reset it, otherwise we unlock
# the account (i.e. reset failed login count)
$t_reset = helper_call_custom_function('auth_can_change_password', array());
if ($t_reset) {
$t_result = user_reset_password($f_user_id);
} else {
$t_result = user_reset_failed_login_count_to_zero($f_user_id);
}
$t_redirect_url = 'manage_user_page.php';
form_security_purge('manage_user_reset');
html_page_top(null, $t_result ? $t_redirect_url : null);
echo '<div class="success-msg">';
if ($t_reset) {
if (false == $t_result) {
# PROTECTED
echo lang_get('account_reset_protected_msg');
} else {
# SUCCESSFUL RESET
if (ON == config_get('send_reset_password') && ON == config_get('enable_email_notification')) {
# send the new random password via email
echo lang_get('account_reset_msg');
} else {
# email notification disabled, then set the password to blank
echo lang_get('account_reset_msg2');
}
示例15: form_security_validate
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
require_once 'custom_field_api.php';
form_security_validate('manage_proj_custom_field_add_existing');
auth_reauthenticate();
$f_field_id = gpc_get_int('field_id');
$f_project_id = gpc_get_int('project_id');
# We should check both since we are in the project section and an
# admin might raise the first threshold and not realize they need
# to raise the second
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
access_ensure_project_level(config_get('custom_field_link_threshold'), $f_project_id);
custom_field_link($f_field_id, $f_project_id);
form_security_purge('manage_proj_custom_field_add_existing');
$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
html_page_top(null, $t_redirect_url);
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link($t_redirect_url, lang_get('proceed'));
?>
</div>
<?php
html_page_bottom();