You are here

function tokenauth_tokens in Token authentication 7

Implements hook_tokens().

File

./tokenauth.module, line 217

Code

function tokenauth_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  if ($type == 'user' && !empty($data['user'])) {
    if (isset($tokens['tokenauth-token'])) {
      $replacements[$tokens['tokenauth-token']] = tokenauth_get_token($data['user']->uid);
    }
  }
  return $replacements;
}