Elgg  Version 3.0
Namespaces | Functions
actions.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 elgg_register_action ($action, $filename="", $access= 'logged_in')
 Registers an action. More...
 
 elgg_unregister_action ($action)
 Unregisters an action. More...
 
 elgg_build_hmac ($data)
 Get an HMAC token builder/validator object. More...
 
 generate_action_token ($timestamp)
 Generate an action token. More...
 
 init_site_secret ()
 Regenerate a new site key (32 bytes: "z" to indicate format + 186-bit key in Base64 URL). More...
 
 _elgg_get_site_secret_strength ()
 Get the strength of the site secret. More...
 
 elgg_action_exists ($action)
 Check if an action is registered and its script exists. More...
 
 elgg_is_xhr ()
 Checks whether the request was requested via ajax. More...
 

Function Documentation

_elgg_get_site_secret_strength ( )

Get the strength of the site secret.

Returns
string "strong", "moderate", or "weak"

Definition at line 105 of file actions.php.

elgg_action_exists (   $action)

Check if an action is registered and its script exists.

Parameters
string$actionAction name
Returns
bool
Since
1.8.0

Definition at line 117 of file actions.php.

elgg_build_hmac (   $data)

Get an HMAC token builder/validator object.

Parameters
mixed$dataHMAC data string or serializable data
Returns
Since
1.11

Definition at line 62 of file actions.php.

elgg_is_xhr ( )

Checks whether the request was requested via ajax.

Returns
bool whether page was requested via ajax
Since
1.8.0

Definition at line 127 of file actions.php.

elgg_register_action (   $action,
  $filename = "",
  $access = 'logged_in' 
)

Registers an action.

Actions are registered to a script in the system and are executed by the URL http://elggsite.org/action/action_name/.

$filename must be the full path of the file to register or a path relative to the core actions/ dir.

Actions should be namedspaced for your plugin. Example: elgg_register_action('myplugin/save_settings', ...);

Put action files under the actions/<plugin_name> directory of your plugin.

You don't need to use Elgg in your action files.

Parameters
string$actionThe name of the action (eg "register", "account/settings/save")
string$filenameOptionally, the filename where this action is located. If not specified, will assume the action is in elgg/actions/<action>.php
string$accessWho is allowed to execute this action: public, logged_in, admin. (default: logged_in)
Returns
bool

Definition at line 40 of file actions.php.

elgg_unregister_action (   $action)

Unregisters an action.

Parameters
string$actionAction name
Returns
bool
Since
1.8.1

Definition at line 51 of file actions.php.

generate_action_token (   $timestamp)

Generate an action token.

Action tokens are based on timestamps as returned by time(). They are valid for one hour.

Action tokens should be passed to all actions name __elgg_ts and __elgg_token.

Warning
Action tokens are required for all actions.
Parameters
int$timestampUnix timestamp
See also
input/securitytoken
input/form
Returns
string|false
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 83 of file actions.php.

init_site_secret ( )

Regenerate a new site key (32 bytes: "z" to indicate format + 186-bit key in Base64 URL).

Returns
mixed The site secret hash

Definition at line 93 of file actions.php.