27     private $currentAction = 
null;
 
   43             'admin/plugins/disable',
 
   48         if (!in_array(
$action, $exceptions)) {
 
   53         $forwarder = str_replace(
_elgg_services()->config->getSiteUrl(), 
"", $forwarder);
 
   54         $forwarder = str_replace(
"http://", 
"", $forwarder);
 
   55         $forwarder = str_replace(
"@", 
"", $forwarder);
 
   56         if (substr($forwarder, 0, 1) == 
"/") {
 
   57             $forwarder = substr($forwarder, 1);
 
   60         if (!isset($this->actions[
$action])) {
 
   62         } elseif (!
_elgg_services()->session->isAdminLoggedIn() && ($this->actions[
$action][
'access'] === 
'admin')) {
 
   64         } elseif (!
_elgg_services()->session->isLoggedIn() && ($this->actions[
$action][
'access'] !== 
'public')) {
 
   69                 if (is_file($this->actions[
$action][
'file']) && is_readable($this->actions[
$action][
'file'])) {
 
   70                     self::includeFile($this->actions[
$action][
'file']);
 
   77         $forwarder = empty($forwarder) ? 
REFERER : $forwarder;
 
  103             if (
$path === 
null) {
 
  110         $this->actions[
$action] = array(
 
  122         if (isset($this->actions[
$action])) {
 
  123             unset($this->actions[
$action]);
 
  145         if ((
$token) && (
$ts) && ($session_id)) {
 
  146             if ($this->validateTokenOwnership(
$token, 
$ts)) {
 
  147                 if ($this->validateTokenTimestamp(
$ts)) {
 
  150                     $returnval = 
_elgg_services()->hooks->trigger(
'action_gatekeeper:permissions:check', 
'all', array(
 
  157                     } 
else if ($visible_errors) {
 
  160                 } 
else if ($visible_errors) {
 
  168             } 
else if ($visible_errors) {
 
  178             $length = $req->server->get(
'CONTENT_LENGTH');
 
  179             $post_count = count($req->request);
 
  180             if ($length && $post_count < 1) {
 
  182                 $error_msg = 
_elgg_services()->hooks->trigger(
'action_gatekeeper:upload_exceeded_msg', 
'all', array(
 
  183                     'post_size' => $length,
 
  184                     'visible_errors' => $visible_errors,
 
  185                 ), 
_elgg_services()->translator->translate(
'actiongatekeeper:uploadexceeded'));
 
  187                 $error_msg = 
_elgg_services()->translator->translate(
'actiongatekeeper:missingfields');
 
  189             if ($visible_errors) {
 
  205         $timeout = $this->getActionTokenTimeout();
 
  207         return ($timeout == 0 || (
$ts > $now - $timeout) && (
$ts < $now + $timeout));
 
  217         if (($timeout = 
_elgg_services()->config->get(
'action_token_timeout')) === 
null) {
 
  222         return (
int)((float)$timeout * $hour);
 
  231             if ($this->validateActionToken(
false)) {
 
  237             if (
$token && $this->validateTokenTimestamp(
$ts)) {
 
  246             $this->validateActionToken();
 
  248         } 
else if ($this->validateActionToken()) {
 
  266         $required_token = $this->generateActionToken(
$timestamp, $session_token);
 
  283         if (!$session_token) {
 
  285             if (!$session_token) {
 
  299         return (isset($this->actions[
$action]) && file_exists($this->actions[
$action][
'file']));
 
  312                 'system_messages' => array(
 
  330             $system_messages = 
_elgg_services()->systemMessages->dumpRegister();
 
  332             if (isset($system_messages[
'success'])) {
 
  333                 $params[
'system_messages'][
'success'] = $system_messages[
'success'];
 
  336             if (isset($system_messages[
'error'])) {
 
  337                 $params[
'system_messages'][
'error'] = $system_messages[
'error'];
 
  341             if ($reason == 
'walled_garden') {
 
  345                 '400' => 
'Bad Request',
 
  346                 '401' => 
'Unauthorized',
 
  347                 '403' => 
'Forbidden',
 
  348                 '404' => 
'Not Found',
 
  349                 '407' => 
'Proxy Authentication Required',
 
  350                 '500' => 
'Internal Server Error',
 
  351                 '503' => 
'Service Unavailable',
 
  354             if (isset($httpCodes[$reason])) {
 
  355                 header(
"HTTP/1.1 $reason {$httpCodes[$reason]}", 
true);
 
  358             $context = array(
'action' => $this->currentAction);
 
  365             $http_accept = 
_elgg_services()->request->server->get(
'HTTP_ACCEPT');
 
  366             if (stripos($http_accept, 
'application/json') === 
false) {
 
  367                 header(
"Content-type: text/plain;charset=utf-8");
 
  369                 header(
"Content-type: application/json;charset=utf-8");
 
elgg_is_xhr()
Checks whether the request was requested via ajax.
 
ajaxForwardHook($hook, $reason, $return, $params)
 
getAllActions()
Get all actions.
 
validateTokenTimestamp($ts)
Is the token timestamp within acceptable range?
 
validateActionToken($visible_errors=true, $token=null, $ts=null)
 
validateTokenOwnership($token, $timestamp, $session_token='')
Was the given token generated for the session defined by session_token?
 
generateActionToken($timestamp, $session_token='')
Generate a token from a session token (specifying the user), the timestamp, and the site key.
 
execute($action, $forwarder="")
 
static includeFile($file)
Include an action file with isolated scope.
 
register_error($error)
Display an error on next page load.
 
forward($location="", $reason='system')
Forward to $location.
 
gatekeeper()
Alias of elgg_gatekeeper()
 
elgg_get_session()
Gets Elgg's session object.
 
clearfix elgg elgg elgg elgg page header