function hook_rabbit_hole_execute_alter in Rabbit Hole 7.2
Alters the action before it is performed.
Parameters
$action: The action that will be performed. The following constants and values are recognized:
- RABBIT_HOLE_ACCESS_DENIED: Return 403.
- RABBIT_HOLE_PAGE_NOT_FOUND:
- RABBIT_HOLE_PAGE_REDIRECT
- NULL or FALSE to skip the action.
$context: An associative array containing:
- entity_type: The type of $entity; for example, 'node' or 'user'.
- entity: The entity that is being viewed.
1 function implements hook_rabbit_hole_execute_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- colorbox_node_rabbit_hole_execute_alter in modules/
rh_node/ rh_node.module - Implements hook_rabbit_hole_execute_alter() on behalf of colorbox_node.
1 invocation of hook_rabbit_hole_execute_alter()
- rabbit_hole_execute in ./
rabbit_hole.module - Determines the action that should be executed.
File
- ./
rabbit_hole.api.php, line 51 - Hooks provided by Rabbit Hole.
Code
function hook_rabbit_hole_execute_alter(&$action, $context) {
if ($context['entity_type'] === 'user' && isset($_GET['token'])) {
$user = $context['entity'];
if (drupal_valid_token($_GET['token'], "override_rh:user:{$user->uid}")) {
$action = FALSE;
}
}
}