This repository has been archived by the owner on Oct 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
confirm.php
executable file
·96 lines (90 loc) · 4.08 KB
/
confirm.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html>
<?php
require 'php/database.php';
$db = new DB();
if (isset($_GET['action'])) {
if ($_GET['action'] == 'resend') {
if (isset($_POST['email'])) {
$email = $db->getConnection()->escape_string($_POST['email']);
// Resend Email
$res = $db->simpleQuery("SELECT * FROM vertification_tokens WHERE usermail='" . $email . "' LIMIT 1");
if ($res) {
if ($res->num_rows == 0) {
echo "No Confirmation tokens found for that account!";
} else {
$row = $res->fetch_object();
$text = 'Hi, Thank you for registering. In Order to access your Dashboard, you need to confirm your account. Paste the code below on the website nd continue.
<br><br>Here is your registration code:<br>
' . $row->token . '<br><br><br>Best Regards, KIS Developer Team';
$db->mail($email, "Confirmation Token", $text);
}
}
}
}
}
?>
<head>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" sizes="76x76" href="assets/favicon.png"/>
<link rel="icon" type="image/png" href="assets/favicon.png"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>Confirmation</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
<meta name="viewport" content="width=device-width"/>
<meta charset="utf-8"/>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Material Dashboard CSS -->
<link href="assets/css/material-dashboard.css?v=1.2.0" rel="stylesheet"/>
<!-- CSS for Demo Purpose, don't include it in your project -->
<link href="assets/css/demo.css" rel="stylesheet"/>
<!-- Fonts and icons -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300|Material+Icons' rel='stylesheet'
type='text/css'>
<link href="assets/css/style.css" rel="stylesheet"/>
</head>
<body>
<div class="row-fluid">
<?php
if (isset($_POST['email']) && isset($_POST['token'])) {
$email = $db->getConnection()->escape_string($_POST['email']);
$token = $db->getConnection()->escape_string($_POST['token']);
$res = $db->simpleQuery("SELECT * FROM vertification_tokens WHERE usermail='" . $email . "' AND token='" . $token . "' LIMIT 1");
if ($res) {
if ($res->num_rows == 0) {
echo "Wrong confirmation key!";
} else {
$db->simpleQuery("UPDATE users SET verified=1 WHERE email='" . $email . "'");
header("Location: index.php");
}
}
}
?>
<div class="col-md-4 col-md-offset-4">
<form class="navbar-form navbar-left form-signin" method="post" action="confirm.php">
<h3 class="form-signin-heading">Confirmation</h3>
<hr class="colorgraph">
<br>
<input type="text" value="" name="email" placeholder="email" class="form-control" autofocus="" required/>
<br>
<input type="text" value="" name="token" maxlength="5" placeholder="Confirmation key" class="form-control"
autofocus="" required/>
<button type="submit" value="confirm" name="Submit" class="btn btn-lg btn-primary btn-block"/>
Confirm!</button>
</form>
</div>
<div class="col-md-4 col-md-offset-4">
<form class="navbar-form navbar-left form-signin" method="post" action="confirm.php?action=resend">
<h3 class="form-signin-heading">Resend Mail</h3>
<hr class="colorgraph">
<br>
<input type="text" value="" name="email" placeholder="email" class="form-control" autofocus="" required/>
<br>
<button type="submit" value="confirm" name="Submit" class="btn btn-lg btn-primary btn-block"/>
Resend!</button>
</form>
</div>
</div>
</body>
</html>