-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice_confirmations.php
59 lines (51 loc) · 1.71 KB
/
device_confirmations.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
include('config.php');
session_start();
if(empty($_SESSION['uid']))
{
header("Location: register.php");
}
include('class/userClass.php');
$userClass = new userClass();
$userDetails=$userClass->userDetails($_SESSION['uid']);
$secret=$userDetails->google_auth_code;
$email=$userDetails->email;
require_once 'googleLib/GoogleAuthenticator.php';
$ga = new GoogleAuthenticator();
$qrCodeUrl = $ga->getQRCodeGoogleUrl($email, $secret,'9lessons Demos');
?>
<!DOCTYPE html>
<html>
<head>
<?php
include "head.php";
?>
<title>2-Step Verification using Google Authenticator</title>
<link rel="stylesheet" type="text/css" href="style.css" charset="utf-8" />
</head>
<body>
<div id="container" style="text-align:center">
<h1 style="font-size:3vw;">2-Step Verification using Google Authenticator</h1>
<div id='device'>
<p>Enter the verification code generated by Google Authenticator app on your phone.</p>
<div id="img">
<img src='<?php echo $qrCodeUrl; ?>' />
</div>
<form method="post" action="authenticate.php">
<label>Enter Google Authenticator Code</label>
<input type="text" name="code" />
<input type="submit" class="button"/>
</form>
</div>
<div style="text-align:center">
<h3>Get Google Authenticator on your phone</h3>
<a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8" target="_blank"><img class='app' src="images/iphone.png" /></a>
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en" target="_blank"><img class="app" src="images/android.png" /></a>
</div>
</div>
<br><br>
<form method="post" action="logout.php">
<center><input type="submit" class="btn btn-secondary" value="Logout" /></center>
</form>
</body>
</html>