本文整理汇总了PHP中gpc_set_cookie函数的典型用法代码示例。如果您正苦于以下问题:PHP gpc_set_cookie函数的具体用法?PHP gpc_set_cookie怎么用?PHP gpc_set_cookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gpc_set_cookie函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: helper_set_current_project
function helper_set_current_project($p_project_id)
{
$t_project_cookie_name = config_get('project_cookie');
gpc_set_cookie($t_project_cookie_name, $p_project_id, true);
return true;
}
示例2: string_display_line_links
, '<?php
echo AGILEMANTIS_PLUGIN_URL;
?>
');"
height="16" width="16">
</td>
<td>
<?php
echo string_display_line_links($row['summary']);
?>
</td>
</tr>
<?php
}
# add bug list cookie
gpc_set_cookie(config_get('bug_list_cookie'), substr($t_buglist, 0, -1));
}
$additional_fields = 7;
$additional_fields += plugin_config_get('gadiv_tracker_planned_costs');
$additional_fields += plugin_config_get('gadiv_ranking_order');
?>
<tr>
<?php
if (plugin_config_get('gadiv_ranking_order') == '1') {
?>
<td style="background-color: #B1DDFF"></td>
<?php
}
?>
<td style="background-color: #B1DDFF"></td>
<?php
示例3: array
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;
}
}
$my_filter['custom_fields'] = $t_custom_fields;
# Must use advanced filter so that the project_id is applied and multiple
# selections are handled.
$my_filter['_view_type'] = 'advanced';
$tc_setting_arr = filter_ensure_valid_filter($my_filter);
$t_settings_serialized = serialize($tc_setting_arr);
$t_settings_string = config_get('cookie_version') . '#' . $t_settings_serialized;
# Store the filter string in the database: its the current filter, so some values won't change
$t_project_id = helper_get_current_project();
$t_project_id = $t_project_id * -1;
$t_row_id = filter_db_set_for_current_user($t_project_id, false, '', $t_settings_string);
# set cookie values
gpc_set_cookie(config_get('view_all_cookie'), $t_row_id, time() + config_get('cookie_time_length'), config_get('cookie_path'));
# redirect to print_all or view_all page
if ($f_print) {
$t_redirect_url = 'print_all_bug_page.php';
} else {
$t_redirect_url = 'view_all_bug_page.php';
}
print_header_redirect($t_redirect_url);
示例4: destroy
/**
* destroy session
*/
function destroy() {
if( isset( $_COOKIE[session_name()] ) && !headers_sent() ) {
gpc_set_cookie( session_name(), '', time() - 42000 );
}
unset( $_SESSION[ $this->key ] );
}
示例5: gpc_get_int
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));
}
}
# Manage filter's persistency through cookie
$t_cookie_name = config_get('manage_config_cookie');
if ($t_filter_save) {
# Save user's filter to the cookie
$t_cookie_string = implode(':', array($t_filter_user_value, $t_filter_project_value, $t_filter_config_value));
gpc_set_cookie($t_cookie_name, $t_cookie_string, true);
} else {
# Retrieve the filter from the cookie if it exists
$t_cookie_string = gpc_get_cookie($t_cookie_name, null);
if (null !== $t_cookie_string) {
$t_cookie_contents = explode(':', $t_cookie_string);
$t_filter_user_value = $t_cookie_contents[0];
$t_filter_project_value = $t_cookie_contents[1];
$t_filter_config_value = check_config_value($t_cookie_contents[2]);
if ($t_filter_project_value != META_FILTER_NONE && !project_exists($t_filter_project_value)) {
$t_filter_project_value = ALL_PROJECTS;
}
}
}
# Get config edit values
$t_edit_user_id = gpc_get_int('user_id', $t_filter_user_value == META_FILTER_NONE ? ALL_USERS : $t_filter_user_value);
示例6: auth_http_set_logout_pending
/**
*
* @param bool $p_pending
* @access public
*/
function auth_http_set_logout_pending($p_pending)
{
$t_cookie_name = config_get('logout_cookie');
if ($p_pending) {
gpc_set_cookie($t_cookie_name, '1', false);
} else {
$t_cookie_path = config_get('cookie_path');
gpc_clear_cookie($t_cookie_name, $t_cookie_path);
}
}
示例7: require_api
require_api('string_api.php');
$t_allow_perm_login = ON == config_get('allow_permanent_cookie');
$f_username = gpc_get_string('username', '');
$f_password = gpc_get_string('password', '');
$f_perm_login = $t_allow_perm_login && gpc_get_bool('perm_login');
$t_return = string_url(string_sanitize_url(gpc_get_string('return', config_get('default_home_page'))));
$f_from = gpc_get_string('from', '');
$f_secure_session = gpc_get_bool('secure_session', false);
$f_install = gpc_get_bool('install');
# If upgrade required, always redirect to install page.
if ($f_install) {
$t_return = 'admin/install.php';
}
$f_username = auth_prepare_username($f_username);
$f_password = auth_prepare_password($f_password);
gpc_set_cookie(config_get_global('cookie_prefix') . '_secure_session', $f_secure_session ? '1' : '0');
if (auth_attempt_login($f_username, $f_password, $f_perm_login)) {
session_set('secure_session', $f_secure_session);
if ($f_username == 'administrator' && $f_password == 'root' && (is_blank($t_return) || $t_return == 'index.php')) {
$t_return = 'account_page.php';
}
$t_redirect_url = 'login_cookie_test.php?return=' . $t_return;
} else {
$t_redirect_url = 'login_page.php?return=' . $t_return . '&error=1&username=' . urlencode($f_username) . '&secure_session=' . ($f_secure_session ? 1 : 0);
if ($t_allow_perm_login) {
$t_redirect_url .= '&perm_login=' . ($f_perm_login ? 1 : 0);
}
if (HTTP_AUTH == config_get('login_method')) {
auth_http_prompt();
exit;
}
示例8: filter_get_bug_rows
$t_page_count = null;
$rows = filter_get_bug_rows($f_page_number, $t_per_page, $t_page_count, $t_bug_count, null, null, null, true);
if ($rows === false) {
print_header_redirect('view_all_set.php?type=0');
}
$t_bugslist = array();
$t_users_handlers = array();
$t_project_ids = array();
$t_row_count = count($rows);
for ($i = 0; $i < $t_row_count; $i++) {
array_push($t_bugslist, $rows[$i]->id);
$t_users_handlers[] = $rows[$i]->handler_id;
$t_project_ids[] = $rows[$i]->project_id;
}
$t_unique_users_handlers = array_unique($t_users_handlers);
$t_unique_project_ids = array_unique($t_project_ids);
user_cache_array_rows($t_unique_users_handlers);
project_cache_array_rows($t_unique_project_ids);
gpc_set_cookie(config_get('bug_list_cookie'), implode(',', $t_bugslist));
compress_enable();
# don't index view issues pages
html_robots_noindex();
html_page_top1(lang_get('view_bugs_link'));
if (current_user_get_pref('refresh_delay') > 0) {
html_meta_redirect('view_all_bug_page.php?page_number=' . $f_page_number, current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
define('VIEW_ALL_INC_ALLOW', true);
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'view_all_inc.php';
html_page_bottom();
示例9: helper_set_current_project
/**
* Set the current project id (stored in a cookie)
* @param int $p_project_id
* @return bool always true
*/
function helper_set_current_project($p_project_id)
{
global $g_cache_current_project;
$t_project_cookie_name = config_get('project_cookie');
$g_cache_current_project = $p_project_id;
gpc_set_cookie($t_project_cookie_name, $p_project_id, true);
return true;
}