You are here

function tfa_entry_access in Two-factor Authentication (TFA) 7.2

Same name and namespace in other branches
  1. 6 tfa.module \tfa_entry_access()
  2. 7 tfa.module \tfa_entry_access()

Validate access to TFA code entry form.

1 string reference to 'tfa_entry_access'
tfa_menu in ./tfa.module
Implements hook_menu().

File

./tfa.module, line 36
Two-factor authentication for Drupal.

Code

function tfa_entry_access($account, $url_hash) {

  // Generate a hash for this account.
  $hash = tfa_login_hash($account);
  $context = tfa_get_context($account);
  return $hash === $url_hash && !empty($context) && $context['uid'] === $account->uid;
}