You are here

protected function TfaTrustedBrowser::trustedBrowser in TFA Basic plugins 7

Check if browser value matches user's saved browser.

Parameters

string $value:

Return value

int|FALSE Browser ID if trusted or else FALSE.

2 calls to TfaTrustedBrowser::trustedBrowser()
TfaTrustedBrowser::loginAllowed in includes/tfa_trusted_browser.inc
TfaTrustedBrowserSetup::getSetupForm in includes/tfa_trusted_browser.inc
@copydoc TfaSetupPluginInterface::getSetupForm()

File

includes/tfa_trusted_browser.inc, line 142
classes for TFA basic plugin

Class

TfaTrustedBrowser
Class TfaTrustedBrowser

Code

protected function trustedBrowser($value) {

  // Check if $id has been saved for this user.
  $result = db_query("SELECT did FROM {tfa_trusted_browser} WHERE value = :value AND uid = :uid", array(
    ':value' => $value,
    ':uid' => $this->context['uid'],
  ))
    ->fetchAssoc();
  if (!empty($result)) {
    return $result['did'];
  }
  return FALSE;
}