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<br>
24 already been picked up or you dont currently have a token. If you believe<br>
25 this in error, please contact the site admin immediately as it could mean<br>
26 your key has been compromised.<br>
35 Hello <?php echo $realname?>, we're sorry, but your One Time Key ID is not
36 the correct one, the URL you have been sent may be in error, please check with the site admin
41 // now actually pick up the key
42 if(isset($_REQUEST["ready"])) {
45 Hello <?php echo $realname?>, welcome to the One Time Key retreival site. Here is your<br>
46 One Time Key. Do not save this anywhere as it will compromise your account<br>
47 <li> Point your phones camera at the screen
48 <li> Watch the display until it locks onto the code
49 <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>
50 <img src="?action=actuallygettoken&username=<?php echo $username?>&otkid=<?php echo $otkid ?>"><br>
52 Once you have the key, you may try logging into the user site <a href="index.php">here</a>
58 Hello <?php echo $realname?>, welcome to the One Time Key retreival site. Before we present<br>
59 your key, you must have your phone ready to accept it as the key can only be presented once.<br>
60 If your phone is not ready to accept the key, the key needs to be regenerated, so only proceed<br>
61 if you phone is on, you have clicked on "scan account barcode" and the phone is ready to<br>
64 If you are ready to proceed, click <a href="index.php?gettoken&username=<?php echo $username?>&ready=true&otkid=<?php echo $otkid?>">here</a>.
74 <h1>Welcome to the GAAS User Site</h1>
76 if(isset($_REQUEST["message"])) {
77 echo "<font color=\"green\">".$_REQUEST["message"]."</font>";
79 if(isset($_REQUEST["error"])) {
80 echo "<font color=\"red\">".$_REQUEST["error"]."</font>";
85 <form method="post" action="?action=login">
86 Username: <input type="text" name="username"><br>
87 Token Code: <input type="text" name="tokencode"><br>
88 <input type="submit" value="Login">
96 Welcome, you have successfully logged into the<br>
97 user site, but there is no content here to view.<br>
98 Later, this site will be where you might resync your<br>
99 token or change pin codes and the like<br>
102 <hr><a href="?action=logout">Logout</a>