3 require_once("user_actions.php");
5 // first check for a token retreival
6 if(isset($_REQUEST["gettoken"])) {
7 $username = $_REQUEST["username"];
8 $otkid = $_REQUEST["otkid"];
9 $users = $myAC->getUsers();
12 foreach($users as $user) {
13 if($user["username"] == $username) {
14 $realname = $user["realname"];
19 if($realname == "") $realname = $username;
23 Hello <?php echo $realname?>, we're sorry, but your One Time Key has already been picked up or you
24 dont currently have a token. If you believe this in error, please contact the site admin immediately
25 as it could mean your key has been compromised.
34 Hello <?php echo $realname?>, we're sorry, but your One Time Key ID is not
35 the correct one, the URL you have been sent may be in error, please check with the site admin
40 // now actually pick up the key
41 if(isset($_REQUEST["ready"])) {
44 Hello <?php echo $realname?>, welcome to the One Time Key retreival site. Here is your<br>
45 One Time Key. Do not save this anywhere as it will compromise your account<br>
46 <li> Point your phones camera at the screen
47 <li> Watch the display until it locks onto the code
48 <li> Once the code has been scanned, the phone should return to the Google Authenticator with a 6 digit number presented, or a "get code" button.<br><hr>
49 <img src="?action=actuallygettoken&username=<?php echo $username?>&otkid=<?php echo $otkid ?>"><br>
51 Once you have the key, you may try logging into the user site <a href="index.php">here</a>
57 Hello <?php echo $realname?>, welcome to the One Time Key retreival site. Before we present<br>
58 your key, you must have your phone ready to accept it as the key will only be presented once.<br>
59 If your phone is not ready to accept the key, the key needs to be regenerated, so only proceed<br>
60 if you phone is on, you have clicked on "scan account barcode" and the phone is ready to<br>
61 scan, please proceed.<br>
63 If you are ready to proceed, click <a href="index.php?gettoken&username=<?php echo $username?>&ready=true&otkid=<?php echo $otkid?>">here</a>.
73 <h1>Welcome to the GAAS User Site</h1>
75 if(isset($_REQUEST["message"])) {
76 echo "<font color=\"green\">".$_REQUEST["message"]."</font>";
78 if(isset($_REQUEST["error"])) {
79 echo "<font color=\"red\">".$_REQUEST["error"]."</font>";
84 <form method="post" action="?action=login">
85 Username: <input type="text" name="username"><br>
86 Token Code: <input type="text" name="tokencode"><br>
87 <input type="submit" value="Login">
98 <hr><a href="?action=logout">Logout</a>