示例#1
0
/**
 * Purge all expired tokens only once per session.
 * @param integer Token type
 */
function token_purge_expired_once($p_token_type = null)
{
    global $g_tokens_purged;
    if (!$g_tokens_purged) {
        token_purge_expired();
    }
}
示例#2
0
/**
 * Purge all expired tokens only once per session.
 */
function token_purge_expired_once()
{
    global $g_tokens_purged;
    if (!$g_tokens_purged) {
        token_purge_expired();
    }
}
示例#3
0
function token_get_value($p_token_id)
{
    $c_token_id = db_prepare_int($p_token_id);
    $c_token_owner = auth_get_current_user_id();
    $t_tokens_table = config_get('mantis_tokens_table');
    token_purge_expired();
    token_ensure_owner($c_token_id, $c_token_owner);
    $query = "SELECT value\n\t\t          \tFROM {$t_tokens_table}\n\t\t          \tWHERE id='{$c_token_id}'";
    $result = db_query($query);
    return db_result($result);
}