Skip to content

Commit dc43410

Browse files
Added Email Verification Script
1 parent 1a755ba commit dc43410

1 file changed

Lines changed: 123 additions & 0 deletions

File tree

account/email_verification.php

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<html>
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=0.7" />
7+
<link rel="icon" type="image/jpg" href="https://athena-dbms.42web.io/account/img/logo.ico" />
8+
<script
9+
src="https://kit.fontawesome.com/64d58efce2.js"
10+
crossorigin="anonymous"
11+
></script>
12+
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
13+
<script src="https://athena-dbms.42web.io/account/js/sweetalert2.all.min.js"> </script>
14+
<script src="https://athena-dbms.42web.io/account/js/jquery-3.4.1.min.js"></script>
15+
<link rel="stylesheet" href="https://athena-dbms.42web.io/account/css/sweetalert2.min.css" />
16+
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
17+
<link rel="stylesheet" href="css/style.css" />
18+
<script>
19+
$(document).bind("contextmenu",function(e) {
20+
e.preventDefault();
21+
});
22+
$(document).keydown(function(e){
23+
if(e.which === 123){
24+
return false;
25+
}
26+
});
27+
</script>
28+
<script language="text/javascript">
29+
document.onmousedown=disableclick;
30+
status="Right Click Disabled";
31+
function disableclick(event){
32+
if(event.button==2) {
33+
alert(status);
34+
return false; }
35+
}
36+
.</script>
37+
<script>
38+
document.addEventListener('contextmenu', event=> event.preventDefault());
39+
document.onkeydown = function(e) {
40+
if(event.keyCode == 123) {
41+
return false;
42+
}
43+
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
44+
return false;
45+
}
46+
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
47+
return false;
48+
}
49+
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
50+
return false;
51+
}
52+
}
53+
</script>
54+
55+
<title>ATHENA</title>
56+
</head>
57+
<body oncontextmenu="return false;" bgcolor="#6a6a6e">
58+
<?php
59+
include 'connection.php';
60+
if(!empty($_GET['code']) && isset($_GET['code']))
61+
{
62+
$code=$_GET['code'];
63+
$sql=mysqli_query($con,"SELECT * FROM users WHERE activationcode='$code'");
64+
$num=mysqli_fetch_array($sql);
65+
if($num>0)
66+
{
67+
68+
$st=0;
69+
$result =mysqli_query($con,"SELECT id FROM users WHERE activationcode='$code' and status='$st'");
70+
$result4=mysqli_fetch_array($result);
71+
72+
if($result4>0)
73+
{
74+
$st=1;
75+
$result1=mysqli_query($con,"UPDATE users SET status='$st' WHERE activationcode='$code'");
76+
echo "<script>
77+
Swal.fire(
78+
'Account Verified and Activated !!',
79+
'You have verified your account and are a part of Athena family :)<br><br><b>Please login with the username and password sent on your registered mail along with verification link.</b>',
80+
'success'
81+
82+
).then((value) => {
83+
location.href='https://athena-dbms.42web.io/account/login.php'
84+
});</script>";
85+
}
86+
else
87+
{
88+
echo "<script>
89+
Swal.fire('Already Verfied !!',
90+
'You have already verified your account and are a part of Athena family :)<br><br><b>Please directly login with the username and password sent on your registered mail along with verification link.</b>',
91+
'info'
92+
93+
).then((value) => {
94+
location.href='https://athena-dbms.42web.io/account/login.php'
95+
});</script>";
96+
}
97+
}
98+
else
99+
{
100+
echo "<script>
101+
Swal.fire('Wrong Activation Code',
102+
'Uhh.. Ohh.. <br>Seems like the verification link has expired for your account.<br><br><b>Please forward the mail immediately to hariket.sukeshkumar2020@gmail.com for verification.</b>',
103+
'question'
104+
105+
).then((value) => {
106+
location.href='https://athena-dbms.42web.io/account/login.php'
107+
});</script>";
108+
}
109+
}
110+
else{
111+
echo "<script>
112+
Swal.fire('Stop There!',
113+
'You are trying to access a page for which the user do not have proper permission. <br><b>Do not try to access this page without permission again !</b>',
114+
'error'
115+
116+
).then((value) => {
117+
location.href='https://athena-dbms.42web.io/account/login.php'
118+
});</script>";
119+
}
120+
121+
?>
122+
</body>
123+
</html>

0 commit comments

Comments
 (0)