284 $session_token =
get_input(
'session_token', null,
false);
285 $pairs = (array)
get_input(
'pairs', array(),
false);
286 $valid_tokens = (object)array();
287 foreach ($pairs as $pair) {
288 list(
$ts,
$token) = explode(
',', $pair, 2);
290 $valid_tokens->{
$token} =
true;
302 'valid_tokens' => $valid_tokens,
307 header(
"Content-Type: application/json");
328 $events->registerHandler(
'init',
'system',
'actions_init');
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
elgg_is_xhr()
Checks whether the request was requested via ajax.
action($action, $forwarder="")
Perform an action.
action_gatekeeper($action)
Validates the presence of action tokens.
elgg_action_exists($action)
Check if an action is registered and its script exists.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_get_session()
Gets Elgg's session object.
init_site_secret()
Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL)...
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
generate_action_token($timestamp)
Generate an action token.
actions_init()
Initialize some ajaxy actions features private.
elgg_build_hmac($data)
Get an HMAC token builder/validator object.
elgg echo
Translates a string.
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
ajax_forward_hook($hook, $type, $reason, $params)
Catch calls to forward() in ajax request and force an exit.
get_site_secret()
Returns the site secret.
_elgg_action_handler(array $segments)
Handle a request for an action.
validate_action_token($visible_errors=true, $token=null, $ts=null)
Validate an action token.
_elgg_get_site_secret_strength()
Get the strength of the site secret.
_elgg_csrf_token_refresh()
Send an updated CSRF token, provided the page's current tokens were not fake.
clearfix elgg elgg elgg elgg page header
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
ajax_action_hook()
Buffer all output echo'd directly in the action for inclusion in the returned JSON.
elgg_unregister_action($action)
Unregisters an action.