From: paulr Date: Wed, 17 Nov 2010 22:04:32 +0000 (+1100) Subject: renamed the main library X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=18f8e04423dfe377ac53a8b27bb717944ce411dc;p=ga4php.git renamed the main library --- 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 +?>