本文整理汇总了PHP中token_get_value函数的典型用法代码示例。如果您正苦于以下问题:PHP token_get_value函数的具体用法?PHP token_get_value怎么用?PHP token_get_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了token_get_value函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: last_visited_get_array
function last_visited_get_array($p_user_id = null)
{
$t_value = token_get_value(TOKEN_LAST_VISITED, $p_user_id);
if (is_null($t_value)) {
return array();
}
# we don't slice the array here to optimise for performance. If the user reduces the number of recently
# visited to track, then he/she will get the extra entries until visiting an issue.
$t_ids = explode(',', $t_value);
return $t_ids;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:11,代码来源:last_visited_api.php
示例2: collapse_cache_token
/**
* 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');
}
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:43,代码来源:collapse_api.php
示例3: Copyright
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected]
# Copyright (C) 2002 - 2004 Mantis Team - [email protected]
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: summary_graph_bystatus_pct.php,v 1.15 2005/02/12 20:01:08 jlatour Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'graph_api.php';
access_ensure_project_level(config_get('view_summary_threshold'));
$f_width = gpc_get_int('width', 300);
$f_token = gpc_get_int('token', 0);
if (0 == $f_token) {
$t_metrics = create_bug_enum_summary(lang_get('status_enum_string'), 'status');
} else {
$t_metrics = unserialize(token_get_value($f_token));
}
graph_pie($t_metrics, lang_get('by_status_pct'), $f_width, $f_width);
开发者ID:centaurustech,项目名称:BenFund,代码行数:22,代码来源:summary_graph_bystatus_pct.php
示例4: access_ensure_project_level
# 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 2000 - 2002 Kenzaburo Ito - [email protected]
* @copyright Copyright 2002 MantisBT Team - [email protected]
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once 'core.php';
require_once 'graph_api.php';
access_ensure_project_level(config_get('view_summary_threshold'));
$f_width = gpc_get_int('width', 300);
$t_token = token_get_value(TOKEN_GRAPH);
if ($t_token == null) {
$t_metrics = create_bug_enum_summary(lang_get('status_enum_string'), 'status');
} else {
$t_metrics = unserialize($t_token);
}
graph_pie($t_metrics, plugin_lang_get('by_status_pct'), $f_width, $f_width);
开发者ID:Kirill,项目名称:mantisbt,代码行数:31,代码来源:summary_graph_bystatus_pct.php
示例5: current_user_get_bug_filter
/**
* Returns the issue filter parameters for the current user
*
* @return Active issue filter for current user or false if no filter is currently defined.
* @access public
*/
function current_user_get_bug_filter($p_project_id = null)
{
$f_filter_string = gpc_get_string('filter', '');
$t_view_all_cookie = '';
$t_cookie_detail = '';
$t_filter = '';
if (!is_blank($f_filter_string)) {
if (is_numeric($f_filter_string)) {
$t_token = token_get_value(TOKEN_FILTER);
if (null != $t_token) {
$t_filter = unserialize($t_token);
}
} else {
$t_filter = unserialize($f_filter_string);
}
} else {
if (!filter_is_cookie_valid()) {
return false;
} else {
$t_user_id = auth_get_current_user_id();
$t_filter = user_get_bug_filter($t_user_id, $p_project_id);
}
}
$t_filter = filter_ensure_valid_filter($t_filter);
return $t_filter;
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:32,代码来源:current_user_api.php
示例6: Copyright
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected]
# Copyright (C) 2002 - 2004 Mantis Team - [email protected]
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: summary_graph_byseverity_pct.php,v 1.15 2005/02/12 20:01:08 jlatour Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'graph_api.php';
access_ensure_project_level(config_get('view_summary_threshold'));
$f_width = gpc_get_int('width', 300);
$f_token = gpc_get_int('token', 0);
if (0 == $f_token) {
$t_metrics = create_bug_enum_summary(lang_get('severity_enum_string'), 'severity');
} else {
$t_metrics = graph_total_metrics(unserialize(token_get_value($f_token)));
}
graph_pie($t_metrics, lang_get('by_severity_pct'), $f_width, $f_width);
开发者ID:centaurustech,项目名称:BenFund,代码行数:22,代码来源:summary_graph_byseverity_pct.php
示例7: require_api
require_api('constant_inc.php');
require_api('current_user_api.php');
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');
$t_user_id = auth_get_current_user_id();
# If token is set, it's a password reset request from verify.php, and if
# not we need to reauthenticate the user
$t_account_verification = token_get_value(TOKEN_ACCOUNT_VERIFY, $t_user_id);
if (!$t_account_verification) {
auth_reauthenticate();
}
auth_ensure_user_authenticated();
current_user_ensure_unprotected();
$f_email = gpc_get_string('email', '');
$f_realname = gpc_get_string('realname', '');
$f_password_current = gpc_get_string('password_current', '');
$f_password = gpc_get_string('password', '');
$f_password_confirm = gpc_get_string('password_confirm', '');
$t_redirect_url = 'index.php';
# @todo Listing what fields were updated is not standard behaviour of MantisBT - it also complicates the code.
$t_email_updated = false;
$t_password_updated = false;
$t_realname_updated = false;
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:account_update.php
示例8: current_user_get_bug_filter
/**
* Returns the issue filter parameters for the current user
*
* @param integer $p_project_id Project id. This argument is only used if a 'filter' string is not passed via the web request.
* The default value is null meaning return the current filter for user's current project
if a filter string is not supplied.
* @return array User filter, if not set, then default filter.
* @access public
*/
function current_user_get_bug_filter($p_project_id = null)
{
$f_filter_string = gpc_get_string('filter', '');
$t_filter = '';
if (!is_blank($f_filter_string)) {
if (is_numeric($f_filter_string)) {
$t_token = token_get_value(TOKEN_FILTER);
if (null != $t_token) {
$t_filter = json_decode($t_token, true);
}
} else {
$t_filter = json_decode($f_filter_string, true);
}
$t_filter = filter_ensure_valid_filter($t_filter);
} else {
if (!filter_is_cookie_valid()) {
$t_filter = filter_get_default();
} else {
$t_user_id = auth_get_current_user_id();
$t_filter = user_get_bug_filter($t_user_id, $p_project_id);
}
}
return $t_filter;
}
开发者ID:hamx0r,项目名称:mantisbt,代码行数:33,代码来源:current_user_api.php
示例9: category_full_name
$category_name = category_full_name($category_id, false);
if (isset($categories[$category_name]))
{
$categories[$category_name][] = $category_id;
}
else
{
$categories[$category_name] = array($category_id);
}
}
}
# Get the selected category
$categories_by_project = array();
$token_categories_by_project = token_get_value(ScrumPlugin::TOKEN_SCRUM_CATEGORY);
if ( !is_null( $token_categories_by_project ) )
{
$categories_by_project = unserialize( $token_categories_by_project );
}
if ( gpc_isset("category") )
{
$category = gpc_get_string("category", "");
} else
{
if ( array_key_exists( $current_project, $categories_by_project) )
{
$category = $categories_by_project[ $current_project ];
}
开发者ID:rombert,项目名称:scrum,代码行数:31,代码来源:board.php
示例10: require_api
require_api('gpc_api.php');
require_api('print_api.php');
require_api('user_api.php');
# check if at least one way to get here is enabled
if (OFF == config_get('allow_signup') && OFF == config_get('lost_password_feature') && OFF == config_get('send_reset_password')) {
trigger_error(ERROR_LOST_PASSWORD_NOT_ENABLED, ERROR);
}
$f_user_id = gpc_get_string('id');
$f_confirm_hash = gpc_get_string('confirm_hash');
# force logout on the current user if already authenticated
if (auth_is_user_authenticated()) {
auth_logout();
# reload the page after logout
print_header_redirect('verify.php?id=' . $f_user_id . '&confirm_hash=' . $f_confirm_hash);
}
$t_token_confirm_hash = token_get_value(TOKEN_ACCOUNT_ACTIVATION, $f_user_id);
if ($f_confirm_hash != $t_token_confirm_hash) {
trigger_error(ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, ERROR);
}
user_reset_failed_login_count_to_zero($f_user_id);
user_reset_lost_password_in_progress_count_to_zero($f_user_id);
# fake login so the user can set their password
auth_attempt_script_login(user_get_field($f_user_id, 'username'));
user_increment_login_count($f_user_id);
# extracts the user information
# and prefixes it with u_
$t_row = user_get_row($f_user_id);
extract($t_row, EXTR_PREFIX_ALL, 'u');
$t_can_change_password = helper_call_custom_function('auth_can_change_password', array());
html_page_top1();
html_page_top2a();
开发者ID:spring,项目名称:spring-website,代码行数:31,代码来源:verify.php
示例11: require_api
require_api('constant_inc.php');
require_api('current_user_api.php');
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');
# If token is set, it's a password reset request from verify.php, and if
# not we need to reauthenticate the user
$t_verify_user_id = gpc_get('verify_user_id', false);
$t_account_verification = $t_verify_user_id ? token_get_value(TOKEN_ACCOUNT_VERIFY, $t_verify_user_id) : false;
if (!$t_account_verification) {
auth_reauthenticate();
$t_user_id = auth_get_current_user_id();
} else {
# set a temporary cookie so the login information is passed between pages.
auth_set_cookies($t_verify_user_id, false);
# fake login so the user can set their password
auth_attempt_script_login(user_get_field($t_verify_user_id, 'username'));
$t_user_id = $t_verify_user_id;
}
auth_ensure_user_authenticated();
current_user_ensure_unprotected();
$f_email = gpc_get_string('email', '');
$f_realname = gpc_get_string('realname', '');
$f_password_current = gpc_get_string('password_current', '');
开发者ID:spring,项目名称:spring-website,代码行数:31,代码来源:account_update.php
注:本文中的token_get_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论