-
Notifications
You must be signed in to change notification settings - Fork 4
/
verify.php
105 lines (83 loc) · 3.36 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
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
97
98
99
100
101
102
103
104
105
<?php
/*
Copyright 2020 FWBer.com
This file is part of FWBer.
FWBer is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FWBer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero Public License for more details.
You should have received a copy of the GNU Affero Public License
along with FWBer. If not, see <https://www.gnu.org/licenses/>.
*/
include("_init.php");
include("_secrets.php");
include("_names.php");
include("_debug.php");
?>
<!doctype html>
<html lang="en">
<head>
<title><?php require_once("_names.php"); echo getSiteName(); ?> - Verify Email Address<?php require_once("_names.php"); echo getTitleTagline(); ?></title>
<?php include("head.php");?>
</head>
<body class="d-flex flex-column h-100">
<?php include("h.php");?>
<div class="col-sm-12 my-auto text-center">
<?php
if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['verifyHash']) && !empty($_GET['verifyHash']))
{
$db = mysqli_connect($dburl,$dbuser,$dbpass);
if(!$db)exit(mysqli_connect_error());
$email = mysqli_escape_string($db,$_GET['email']); // Set email variable
$verifyHash = mysqli_escape_string($db,$_GET['verifyHash']); // Set hash variable
$dbquery = mysqli_query($db,"SELECT email, verifyHash, verified FROM ".$dbname.".users WHERE email='".$email."' AND verifyHash='".$verifyHash."' AND verified='0'");
$matches = mysqli_num_rows($dbquery);
if($matches>0)
{
mysqli_query($db,"UPDATE ".$dbname.".users SET verified='1' WHERE email='".$email."' AND verifyHash='".$verifyHash."' AND verified='0'");
echo '<meta http-equiv="refresh" content="3;url='.getSiteURL().'/signin"/>';
?>
<div style="color:#0096ff;font-size:14pt;text-shadow:#aad 1px 1px 1px;">
Your email address has been verified.<br><br>
<div style="color:#000;font-size:12pt;text-shadow:#aaa 1px 1px 1px;">
You can now sign in.<br>
<br>
</div>
</div>
<?php
}
else
{
$dbquery = mysqli_query($db,"SELECT email, verifyHash, verified FROM ".$dbname.".users WHERE email='".$email."' AND verifyHash='".$verifyHash."' AND verified='1'");
$matches = mysqli_num_rows($dbquery);
if($matches>0)
{
?>
<div style="color:#000;font-size:12pt;text-shadow:#aaa 1px 1px 1px;">
Your email address has already been verified. Please try signing in.<br>
<br>
</div>
<?php
echo '<meta http-equiv="refresh" content="3;url='.getSiteURL().'/signin"/>';
}
else
{
?>
<div style="color:#000;font-size:12pt;text-shadow:#aaa 1px 1px 1px;">
Your email address could not be found. Please register an account..<br>
<br>
</div>
<?php
echo '<meta http-equiv="refresh" content="3;url='.getSiteURL().'/join"/>';
}
}
}
?>
</div>
<?php include("f.php");?>
</body>
</html>