Elgg  Version 3.0
actions.php
Go to the documentation of this file.
1 <?php
13 
40 function elgg_register_action($action, $filename = "", $access = 'logged_in') {
41  return _elgg_services()->actions->register($action, $filename, $access);
42 }
43 
52  return _elgg_services()->actions->unregister($action);
53 }
54 
63  return _elgg_services()->hmac->getHmac($data);
64 }
65 
84  return elgg()->csrf->generateActionToken($timestamp);
85 }
86 
93 function init_site_secret() {
94  $secret = SiteSecret::regenerate(_elgg_services()->crypto, _elgg_services()->configTable);
95  _elgg_services()->setValue('siteSecret', $secret);
96  return $secret->get();
97 }
98 
106  return _elgg_services()->siteSecret->getStrength();
107 }
108 
118  return _elgg_services()->actions->exists($action);
119 }
120 
127 function elgg_is_xhr() {
128  return _elgg_services()->request->isXmlHttpRequest();
129 }
$action
Definition: full.php:111
init_site_secret()
Regenerate a new site key (32 bytes: "z" to indicate format + 186-bit key in Base64 URL)...
Definition: actions.php:93
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
Definition: save.php:57
_elgg_get_site_secret_strength()
Get the strength of the site secret.
Definition: actions.php:105
$timestamp
Definition: date.php:33
elgg_unregister_action($action)
Unregisters an action.
Definition: actions.php:51
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
Definition: actions.php:40
$filename
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
elgg_build_hmac($data)
Get an HMAC token builder/validator object.
Definition: actions.php:62
elgg_is_xhr()
Checks whether the request was requested via ajax.
Definition: actions.php:127
generate_action_token($timestamp)
Generate an action token.
Definition: actions.php:83
elgg_action_exists($action)
Check if an action is registered and its script exists.
Definition: actions.php:117
var elgg
Definition: elgglib.js:4
$access
Definition: save.php:18