From 0c40f0be4dd01156a31dec9c91958170061bb2f8 Mon Sep 17 00:00:00 2001 From: paulr Date: Tue, 16 Nov 2010 17:26:26 +1100 Subject: [PATCH] moved to abstract class with overloading. --- example/index.php | 55 ++++++++++++++++++++----- example/tokenstore.php | 107 ++++++++++++++++------------------------------- lib/lib.php | 34 +++++++++------ 3 files changed, 101 insertions(+), 95 deletions(-) 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: