X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=lib%2Fga4php.php;fp=lib%2Flib.php;h=8bc5946d6db8ac2be21d96926ab43b107a1a1e72;hp=558e2159dca76fbf13db290d07cafb127d5e7401;hb=18f8e04423dfe377ac53a8b27bb717944ce411dc;hpb=df47980449f90e898dc08c6e0c2752872cbdb0bc diff --git a/lib/lib.php b/lib/ga4php.php similarity index 98% rename from lib/lib.php rename to lib/ga4php.php index 558e215..8bc5946 100644 --- a/lib/lib.php +++ b/lib/ga4php.php @@ -43,7 +43,8 @@ abstract class GoogleAuthenticator { // set the token type the user it going to use. // this defaults to HOTP - we only do 30s token // so lets not be able to set that yet - function setupTokenType($username, $tokentype) { + function setTokenType($username, $tokentype) { + $tokentype = strtoupper($tokentype); if($tokentype!="HOTP" and $tokentype!="TOTP") { $errorText = "Invalid Token Type"; return false; @@ -58,9 +59,10 @@ abstract class GoogleAuthenticator { // create "user" with insert - function setUser($username, $ttype="HOTP", $key = "") { + function setUser($username, $ttype="HOTP", $key = "", $hexkey="") { if($key == "") $key = $this->createBase32Key(); $hkey = $this->helperb322hex($key); + if($hexkey != "") $hkey = $hexkey; $token = $this->internalGetData($username); $token["tokenkey"] = $hkey; @@ -374,4 +376,4 @@ abstract class GoogleAuthenticator { * 5: key invalid */ } -?> \ No newline at end of file +?>