PHP Класс Elgg\ActionsService

Use the elgg_* versions instead.
С версии: 1.9.0
Наследование: use trait Elgg\TimeUsing
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Config $config, ElggSession $session, ElggCrypto $crypto ) Constructor
ajaxActionHook ( )
ajaxForwardHook ( $hook, $reason, $forward_url, $params )
execute ( string $action, string $forwarder = "" ) : Elgg\Http\ResponseBuilder | null Executes an action If called from action() redirect will be issued by the response factory If called as /action page handler response will be handled by \Elgg\Router
exists ( $action )
gatekeeper ( $action ) : boolean
generateActionToken ( integer $timestamp, string $session_token = '' ) : string Generate a token from a session token (specifying the user), the timestamp, and the site key.
getActionTokenTimeout ( ) : integer
getAllActions ( ) : array Get all actions
handleTokenRefreshRequest ( ) : Elgg\Http\ResponseBuilder Send an updated CSRF token, provided the page's current tokens were not fake.
register ( $action, $filename = "", $access = 'logged_in' )
unregister ( $action )
validateActionToken ( $visible_errors = true, $token = null, $ts = null )
validateTokenOwnership ( string $token, integer $timestamp, string $session_token = '' ) : boolean Was the given token generated for the session defined by session_token?

Защищенные методы

Метод Описание
validateTokenTimestamp ( integer $ts ) : boolean Is the token timestamp within acceptable range?

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Config $config, ElggSession $session, ElggCrypto $crypto )
$config Config Config
$session ElggSession Session
$crypto ElggCrypto Crypto service

ajaxActionHook() публичный Метод

См. также: ajax_action_hook
Устаревший: 2.3
public ajaxActionHook ( )

ajaxForwardHook() публичный Метод

См. также: ajax_forward_hook
Устаревший: 2.3
public ajaxForwardHook ( $hook, $reason, $forward_url, $params )

execute() публичный Метод

Executes an action If called from action() redirect will be issued by the response factory If called as /action page handler response will be handled by \Elgg\Router
См. также: action
public execute ( string $action, string $forwarder = "" ) : Elgg\Http\ResponseBuilder | null
$action string Action name
$forwarder string URL to forward to after completion
Результат Elgg\Http\ResponseBuilder | null

exists() публичный Метод

См. также: elgg_action_exists
public exists ( $action )

gatekeeper() публичный Метод

См. также: action_gatekeeper
public gatekeeper ( $action ) : boolean
Результат boolean

generateActionToken() публичный Метод

Generate a token from a session token (specifying the user), the timestamp, and the site key.
См. также: generate_action_token
public generateActionToken ( integer $timestamp, string $session_token = '' ) : string
$timestamp integer Unix timestamp
$session_token string Session-specific token
Результат string

getActionTokenTimeout() публичный Метод

См. также: ActionsService::validateActionToken
С версии: 1.9.0
public getActionTokenTimeout ( ) : integer
Результат integer number of seconds that action token is valid

getAllActions() публичный Метод

Get all actions
public getAllActions ( ) : array
Результат array

handleTokenRefreshRequest() публичный Метод

Send an updated CSRF token, provided the page's current tokens were not fake.
public handleTokenRefreshRequest ( ) : Elgg\Http\ResponseBuilder
Результат Elgg\Http\ResponseBuilder

register() публичный Метод

См. также: elgg_register_action
public register ( $action, $filename = "", $access = 'logged_in' )

unregister() публичный Метод

См. также: elgg_unregister_action
public unregister ( $action )

validateActionToken() публичный Метод

См. также: validate_action_token
public validateActionToken ( $visible_errors = true, $token = null, $ts = null )

validateTokenOwnership() публичный Метод

Was the given token generated for the session defined by session_token?
public validateTokenOwnership ( string $token, integer $timestamp, string $session_token = '' ) : boolean
$token string CSRF token
$timestamp integer Unix time
$session_token string Session-specific token
Результат boolean

validateTokenTimestamp() защищенный Метод

Is the token timestamp within acceptable range?
protected validateTokenTimestamp ( integer $ts ) : boolean
$ts integer timestamp from the CSRF token
Результат boolean