You are here

function tfa_get_code in Two-factor Authentication (TFA) 6

Same name and namespace in other branches
  1. 7 tfa.module \tfa_get_code()

Retreive sent code for user or FALSE if no code was set.

Parameters

int $uid UID of account.:

Return value

array Array of with keys 'code' string and 'accepted' bool.

5 calls to tfa_get_code()
tfa_code_form_validate in ./tfa.pages.inc
Validate handler for TFA login form.
tfa_entry_access in ./tfa.module
Validate access to TFA code entry form.
tfa_send_code in ./tfa.module
Send the code to the user.
tfa_store_code in ./tfa.module
Store the code for state control
tfa_user in ./tfa.module
Implements hook_user().

File

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

Code

function tfa_get_code($uid) {
  $result = db_fetch_array(db_query("SELECT code, accepted, created FROM {tfa} WHERE uid = %d", $uid));
  if (!empty($result)) {
    return $result;
  }
  return FALSE;
}