You are here

public function GALoginGA::unapprovedUser in Google Authenticator login 7

Create "user" withOUT insert.

File

./ga_login.class.php, line 83

Class

GALoginGA

Code

public function unapprovedUser($username, $ttype = "HOTP", $key = "", $hexkey = "") {
  $ttype = strtoupper($ttype);
  if ($ttype != "HOTP" && $ttype != "TOTP") {
    return FALSE;
  }
  if ($hexkey != "") {
    $hkey = $hexkey;
  }
  else {
    if ($key == "") {
      $key = $this
        ->createBase32Key();
    }
    $hkey = $this
      ->helperb322hex($key);
  }
  $token = $this
    ->internalGetData($username);
  $token["tokenkey"] = $hkey;
  $token["tokentype"] = $ttype;
  return $token;
}