-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify.php
68 lines (67 loc) · 2.78 KB
/
verify.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
---
layout: wrapper
title: Verify
---
<div class="table" style="width: 100%">
<div class="blurBg" style="background-image: url('{{ site.baseurl_root }}/assets/img/bgLogin.png'); background-position: center top; z-index: -1; height: 99%"></div>
<div class="tr">
<div class="td" style="height: 80px"></div>
</div>
<div class="tr">
<div class="td">
<div style="margin-bottom: 10%">
<?php
$email = $_GET['email'];
if (!isset($email)) {
$headline = "Registered successfully";
$content = "A verification link will be sent to your email address. Use it to activate your account.";
} else {
$sql = "SELECT * FROM users WHERE SHA1(email) = '$email'";
$result = mysqli_query($db, $sql);
if (mysqli_num_rows($result) == 0) {
$headline = "Error";
$content = '<div class="alertRed">THERE IS NO ACCOUNT REGISTERED WITH THIS EMAIL ADDRESS!</div>';
} else {
$sql = "SELECT verified FROM users WHERE SHA1(email) = '$email' AND verified = 1";
$result = mysqli_query($db, $sql);
if (mysqli_num_rows($result) >= 1) {
while ($row = $result->fetch_assoc()) {
$_SESSION["verified"] = $row["verified"];
$_SESSION["date_verified"] = $row["date_verified"];
}
$headline = "Already verified";
$content = 'Your account is already verified.
<div style="padding: 25px 0px 15px 0px; display: inline-block; text-shadow: none">
<a class="button" href="./">Home</a>
<a class="button" href="account.php">Manage Your Account</a>
</div>';
} else {
$sql = "UPDATE users SET verified = 1 WHERE SHA1(email) = '$email'";
mysqli_query($db, $sql);
$sql = "UPDATE users SET date_verified = now() WHERE SHA1(email) = '$email'";
mysqli_query($db, $sql);
$sql = "SELECT * FROM users WHERE SHA1(email) = '$email'";
$result = mysqli_query($db, $sql);
while ($row = $result->fetch_assoc()) {
$_SESSION["verified"] = $row["verified"];
$_SESSION["date_verified"] = $row["date_verified"];
}
$headline = "Verified successfully";
$content = 'You can now use your account.
<div style="padding: 25px 0px 15px 0px; display: inline-block; text-shadow: none">
<a class="button" href="./">Home</a>
<a class="button" href="account.php">Manage Your Account</a>
</div>';
}
}
$db->close();
}
?>
<form style="width: 350px; margin: auto; padding: 15px 15px 15px 15px; text-align: center; text-shadow: 1px 1px 1px #000">
<font size="5" color="#ccc" style="border-bottom: 1px solid rgba(200, 200, 200, 0.75)"> <?php echo $headline; ?> </font><br><br><br>
<?php echo $content; ?>
</form>
</div>
</div>
</div>
</div>