This repository was archived by the owner on Mar 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify.php
More file actions
71 lines (62 loc) · 2.47 KB
/
verify.php
File metadata and controls
71 lines (62 loc) · 2.47 KB
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
<?php
$host = 'localhost:3306';
$conn = mysqli_connect($host, "root", "paswdmysqlllol29193093KK","nwv_api");
if(! $conn )
{
die("2");
}
if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['hash']) && !empty($_GET['hash'])){
// Verify data
$email = filter_input(INPUT_GET, "email", FILTER_SANITIZE_EMAIL); // Set email variable
$hash = filter_input(INPUT_GET, "hash", FILTER_SANITIZE_STRING); // Set hash variable
$email = $conn->real_escape_string($email);
$hash = $conn->real_escape_string($hash);
$sql = "SELECT * FROM user_data WHERE email_address='$email' AND activate_hash='$hash'";
$result = $conn->query($sql);
if($result->num_rows > 0){
// We have a match, activate the account
$sql = "UPDATE user_data SET activated=1,activate_hash='activated' WHERE email_address='$email' AND activate_hash='$hash'";
if ($conn->query($sql) === TRUE) {
echo '<div class="container"><div class="success" style="background-color: #ddffdd;
border-left: 6px solid #4CAF50;">
<p><strong> Dein Account wurde erfolgreich aktiviert!</strong></p>
</div></div>';
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
}else{
// No match -> invalid url or account has already been activated.
echo '<div class="container"><div class="danger" style="background-color: #ffb5b5;
border-left: 6px solid #ff0000;">
<p><strong> The url is either invalid or you already have activated your account.</strong></p>
</div></div>';
}
}else{
// Invalid approach
echo '<div class="statusmsg">Invalid approach, please use the link that has been send to your email.</div>';
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<title>E-Mail Bestätigung - VTCManager</title>
<?php include 'basis_header.php'; ?>
</head>
<body>
<?php include 'navbar.php'; ?>
<footer class="footer">
<div class="container">
<div class="col-md-9 social-media">
<p class="pull-left">
<a href="https://vtc.northwestvideo.de/impressum">Impressum</a>|
<a href="https://vtc.northwestvideo.de/datenschutz">Datenschutz & Nutzungsbedingungen</a>
</p>
</div>
<div class="col-md-3">
<p class="pull-right">© NorthWestMedia 2019-2020</p>
</div>
</div>
</footer>
</body>
</html>