You are here

public function TfaTrustedBrowserSetup::getTrustedBrowsers in TFA Basic plugins 7

Get list of trusted browsers.

Return value

array

1 call to TfaTrustedBrowserSetup::getTrustedBrowsers()
TfaTrustedBrowserSetup::getSetupForm in includes/tfa_trusted_browser.inc
@copydoc TfaSetupPluginInterface::getSetupForm()

File

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

Class

TfaTrustedBrowserSetup
Class TfaTrustedBrowserSetup

Code

public function getTrustedBrowsers() {
  $browsers = array();
  $result = db_query("SELECT did, name, ip, created, last_used FROM {tfa_trusted_browser} WHERE uid = :uid", array(
    ':uid' => $this->context['uid'],
  ));
  if ($result) {
    foreach ($result as $row) {
      $browsers[] = array(
        'id' => $row->did,
        'name' => $row->name,
        'created' => $row->created,
        'ip' => $row->ip,
        'last_used' => $row->last_used,
      );
    }
  }
  return $browsers;
}