本文整理汇总了PHP中gpc_get_string函数的典型用法代码示例。如果您正苦于以下问题:PHP gpc_get_string函数的具体用法?PHP gpc_get_string怎么用?PHP gpc_get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gpc_get_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_attach_tags_validate
/**
* Validates the Attach Tags group action.
* Gets called for every bug, but performs the real tag validation only
* the first time. Any invalid tags will be skipped, as there is no simple
* or clean method of presenting these errors to the user.
* @param integer Bug ID
* @return boolean True
*/
function action_attach_tags_validate($p_bug_id)
{
global $g_action_attach_tags_valid;
if (!isset($g_action_attach_tags_valid)) {
$f_tag_string = gpc_get_string('tag_string');
$f_tag_select = gpc_get_string('tag_select');
global $g_action_attach_tags_attach, $g_action_attach_tags_create, $g_action_attach_tags_failed;
$g_action_attach_tags_attach = array();
$g_action_attach_tags_create = array();
$g_action_attach_tags_failed = array();
$t_tags = tag_parse_string($f_tag_string);
$t_can_create = access_has_global_level(config_get('tag_create_threshold'));
foreach ($t_tags as $t_tag_row) {
if (-1 == $t_tag_row['id']) {
if ($t_can_create) {
$g_action_attach_tags_create[] = $t_tag_row;
} else {
$g_action_attach_tags_failed[] = $t_tag_row;
}
} elseif (-2 == $t_tag_row['id']) {
$g_action_attach_tags_failed[] = $t_tag_row;
} else {
$g_action_attach_tags_attach[] = $t_tag_row;
}
}
if (0 < $f_tag_select && tag_exists($f_tag_select)) {
$g_action_attach_tags_attach[] = tag_get($f_tag_select);
}
}
global $g_action_attach_tags_attach, $g_action_attach_tags_create, $g_action_attach_tags_failed;
return true;
}
示例2: action_attach_tags_validate
/**
* Validates the Attach Tags group action.
* Checks if a user can attach the requested tags to a given bug.
* @param integer $p_bug_id Bug ID
* @return string|null On failure: the reason for tags failing validation for the given bug. On success: null.
*/
function action_attach_tags_validate($p_bug_id)
{
global $g_action_attach_tags_tags;
global $g_action_attach_tags_attach;
global $g_action_attach_tags_create;
$t_can_attach = access_has_bug_level(config_get('tag_attach_threshold'), $p_bug_id);
if (!$t_can_attach) {
return lang_get('tag_attach_denied');
}
if (!isset($g_action_attach_tags_tags)) {
if (!isset($g_action_attach_tags_attach)) {
$g_action_attach_tags_attach = array();
$g_action_attach_tags_create = array();
}
$g_action_attach_tags_tags = tag_parse_string(gpc_get_string('tag_string'));
foreach ($g_action_attach_tags_tags as $t_tag_row) {
if ($t_tag_row['id'] == -1) {
$g_action_attach_tags_create[$t_tag_row['name']] = $t_tag_row;
} else {
if ($t_tag_row['id'] >= 0) {
$g_action_attach_tags_attach[$t_tag_row['name']] = $t_tag_row;
}
}
}
}
$t_can_create = access_has_bug_level(config_get('tag_create_threshold'), $p_bug_id);
if (count($g_action_attach_tags_create) > 0 && !$t_can_create) {
return lang_get('tag_create_denied');
}
if (count($g_action_attach_tags_create) == 0 && count($g_action_attach_tags_attach) == 0) {
return lang_get('tag_none_attached');
}
return null;
}
示例3: xmlhttprequest_os_build_get_with_prefix
function xmlhttprequest_os_build_get_with_prefix()
{
$f_os_build = gpc_get_string('os_build');
$t_unique_entries = profile_get_field_all_for_user('os_build');
$t_matching_entries = projax_array_filter_by_prefix($t_unique_entries, $f_os_build);
echo projax_array_serialize_for_autocomplete($t_matching_entries);
}
示例4: action_update_product_build_process
/**
* Executes the custom action on the specified bug id.
*
* @param $p_bug_id The bug id to execute the custom action on.
* @returns true|array Action executed successfully., ( bug_id => reason for failure )
*/
function action_update_product_build_process($p_bug_id)
{
$f_build = gpc_get_string('build');
$t_build = trim($f_build);
bug_set_field($p_bug_id, 'build', $t_build);
return true;
}
示例5: updateValue
/**
* Updates a value in the plugin configuration
*
* @param $value
* @param $constant
*/
public function updateValue($value, $constant)
{
$act_value = null;
if (is_int($value)) {
$act_value = gpc_get_int($value, $constant);
}
if (is_string($value)) {
$act_value = gpc_get_string($value, $constant);
}
if (plugin_config_get($value) != $act_value) {
plugin_config_set($value, $act_value);
}
}
示例6: auth_ensure_user_authenticated
* @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
require_once 'current_user_api.php';
require_once 'bug_api.php';
require_once 'date_api.php';
require_once 'icon_api.php';
require_once 'string_api.php';
require_once 'columns_api.php';
require_once 'config_filter_defaults_inc.php';
auth_ensure_user_authenticated();
$f_search = gpc_get_string(FILTER_PROPERTY_FREE_TEXT, false);
/** @todo need a better default */
$f_offset = gpc_get_int('offset', 0);
$t_cookie_value_id = gpc_get_cookie(config_get('view_all_cookie'), '');
$t_cookie_value = filter_db_get_filter($t_cookie_value_id);
$f_highlight_changed = 0;
$f_sort = null;
$f_dir = null;
$t_project_id = 0;
$t_columns = helper_get_columns_to_view(COLUMNS_TARGET_PRINT_PAGE);
$t_num_of_columns = count($t_columns);
# check to see if the cookie exists
if (!is_blank($t_cookie_value)) {
# check to see if new cookie is needed
if (!filter_is_cookie_valid()) {
print_header_redirect('view_all_set.php?type=0&print=1');
示例7: access_ensure_global_level
} else {
access_ensure_global_level(config_get('add_profile_threshold'));
}
profile_create($t_user_id, $f_platform, $f_os, $f_os_build, $f_description);
form_security_purge('profile_update');
if (ALL_USERS == $t_user_id) {
print_header_redirect('manage_prof_menu_page.php');
} else {
print_header_redirect('account_prof_menu_page.php');
}
break;
case 'update':
$f_platform = gpc_get_string('platform');
$f_os = gpc_get_string('os');
$f_os_build = gpc_get_string('os_build');
$f_description = gpc_get_string('description');
if (profile_is_global($f_profile_id)) {
access_ensure_global_level(config_get('manage_global_profile_threshold'));
profile_update(ALL_USERS, $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description);
form_security_purge('profile_update');
print_header_redirect('manage_prof_menu_page.php');
} else {
profile_update(auth_get_current_user_id(), $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description);
form_security_purge('profile_update');
print_header_redirect('account_prof_menu_page.php');
}
break;
case 'delete':
if (profile_is_global($f_profile_id)) {
access_ensure_global_level(config_get('manage_global_profile_threshold'));
profile_delete(ALL_USERS, $f_profile_id);
示例8: require_api
* @uses string_api.php
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
require_api('authentication_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
auth_ensure_user_authenticated();
$f_ref = string_sanitize_url(gpc_get_string('ref', ''));
if (count(current_user_get_accessible_projects()) == 1) {
$t_project_ids = current_user_get_accessible_projects();
$t_project_id = (int) $t_project_ids[0];
if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
$t_ref_urlencoded = string_url($f_ref);
print_header_redirect("set_project.php?project_id={$t_project_id}&ref={$t_ref_urlencoded}", true);
/* print_header_redirect terminates script execution */
}
}
html_page_top(lang_get('select_project_button'));
?>
<!-- Project Select Form BEGIN -->
<div id="select-project-div" class="form-container">
<form id="select-project-form" method="post" action="set_project.php">
示例9: gpc_get_custom_field
function gpc_get_custom_field($p_var_name, $p_custom_field_type, $p_default = null)
{
switch ($p_custom_field_type) {
case CUSTOM_FIELD_TYPE_MULTILIST:
case CUSTOM_FIELD_TYPE_CHECKBOX:
$t_values = gpc_get_string_array($p_var_name, $p_default);
if (null !== $t_values && '' != $t_values) {
return implode('|', $t_values);
} else {
return '';
}
break;
case CUSTOM_FIELD_TYPE_DATE:
$t_day = gpc_get_int($p_var_name . "_day", 0);
$t_month = gpc_get_int($p_var_name . "_month", 0);
$t_year = gpc_get_int($p_var_name . "_year", 0);
if ($t_year == 0 || $t_month == 0 || $t_day == 0) {
if ($p_default == null) {
return '';
} else {
return $p_default;
}
} else {
return strtotime($t_year . "-" . $t_month . "-" . $t_day);
}
break;
default:
return gpc_get_string($p_var_name, $p_default);
}
}
示例10: news_ensure_enabled
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
/**
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2014 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 'string_api.php';
news_ensure_enabled();
$f_news_id = gpc_get_int('news_id');
$f_action = gpc_get_string('action', '');
# If deleting item redirect to delete script
if ('delete' == $f_action) {
form_security_validate('news_delete');
$row = news_get_row($f_news_id);
# This check is to allow deleting of news items that were left orphan due to bug #3723
if (project_exists($row['project_id'])) {
access_ensure_project_level(config_get('manage_news_threshold'), $row['project_id']);
}
helper_ensure_confirmed(lang_get('delete_news_sure_msg'), lang_get('delete_news_item_button'));
news_delete($f_news_id);
form_security_purge('news_delete');
print_header_redirect('news_menu_page.php', true);
}
# Retrieve news item data and prefix with v_
$row = news_get_row($f_news_id);
示例11: config_get
# 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: adm_config_set.php,v 1.4.2.1 2007-10-13 22:32:27 giallu Exp $
# --------------------------------------------------------
# This page stores the reported bug
require_once 'core.php';
$t_core_path = config_get('core_path');
# helper_ensure_post();
$f_user_id = gpc_get_int('user_id');
$f_project_id = gpc_get_int('project_id');
$f_config_option = gpc_get_string('config_option');
$f_type = gpc_get_string('type');
$f_value = gpc_get_string('value');
if (is_blank($f_config_option)) {
error_parameters('config_option');
trigger_error(ERROR_EMPTY_FIELD, ERROR);
}
if ($f_project_id == ALL_PROJECTS) {
access_ensure_global_level(config_get('set_configuration_threshold'));
} else {
access_ensure_project_level(config_get('set_configuration_threshold'), $f_project_id);
}
# make sure that configuration option specified is a valid one.
$t_not_found_value = '***CONFIG OPTION NOT FOUND***';
if (config_get_global($f_config_option, $t_not_found_value) === $t_not_found_value) {
error_parameters($f_config_option);
trigger_error(ERROR_CONFIG_OPT_NOT_FOUND, ERROR);
}
示例12: config_get
# 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 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;
示例13: form_security_validate
* 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 Slack Integration; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* or see http://www.gnu.org/licenses/.
*/
form_security_validate('plugin_Slack_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_url_webhook = gpc_get_string('url_webhook');
$f_bot_name = gpc_get_string('bot_name');
$f_bot_icon = gpc_get_string('bot_icon');
$f_skip_bulk = gpc_get_bool('skip_bulk');
$f_default_channel = gpc_get_string('default_channel');
if (plugin_config_get('url_webhook') != $f_url_webhook) {
plugin_config_set('url_webhook', $f_url_webhook);
}
if (plugin_config_get('bot_name') != $f_bot_name) {
plugin_config_set('bot_name', $f_bot_name);
}
if (plugin_config_get('bot_icon') != $f_bot_icon) {
plugin_config_set('bot_icon', $f_bot_icon);
}
if (plugin_config_get('skip_bulk') != $f_skip_bulk) {
plugin_config_set('skip_bulk', $f_skip_bulk);
}
if (plugin_config_get('default_channel') != $f_default_channel) {
plugin_config_set('default_channel', $f_default_channel);
}
示例14: session_delete
}
/**
* Delete a session variable.
* @param string Session variable name
*/
function session_delete( $p_name ) {
global $g_session;
$g_session->delete( $p_name );
}
/**
* Destroy the session entirely.
*/
function session_clean() {
global $g_session;
$g_session->destroy();
}
# Initialize the session
if ( PHP_CGI == php_mode() ) {
$t_session_id = gpc_get_string( 'session_id', '' );
if ( empty( $t_session_id ) ) {
session_init();
} else {
session_init( $t_session_id );
}
}
示例15: require_api
require_api('email_api.php');
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');
require_api('string_api.php');
require_api('user_api.php');
require_api('utility_api.php');
form_security_validate('account_update');
auth_ensure_user_authenticated();
current_user_ensure_unprotected();
$f_email = gpc_get_string('email', '');
$f_realname = gpc_get_string('realname', '');
$f_password = gpc_get_string('password', '');
$f_password_confirm = gpc_get_string('password_confirm', '');
// get the user id once, so that if we decide in the future to enable this for
// admins / managers to change details of other users.
$t_user_id = auth_get_current_user_id();
$t_redirect = 'account_page.php';
$t_email_updated = false;
$t_password_updated = false;
$t_realname_updated = false;
/** @todo Listing what fields were updated is not standard behaviour of MantisBT - it also complicates the code. */
if (OFF == config_get('use_ldap_email')) {
$f_email = email_append_domain($f_email);
email_ensure_valid($f_email);
email_ensure_not_disposable($f_email);
if ($f_email != user_get_email($t_user_id)) {
user_set_email($t_user_id, $f_email);
$t_email_updated = true;