You are here

function hook_legal_accepted in Legal 7

Runs actions when legal terms are accepted

Parameters

$data: Data relating to the current acceptance. Includes: uid - The ID of the user that accepted the terms. version - The version of Terms accepted. revision - The revision of Terms accepted. accepted - The timestamp the Terms were accepted at. language - The current language.

Related topics

1 function implements hook_legal_accepted()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

legal_legal_accepted in ./legal.module
Implements hook_legal_accepted().
1 invocation of hook_legal_accepted()
legal_save_accept in ./legal.module

File

./legal.api.php, line 34
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_legal_accepted($data) {
  if (module_exists('rules')) {
    $user = user_load($data['uid']);
    $conditions = legal_get_conditions($data['language']);
    rules_invoke_event('legal_accepted', $user, $conditions, $data['accepted']);
  }
}