You are here

function GoogleAuthenticator::__construct in Google Authenticator login 6

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

File

./ga4php.php, line 5

Class

GoogleAuthenticator

Code

function __construct($totpskew = 1, $hotpskew = 10, $hotphuntvalue = 200000) {

  // the hotpskew is how many tokens forward we look to find the input
  // code the user used
  $this->hotpSkew = $hotpskew;

  // the totpskew value is how many tokens either side of the current
  // token we should check, based on a time skew.
  $this->totpSkew = $totpskew;

  // the hotphuntvalue is what we use to resync tokens.
  // when a user resyncs, we search from 0 to $hutphutvalue to find
  // the two token codes the user has entered - 200000 seems like overkill
  // really as i cant imagine any token out there would ever make it
  // past 200000 token code requests.
  $this->hotpHuntValue = $hotphuntvalue;
}