You are here

function tfa_login_hash in Two-factor Authentication (TFA) 7.2

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

Generate account hash to access the TFA form.

Parameters

object $account: User account.

Return value

string Random hash.

4 calls to tfa_login_hash()
TfaTestCase::testRedirection in tests/tfa.test
Test redirection.
tfa_entry_access in ./tfa.module
Validate access to TFA code entry form.
tfa_login_submit in ./tfa.module
Login submit handler to determine if TFA process is applicable.
tfa_user_login in ./tfa.module
Implements hook_user_login().

File

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

Code

function tfa_login_hash($account) {

  // Using account login will mean this hash will become invalid once user has
  // authenticated via TFA.
  $data = implode(':', array(
    $account->name,
    $account->pass,
    $account->login,
  ));
  return drupal_hash_base64($data);
}