diff options
author | Christian Stocker <me@chregu.tv> | 2011-02-21 16:32:34 +0100 |
---|---|---|
committer | Christian Stocker <me@chregu.tv> | 2011-02-21 16:32:34 +0100 |
commit | 25aa9ae23832ce0b812fddb7d930b7e15e9dca31 (patch) | |
tree | bb87a476b59c855db511e016ae4cdd26ca512eed /example.php | |
download | GoogleAuthenticator.php-25aa9ae23832ce0b812fddb7d930b7e15e9dca31.zip GoogleAuthenticator.php-25aa9ae23832ce0b812fddb7d930b7e15e9dca31.tar.gz GoogleAuthenticator.php-25aa9ae23832ce0b812fddb7d930b7e15e9dca31.tar.bz2 |
first commit
Diffstat (limited to 'example.php')
-rw-r--r-- | example.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/example.php b/example.php new file mode 100644 index 0000000..1855972 --- /dev/null +++ b/example.php @@ -0,0 +1,28 @@ +<?php +include_once("GoogleAuthenticator.php"); + +$secret = 'XVQ2UIGO75XRUKJO'; +$time = floor(time() / 30); +$code = "846474"; + +$g = new GoogleAuthenticator(); + +print "Current Code is: "; +print $g->getCode($secret); + +print "\n"; + +print "Check if $code is valid: "; + +if ($g->checkCode($secret,$code)) { + print "YES \n"; +} else { + print "NO \n"; +} + +$secret = $g->generateSecret(); +print "Get a new Secret: $secret \n"; + +print "The QR Code for this secret (to scan with the Google Authenticator App: \n"; +print $g->getURL('chregu','example.org',$secret); +print "\n";
\ No newline at end of file |