X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=example%2Findex.php;fp=example%2Findex.php;h=d70e54212a5aaf5d3dda971fa044141d56f52ea9;hp=b750dbc53f99b3b77b1a36d5462962e35d818048;hb=0c40f0be4dd01156a31dec9c91958170061bb2f8;hpb=b0ca30634151e46bd86cd82993a6d22ffc6073bc 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: