207 if ($secret[0] !==
'z') {
208 $rand_max = getrandmax();
209 if ($rand_max < pow(2, 16)) {
212 if ($rand_max < pow(2, 32)) {
299 header(
"Content-Type: application/json");
300 echo json_encode(
$data);
_elgg_action_handler(array $segments)
Handle a request for an action.
ajax_forward_hook($hook, $type, $reason, $params)
Catch calls to forward() in ajax request and force an exit.
generate_action_token($timestamp)
Generate an action token.
init_site_secret()
Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL).
action($action, $forwarder="")
Perform an action.
elgg_is_xhr()
Checks whether the request was requested via ajax.
action_gatekeeper($action)
Validates the presence of action tokens.
actions_init()
Initialize some ajaxy actions features @access private.
elgg_action_exists($action)
Check if an action is registered and its script exists.
elgg_register_action($action, $filename="", $access='logged_in')
Registers an action.
ajax_action_hook()
Buffer all output echo'd directly in the action for inclusion in the returned JSON.
get_site_secret()
Returns the site secret.
_elgg_csrf_token_refresh()
Send an updated CSRF token.
elgg_unregister_action($action)
Unregisters an action.
_elgg_get_site_secret_strength()
Get the strength of the site secret.
validate_action_token($visible_errors=true, $token=null, $ts=null)
Validate an action token.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
datalist_get($name)
Get the value of a datalist element.
datalist_set($name, $value)
Set the value for a datalist element.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Register a callback as a plugin hook handler.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
clearfix elgg elgg elgg elgg page header