You are here

public function GoogleAuthenticator::hasToken in Google Authenticator login 7

Same name and namespace in other branches
  1. 6 ga4php.php \GoogleAuthenticator::hasToken()

Determine if the user has an actual token.

File

./ga4php.php, line 143
Abstract GoogleAuthenticator class.

Class

GoogleAuthenticator
@file Abstract GoogleAuthenticator class.

Code

public function hasToken($username) {
  $token = $this
    ->internalGetData($username);

  // @todo change this to a pattern match for an actual key.
  if (!isset($token["tokenkey"])) {
    return FALSE;
  }
  if ($token["tokenkey"] == "") {
    return FALSE;
  }
  return TRUE;
}