From: paulr Date: Tue, 16 Nov 2010 06:26:26 +0000 (+1100) Subject: moved to abstract class with overloading. X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=commitdiff_plain;h=0c40f0be4dd01156a31dec9c91958170061bb2f8 moved to abstract class with overloading. --- diff --git a/example/index.php b/example/index.php index b750dbc..d70e542 100644 --- a/example/index.php +++ b/example/index.php @@ -1,10 +1,7 @@ query($sql); } +require_once("tokenstore.php"); + +$ga = new myGoogleAuth(); + + + + ?>

Example Page for GA4PHP

home
"; if(strlen($username)<3) { @@ -54,12 +59,13 @@ if(isset($_REQUEST["action"])) { //$keyinhex = $ga->helperb322hex($key); //$url = urlencode($ga->createURL($username, $key, $ttype)); //echo "QRCode for user \"$username\" is or type in $key (google authenticator) or $keyinhex (for most other otp's)"; - $sql = "insert into users values (NULL, '$username', 'TOTP', 'ASDF', '0')"; + $sql = "insert into users values (NULL, '$username', '$fullname', '0')"; $dbobject->query($sql); } echo "
"; break; case "provisiontoken": + error_log("in provision"); $username = $_REQUEST["username"]; $ttype = $_REQUEST["ttype"]; $key = $ga->setUser($username, "", $ttype); @@ -92,19 +98,38 @@ if(isset($_REQUEST["action"])) { } ?> +

Our Users

+ + +query("select * from users"); +foreach($res as $row) { + $username = $row["users_username"]; + $fullname = $row["users_fullname"]; + echo ""; +} + +?> +
UsernameFullName
$username$fullname

Destroy the DB

-This is UNDOABLE - but this is a test system, so you dont care +This is not UNDOABLE - but this is a test system, so you dont care +

Create a User:

Username:
+Full Name:

+ +
+ +

Provision Token

Username:

+ +
+ +

Test Token

Username:

+ +
+ +

Resync Code (only valid for HOTP codes)

Username: