Elgg  Version 2.3
Public Member Functions | Protected Member Functions | List of all members
Elgg\ActionsService Class Reference

Public Member Functions

 __construct (Config $config, ElggSession $session, ElggCrypto $crypto)
 Constructor. More...
 
 execute ($action, $forwarder="")
 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 . More...
 
 register ($action, $filename="", $access= 'logged_in')
 
 unregister ($action)
 
 validateActionToken ($visible_errors=true, $token=null, $ts=null)
 
 getActionTokenTimeout ()
 
 gatekeeper ($action)
 
 validateTokenOwnership ($token, $timestamp, $session_token= '')
 Was the given token generated for the session defined by session_token? More...
 
 generateActionToken ($timestamp, $session_token= '')
 Generate a token from a session token (specifying the user), the timestamp, and the site key. More...
 
 exists ($action)
 
 ajaxForwardHook ($hook, $reason, $forward_url, $params)
 
 ajaxActionHook ()
 
 getAllActions ()
 Get all actions. More...
 
 handleTokenRefreshRequest ()
 Send an updated CSRF token, provided the page's current tokens were not fake. More...
 

Protected Member Functions

 validateTokenTimestamp ($ts)
 Is the token timestamp within acceptable range? More...
 

Detailed Description

Definition at line 19 of file ActionsService.php.

Constructor & Destructor Documentation

Elgg\ActionsService::__construct ( Config  $config,
ElggSession  $session,
ElggCrypto  $crypto 
)

Constructor.

Parameters
Config$configConfig
ElggSession$sessionSession
ElggCrypto$cryptoCrypto service

Definition at line 67 of file ActionsService.php.

Member Function Documentation

Elgg\ActionsService::ajaxActionHook ( )
See also
ajax_action_hook private

Definition at line 438 of file ActionsService.php.

Elgg\ActionsService::ajaxForwardHook (   $hook,
  $reason,
  $forward_url,
  $params 
)
See also
ajax_forward_hook private

Definition at line 404 of file ActionsService.php.

Elgg\ActionsService::execute (   $action,
  $forwarder = "" 
)

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 .

Parameters
string$actionAction name
string$forwarderURL to forward to after completion
Returns
ResponseBuilder|null
See also
action private

Prepare action response

Parameters
string$error_keyError message key
int$status_codeHTTP status code
Returns
ResponseBuilder

Definition at line 84 of file ActionsService.php.

Elgg\ActionsService::exists (   $action)
See also
elgg_action_exists private

Definition at line 395 of file ActionsService.php.

Elgg\ActionsService::gatekeeper (   $action)
Returns
bool
See also
action_gatekeeper private

Definition at line 327 of file ActionsService.php.

Elgg\ActionsService::generateActionToken (   $timestamp,
  $session_token = '' 
)

Generate a token from a session token (specifying the user), the timestamp, and the site key.

See also
generate_action_token
Parameters
int$timestampUnix timestamp
string$session_tokenSession-specific token
Returns
string private

Definition at line 379 of file ActionsService.php.

Elgg\ActionsService::getActionTokenTimeout ( )
See also
ActionsService::validateActionToken private
Since
1.9.0
Returns
int number of seconds that action token is valid

Definition at line 313 of file ActionsService.php.

Elgg\ActionsService::getAllActions ( )

Get all actions.

Returns
array

Definition at line 449 of file ActionsService.php.

Elgg\ActionsService::handleTokenRefreshRequest ( )

Send an updated CSRF token, provided the page's current tokens were not fake.

Returns
ResponseBuilder private

Definition at line 459 of file ActionsService.php.

Elgg\ActionsService::register (   $action,
  $filename = "",
  $access = 'logged_in' 
)
See also
elgg_register_action private

Definition at line 189 of file ActionsService.php.

Elgg\ActionsService::unregister (   $action)
See also
elgg_unregister_action private

Definition at line 215 of file ActionsService.php.

Elgg\ActionsService::validateActionToken (   $visible_errors = true,
  $token = null,
  $ts = null 
)
See also
validate_action_token private

Definition at line 228 of file ActionsService.php.

Elgg\ActionsService::validateTokenOwnership (   $token,
  $timestamp,
  $session_token = '' 
)

Was the given token generated for the session defined by session_token?

Parameters
string$tokenCSRF token
int$timestampUnix time
string$session_tokenSession-specific token
Returns
bool private

Definition at line 362 of file ActionsService.php.

Elgg\ActionsService::validateTokenTimestamp (   $ts)
protected

Is the token timestamp within acceptable range?

Parameters
int$tstimestamp from the CSRF token
Returns
bool

Definition at line 301 of file ActionsService.php.


The documentation for this class was generated from the following file: