/** * Cache collapse API data from the database for the current user. * If the collapse cookie has been set, grab the changes and resave * the token, or touch it otherwise. */ function collapse_cache_token() { global $g_collapse_cache_token; if (!auth_is_user_authenticated() || current_user_is_anonymous()) { $g_collapse_cache_token = array(); return; } if (isset($g_collapse_cache_token)) { return; } $t_user_id = auth_get_current_user_id(); $t_token = token_get_value(TOKEN_COLLAPSE); if (!is_null($t_token)) { $t_data = unserialize($t_token); } else { $t_data = array(); } $g_collapse_cache_token = $t_data; $t_cookie = gpc_get_cookie('MANTIS_collapse_settings', ''); if (false !== $t_cookie && !is_blank($t_cookie)) { $t_update = false; $t_data = explode('|', $t_cookie); foreach ($t_data as $t_pair) { $t_pair = explode(',', $t_pair); if (false !== $t_pair && count($t_pair) == 2) { $g_collapse_cache_token[$t_pair[0]] = true == $t_pair[1]; $t_update = true; } } if ($t_update) { $t_token = serialize($g_collapse_cache_token); token_set(TOKEN_COLLAPSE, $t_token, TOKEN_EXPIRY_COLLAPSE); } else { token_touch(TOKEN_COLLAPSE); } gpc_clear_cookie('MANTIS_collapse_settings'); } }
/** * * @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); } }
function helper_clear_pref_cookies() { gpc_clear_cookie(config_get('project_cookie')); gpc_clear_cookie(config_get('manage_cookie')); }
$t_setting_arr[FILTER_PROPERTY_SORT_DIRECTION] = $f_dir; break; # This is when we want to copy another query from the # database over the top of our current one # This is when we want to copy another query from the # database over the top of our current one case '3': log_event(LOG_FILTERING, 'view_all_set.php: Copy another query from database'); $t_filter_string = filter_db_get_filter($f_source_query_id); # If we can use the query that we've requested, # grab it. We will overwrite the current one at the # bottom of this page $t_setting_arr = filter_deserialize($t_filter_string); if (false === $t_setting_arr) { # couldn't deserialize, if we were trying to use the filter, clear it and reload gpc_clear_cookie('view_all_cookie'); error_proceed_url('view_all_set.php?type=0'); trigger_error(ERROR_FILTER_TOO_OLD, ERROR); exit; # stop here } break; # Generalise the filter # Generalise the filter case '4': log_event(LOG_FILTERING, 'view_all_set.php: Generalise the filter'); $t_setting_arr[FILTER_PROPERTY_CATEGORY] = array(META_FILTER_ANY); $t_setting_arr[FILTER_PROPERTY_REPORTER_ID] = array(META_FILTER_ANY); $t_setting_arr[FILTER_PROPERTY_HANDLER_ID] = array(META_FILTER_ANY); $t_setting_arr[FILTER_PROPERTY_PRODUCT_BUILD] = array(META_FILTER_ANY); $t_setting_arr[FILTER_PROPERTY_PRODUCT_VERSION] = array(META_FILTER_ANY);