本文整理汇总了PHP中gpc_get_bool函数的典型用法代码示例。如果您正苦于以下问题:PHP gpc_get_bool函数的具体用法?PHP gpc_get_bool怎么用?PHP gpc_get_bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gpc_get_bool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_config_value
/**
* Ensures the given config is valid
* @param string $p_config Configuration name
* @return string|integer Config name if valid, or META_FILTER_NONE of not
*/
function check_config_value($p_config)
{
if ($p_config != META_FILTER_NONE && !is_blank($p_config) && is_null(@config_get($p_config))) {
return META_FILTER_NONE;
}
return $p_config;
}
# Get filter values
$t_filter_save = gpc_get_bool('save');
$t_filter_default = gpc_get_bool('default_filter_button', false);
$t_filter_reset = gpc_get_bool('reset_filter_button', false);
if ($t_filter_default) {
$t_filter_user_value = ALL_USERS;
$t_filter_project_value = ALL_PROJECTS;
$t_filter_config_value = META_FILTER_NONE;
} else {
if ($t_filter_reset) {
$t_filter_user_value = META_FILTER_NONE;
$t_filter_project_value = META_FILTER_NONE;
$t_filter_config_value = META_FILTER_NONE;
} else {
$t_filter_user_value = gpc_get_int('filter_user_id', ALL_USERS);
$t_filter_project_value = gpc_get_int('filter_project_id', ALL_PROJECTS);
$t_filter_config_value = check_config_value(gpc_get_string('filter_config_id', META_FILTER_NONE));
}
}
示例2: gpc_get_int
$f_severity = gpc_get_int('severity', (int) config_get('default_bug_severity'));
$f_priority = gpc_get_int('priority', (int) config_get('default_bug_priority'));
$f_summary = gpc_get_string('summary', '');
$f_description = gpc_get_string('description', '');
$f_steps_to_reproduce = gpc_get_string('steps_to_reproduce', config_get('default_bug_steps_to_reproduce'));
$f_additional_info = gpc_get_string('additional_info', config_get('default_bug_additional_info'));
$f_view_state = gpc_get_int('view_state', (int) config_get('default_bug_view_status'));
$f_due_date = gpc_get_string('due_date', '');
if ($f_due_date == '') {
$f_due_date = date_get_null();
}
$t_changed_project = false;
}
$f_report_stay = gpc_get_bool('report_stay', false);
$f_copy_notes_from_parent = gpc_get_bool('copy_notes_from_parent', false);
$f_copy_attachments_from_parent = gpc_get_bool('copy_attachments_from_parent', false);
$t_fields = config_get('bug_report_page_fields');
$t_fields = columns_filter_disabled($t_fields);
$t_show_category = in_array('category_id', $t_fields);
$t_show_reproducibility = in_array('reproducibility', $t_fields);
$t_show_eta = in_array('eta', $t_fields);
$t_show_severity = in_array('severity', $t_fields);
$t_show_priority = in_array('priority', $t_fields);
$t_show_steps_to_reproduce = in_array('steps_to_reproduce', $t_fields);
$t_show_handler = in_array('handler', $t_fields) && access_has_project_level(config_get('update_bug_assign_threshold'));
$t_show_profiles = config_get('enable_profiles');
$t_show_platform = $t_show_profiles && in_array('platform', $t_fields);
$t_show_os = $t_show_profiles && in_array('os', $t_fields);
$t_show_os_version = $t_show_profiles && in_array('os_version', $t_fields);
$t_show_resolution = in_array('resolution', $t_fields);
$t_show_status = in_array('status', $t_fields);
示例3: require_api
require_api('access_api.php');
require_api('authentication_api.php');
require_api('columns_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
form_security_validate('manage_columns_copy');
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');
$f_manage_page = gpc_get_bool('manage_page');
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 {
trigger_error(ERROR_GENERIC, ERROR);
}
}
# only admins can set global defaults.for ALL_PROJECT
if ($f_manage_page && $t_dst_project_id == ALL_PROJECTS && !current_user_is_administrator()) {
access_denied();
}
示例4: news_ensure_enabled
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @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';
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);
?>
示例5: require_api
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
form_security_validate('manage_custom_field_update');
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_values['name'] = gpc_get_string('name');
$t_values['type'] = gpc_get_int('type');
$t_values['possible_values'] = gpc_get_string('possible_values');
$t_values['default_value'] = gpc_get_string('default_value');
$t_values['valid_regexp'] = gpc_get_string('valid_regexp');
$t_values['access_level_r'] = gpc_get_int('access_level_r');
$t_values['access_level_rw'] = gpc_get_int('access_level_rw');
$t_values['length_min'] = gpc_get_int('length_min');
$t_values['length_max'] = gpc_get_int('length_max');
$t_values['display_report'] = gpc_get_bool('display_report');
$t_values['display_update'] = gpc_get_bool('display_update');
$t_values['display_resolved'] = gpc_get_bool('display_resolved');
$t_values['display_closed'] = gpc_get_bool('display_closed');
$t_values['require_report'] = gpc_get_bool('require_report');
$t_values['require_update'] = gpc_get_bool('require_update');
$t_values['require_resolved'] = gpc_get_bool('require_resolved');
$t_values['require_closed'] = gpc_get_bool('require_closed');
$t_values['filter_by'] = gpc_get_bool('filter_by');
custom_field_update($f_field_id, $t_values);
form_security_purge('manage_custom_field_update');
html_page_top(null, $f_return);
html_operation_successful($f_return);
html_page_bottom();
示例6: access_ensure_project_level
$t_project_id = $t_bug->project_id;
} else {
access_ensure_project_level(config_get('report_bug_threshold'));
$f_product_version = gpc_get_string('product_version', '');
$f_category = gpc_get_string('category', config_get('default_bug_category'));
$f_reproducibility = gpc_get_int('reproducibility', config_get('default_bug_reproducibility'));
$f_severity = gpc_get_int('severity', config_get('default_bug_severity'));
$f_priority = gpc_get_int('priority', config_get('default_bug_priority'));
$f_summary = gpc_get_string('summary', '');
$f_description = gpc_get_string('description', '');
$f_additional_info = gpc_get_string('additional_info', config_get('default_bug_additional_info'));
$f_view_state = gpc_get_int('view_state', config_get('default_bug_view_status'));
$t_project_id = helper_get_current_project();
$t_changed_project = false;
}
$f_report_stay = gpc_get_bool('report_stay', false);
html_page_top1(lang_get('report_bug_link'));
html_page_top2();
print_recently_visited();
?>
<br />
<div align="center">
<form name="report_bug_form" method="post" <?php
if (file_allow_bug_upload()) {
echo 'enctype="multipart/form-data"';
}
?>
action="bug_report.php">
<table class="width75" cellspacing="1">
示例7: helper_ensure_confirmed
function helper_ensure_confirmed($p_message, $p_button_label)
{
if (true == gpc_get_bool('_confirmed')) {
return true;
}
html_page_top1();
html_page_top2();
# @@@ we need to improve this formatting. I'd like the text to only
# be about 50% the width of the screen so that it doesn't become to hard
# to read.
print "<br />\n<div align=\"center\">\n";
print_hr();
print "\n{$p_message}\n";
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . "\">\n";
print_hidden_inputs(gpc_strip_slashes($_POST));
print_hidden_inputs(gpc_strip_slashes($_GET));
print "<input type=\"hidden\" name=\"_confirmed\" value=\"1\" />\n";
print '<br /><br /><input type="submit" class="button" value="' . $p_button_label . '" />';
print "\n</form>\n";
print_hr();
print "</div>\n";
html_page_bottom1();
exit;
}
示例8: plugin_require_api
require_once 'core.php';
plugin_require_api('core/Period.php');
require_api('access_api.php');
require_api('config_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('plugin_api.php');
require_js('jscalendar/calendar.js');
require_js('jscalendar/lang/calendar-en.js');
require_js('jscalendar/calendar-setup.js');
require_css('calendar-blue.css');
access_ensure_project_level(config_get('view_summary_threshold'));
$f_interval = gpc_get_int('interval', 0);
$t_today = date('Y-m-d');
$f_type = gpc_get_int('graph_type', 0);
$f_show_as_table = gpc_get_bool('show_table', false);
html_page_top1(plugin_lang_get('graph_page'));
$t_path = config_get('path');
html_page_top2();
$t_period = new Period();
$t_period->set_period_from_selector('interval');
$t_types = array(0 => plugin_lang_get('select'), 2 => plugin_lang_get('select_bystatus'), 3 => plugin_lang_get('select_summbystatus'), 4 => plugin_lang_get('select_bycat'), 6 => plugin_lang_get('select_both'));
$t_show = array(0 => plugin_lang_get('show_as_graph'), 1 => plugin_lang_get('show_as_table'));
?>
<form name="graph_form" method="post" action="<?php
echo plugin_page('bug_graph_page.php');
?>
">
<table class="width100" cellspacing="1">
<tr>
示例9: config_get_global
if (false == $result) {
echo "Opening connection to database " . config_get_global('database_name') . " on host " . config_get_global('hostname') . " with username " . config_get_global('db_username') . " failed: " . db_error_msg() . "\n";
exit(1);
}
# check to see if the new installer was used
if (-1 == config_get('database_version', -1)) {
echo "Upgrade from the current installed MantisBT version is no longer supported. If you are using MantisBT version older than 1.0.0, then upgrade to v1.0.0 first.";
exit(1);
}
# read control variables with defaults
$f_hostname = gpc_get('hostname', config_get('hostname', 'localhost'));
$f_db_type = gpc_get('db_type', config_get('db_type', ''));
$f_database_name = gpc_get('database_name', config_get('database_name', 'bugtrack'));
$f_db_username = gpc_get('db_username', config_get('db_username', ''));
$f_db_password = gpc_get('db_password', config_get('db_password', ''));
$f_db_exists = gpc_get_bool('db_exists', false);
# install the tables
if (!preg_match('/^[a-zA-Z0-9_]+$/', $f_db_type) || !file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'adodb' . DIRECTORY_SEPARATOR . 'drivers' . DIRECTORY_SEPARATOR . 'adodb-' . $f_db_type . '.inc.php')) {
echo 'Invalid db type ' . htmlspecialchars($f_db_type) . '.';
exit;
}
$GLOBALS['g_db_type'] = $f_db_type;
# database_api references this
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'schema.php';
$g_db = ADONewConnection($f_db_type);
echo "\nPost 1.0 schema changes\n";
echo "Connecting to database... ";
$t_result = @$g_db->Connect($f_hostname, $f_db_username, $f_db_password, $f_database_name);
if (false == $t_result) {
echo "failed\n";
exit(1);
示例10: gpc_get_string_array
$my_filter[FILTER_PROPERTY_VIEW_STATE_ID] = gpc_get_string_array(FILTER_SEARCH_VIEW_STATE_ID, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_PRODUCT_VERSION] = gpc_get_string_array(FILTER_SEARCH_PRODUCT_VERSION, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_MATCH_TYPE] = gpc_get_int(FILTER_SEARCH_MATCH_TYPE, FILTER_MATCH_ALL);
// Filtering by Date
$my_filter[FILTER_PROPERTY_FILTER_BY_DATE] = gpc_get_bool(FILTER_SEARCH_FILTER_BY_DATE);
$my_filter[FILTER_PROPERTY_START_MONTH] = gpc_get_int(FILTER_SEARCH_START_MONTH, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_START_DAY] = gpc_get_int(FILTER_SEARCH_START_DAY, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_START_YEAR] = gpc_get_int(FILTER_SEARCH_START_YEAR, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_MONTH] = gpc_get_int(FILTER_SEARCH_END_MONTH, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_DAY] = gpc_get_int(FILTER_SEARCH_END_DAY, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_YEAR] = gpc_get_int(FILTER_SEARCH_END_YEAR, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_NOT_ASSIGNED] = gpc_get_bool(FILTER_SEARCH_NOT_ASSIGNED);
$my_filter[FILTER_PROPERTY_RELATIONSHIP_TYPE] = gpc_get_int(FILTER_SEARCH_RELATIONSHIP_TYPE, -1);
$my_filter[FILTER_PROPERTY_RELATIONSHIP_BUG] = gpc_get_int(FILTER_SEARCH_RELATIONSHIP_BUG, 0);
$my_filter[FILTER_PROPERTY_HIDE_STATUS_ID] = gpc_get_int(FILTER_SEARCH_HIDE_STATUS_ID, config_get('hide_status_default'));
$my_filter[FILTER_PROPERTY_SHOW_STICKY_ISSUES] = gpc_get_bool(FILTER_SEARCH_SHOW_STICKY_ISSUES, config_get('show_sticky_issues'));
$my_filter[FILTER_PROPERTY_SORT_FIELD_NAME] = gpc_get_string(FILTER_SEARCH_SORT_FIELD_NAME, '');
$my_filter[FILTER_PROPERTY_SORT_DIRECTION] = gpc_get_string(FILTER_SEARCH_SORT_DIRECTION, '');
$my_filter[FILTER_PROPERTY_ISSUES_PER_PAGE] = gpc_get_int(FILTER_SEARCH_ISSUES_PER_PAGE, config_get('default_limit_view'));
$t_highlight_changed = gpc_get_int(FILTER_SEARCH_HIGHLIGHT_CHANGED, -1);
if ($t_highlight_changed != -1) {
$my_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] = $t_highlight_changed;
}
# Handle custom fields.
$t_custom_fields = array();
foreach ($_GET as $t_var_name => $t_var_value) {
if (strpos($t_var_name, 'custom_field_') === 0) {
$t_custom_field_id = utf8_substr($t_var_name, 13);
$t_custom_fields[$t_custom_field_id] = $t_var_value;
}
}
示例11: config_get
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: bug_view_advanced_page.php,v 1.87.2.1 2007-10-13 22:32:59 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'bug_api.php';
require_once $t_core_path . 'custom_field_api.php';
require_once $t_core_path . 'file_api.php';
require_once $t_core_path . 'compress_api.php';
require_once $t_core_path . 'date_api.php';
require_once $t_core_path . 'relationship_api.php';
require_once $t_core_path . 'last_visited_api.php';
require_once $t_core_path . 'tag_api.php';
$f_bug_id = gpc_get_int('bug_id');
$f_history = gpc_get_bool('history', config_get('history_default_visible'));
bug_ensure_exists($f_bug_id);
access_ensure_bug_level(VIEWER, $f_bug_id);
$t_bug = bug_prepare_display(bug_get($f_bug_id, true));
if ($t_bug->project_id != helper_get_current_project()) {
# in case the current project is not the same project of the bug we are viewing...
# ... override the current project. This to avoid problems with categories and handlers lists etc.
$g_project_override = $t_bug->project_id;
}
if (SIMPLE_ONLY == config_get('show_view')) {
print_header_redirect('bug_view_page.php?bug_id=' . $f_bug_id);
}
compress_enable();
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_page_top2();
print_recently_visited();
示例12: require_api
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('project_hierarchy_api.php');
form_security_validate('manage_proj_create');
auth_reauthenticate();
access_ensure_global_level(config_get('create_project_threshold'));
$f_name = gpc_get_string('name');
$f_description = gpc_get_string('description');
$f_view_state = gpc_get_int('view_state');
$f_status = gpc_get_int('status');
$f_file_path = gpc_get_string('file_path', '');
$f_inherit_global = gpc_get_bool('inherit_global', 0);
$f_inherit_parent = gpc_get_bool('inherit_parent', 0);
$f_parent_id = gpc_get_int('parent_id', 0);
if (0 != $f_parent_id) {
project_ensure_exists($f_parent_id);
}
$t_project_id = project_create(strip_tags($f_name), $f_description, $f_status, $f_view_state, $f_file_path, true, $f_inherit_global);
if ($f_view_state == VS_PRIVATE && false === current_user_is_administrator()) {
$t_access_level = access_get_global_level();
$t_current_user_id = auth_get_current_user_id();
project_add_user($t_project_id, $t_current_user_id, $t_access_level);
}
if (0 != $f_parent_id) {
project_hierarchy_add($t_project_id, $f_parent_id, $f_inherit_parent);
}
event_signal('EVENT_MANAGE_PROJECT_CREATE', array($t_project_id));
form_security_purge('manage_proj_create');
示例13: config_get
# 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/>.
$t_plugin_path = config_get('plugin_path');
require_once $t_plugin_path . 'XmlImportExport' . DIRECTORY_SEPARATOR . 'ImportXml.php';
form_security_validate('plugin_xml_import_action');
auth_reauthenticate();
//var_dump( $_POST );
$f_file = gpc_get_file('file', -1);
$f_strategy = gpc_get_string('strategy');
$f_fallback = gpc_get_string('fallback');
$f_project = gpc_get_int('project_id');
// not used, but ensures a project is selected
$f_keepcategory = gpc_get_bool('keepcategory');
$f_defaultcategory = gpc_get_int('defaultcategory');
file_ensure_uploaded($f_file);
$importer = new ImportXML($f_file, $f_strategy, $f_fallback, $f_keepcategory, $f_defaultcategory);
form_security_purge('plugin_xml_import_action');
html_page_top(plugin_lang_get('import'));
print_manage_menu('manage_import_issues_page.php');
echo "<pre>\n";
$importer->import();
echo "</pre>\n";
html_page_bottom();
示例14: Copyright
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2004 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: manage_user_update.php,v 1.37.12.1 2007/03/06 07:00:33 vboctor Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'email_api.php';
access_ensure_global_level(config_get('manage_user_threshold'));
$f_protected = gpc_get_bool('protected');
$f_enabled = gpc_get_bool('enabled');
$f_email = gpc_get_string('email', '');
$f_username = gpc_get_string('username', '');
$f_realname = gpc_get_string('realname', '');
$f_access_level = gpc_get_int('access_level');
$f_user_id = gpc_get_int('user_id');
$f_email = trim($f_email);
$f_username = trim($f_username);
$t_old_username = user_get_field($f_user_id, 'username');
# check that the username is unique
if (0 != strcasecmp($t_old_username, $f_username) && false == user_is_name_unique($f_username)) {
trigger_error(ERROR_USER_NAME_NOT_UNIQUE, ERROR);
}
user_ensure_name_valid($f_username);
user_ensure_realname_valid($f_realname);
user_ensure_realname_unique($f_username, $f_realname);
示例15: config_get
# 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 Mantis. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: manage_proj_ver_add.php,v 1.31.2.1 2007-10-13 22:33:45 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'version_api.php';
form_security_validate('manage_proj_ver_add');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_version = gpc_get_string('version');
$f_add_and_edit = gpc_get_bool('add_and_edit_version');
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
if (is_blank($f_version)) {
trigger_error(ERROR_EMPTY_FIELD, ERROR);
}
# We reverse the array so that if the user enters multiple versions
# they will likely appear with the last item entered at the top of the list
# (i.e. in reverse chronological order). Unless we find a way to make the
# date_order fields different for each one, however, this is fragile, since
# the DB may actually pull the rows out in any order
$t_versions = array_reverse(explode('|', $f_version));
$t_version_count = count($t_versions);
foreach ($t_versions as $t_version) {
if (is_blank($t_version)) {
continue;
}