-
Notifications
You must be signed in to change notification settings - Fork 0
/
welcome.php
302 lines (285 loc) · 8.83 KB
/
welcome.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=0.7" />
<link rel="icon" type="image/jpg" href="img/logo.ico" />
<script
src="https://kit.fontawesome.com/64d58efce2.js"
crossorigin="anonymous"
></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="https://hariketsheth-project1.42web.io/js/sweetalert2.all.min.js"> </script>
<script src="https://hariketsheth-project1.42web.io/js/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="https://hariketsheth-project1.42web.io/css/sweetalert2.min.css" />
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<link rel="stylesheet" href="css/style.css" />
<script>
$(document).bind("contextmenu",function(e) {
e.preventDefault();
});
$(document).keydown(function(e){
if(e.which === 123){
return false;
}
});
</script>
<script language="text/javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
function disableclick(event){
if(event.button==2) {
alert(status);
return false; }
}
.</script>
<script>
document.addEventListener('contextmenu', event=> event.preventDefault());
document.onkeydown = function(e) {
if(event.keyCode == 123) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
return false;
}
}
</script>
<title>PRECHYK AIROLI</title>
</head>
<body oncontextmenu="return false;" bgcolor="#6a6a6e">
<?php
session_start();
require_once('connection.php');
$email=$_POST['uname'];
$test1=$_SESSION['connectiondb'];
$fetch_data = "SELECT * FROM prechyksecure WHERE username = '".$_POST['uname']."'";
$run_query = mysqli_query($con, $fetch_data);
$fetch_info = mysqli_fetch_assoc($run_query);
if (((strlen($_POST['uname']) == 0) && (strlen($_POST['pass']) == 0)))
{
echo "<script>Swal.fire('Stop There!',
'Without entering details, you cannot access anything. Your IP address is copied & sent to Cyber Security Team. If it was done by mistake, please do not click the button without entering details next time',
'warning'
).then((value) => {
location.href='index.php'
});</script>";
}
else if ((strlen($_POST['uname']) != 0) || (strlen($_POST['pass']) != 0) ) {
if(($_SESSION['connectiondb']=="false") ){
?>
<script>Swal.fire({
title: 'Internal Server Issue !!',
text: "We weren't able to connect to our servers at this point of time. Please try in some time.",
icon: 'error',
confirmButtonColor: '#d73',
confirmButtonText: 'Continue'
})
.then((value) => {
location.href='https://hariketsheth-project1.42web.io/index.php'
});
</script>
<?php
}
else if (($_SESSION['connectiondb']=="true")){
if ($_POST['uname']== $fetch_info['username'] && $_POST['pass']==$fetch_info['codekey'] && $fetch_info['role_1']=="active"){
$_SESSION['uname']=$_POST['uname'];
$_SESSION['last_login_timestamp'] = time();
$_SESSION['status']="active";
?>
<script>
swal.fire( 'Hi There! <?php echo $fetch_info['name']; ?>' ,
'You have successfully logged in.<br> Press the <b>OK</b> to continue to your account.<br>Please contact us if you face any difficulty.' ,
'success' )
.then((value) => {
location.href='welcome/account.php'
});
</script>
<?php
}
else if ($_POST['uname']== $fetch_info['username'] && $_POST['pass']==$fetch_info['codekey'] && $fetch_info['role_1']=="inactive"){
$_SESSION['uname']=$_POST['uname'];
$_SESSION['last_login_timestamp'] = time();
$_SESSION['status']="inactive";
?>
<script>Swal.fire({
title: 'Sorry, <?php echo $fetch_info['name']; ?>' ,
text: 'Your account is temporarily banned because of inactivity. Please notify us at hariket.sukeshkumar2020@gmail.com if you want to re-activate your account' ,
icon: 'warning',
confirmButtonColor: '#d73',
confirmButtonText: 'RE-ACTIVATE'
})
.then((value) => {
location.href='mailto:hariket.sukeshkumar2020@gmail.com'
location.href='index.php'
});
</script>
<?php
}
else if ( ($_POST['uname']==$fetch_info['username'] && $_POST['pass']!=$fetch_info['codekey']) && ((strlen($_POST['uname']) != 0) &&( (strlen($_POST['pass']) >= 6) ) )) {
?>
<script>
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: true
})
swalWithBootstrapButtons.fire({
title: 'Incorrect Password',
text: "Check the details sent on your mail. Have you entered correct Password?",
icon: 'info',
showCancelButton: true,
confirmButtonColor: '#ec3e13',
cancelButtonColor: '#00ad42',
confirmButtonText: 'No, made mistake!',
cancelButtonText: 'Yes, correct!',
reverseButtons: true
}).then((result) => {
if (result.value) {
swalWithBootstrapButtons.fire(
'Humans can make mistakes :)',
'You can enter the correct details and login to your account',
'success'
)
.then((value) => {
location.href='index.php'
});
} else if (
result.dismiss === Swal.DismissReason.cancel
) {
swalWithBootstrapButtons.fire(
'Sorry for the inconvenience',
'You can either write a mail at hariket.sukeshkumar2020@gmail.com',
'error'
)
.then((value) => {
location.href='index.php'
});
}
})</script>
<?php
}
else if ( ($_POST['uname']==$fetch_info['username'] && $_POST['pass']!=$fetch_info['codekey']) && ((strlen($_POST['pass']) > 0) &&( (strlen($_POST['pass']) < 6) ) )) {
?>
<script>Swal.fire({
title: 'PASSWORD ERROR:',
text: "We will not permit you to enter the Portal. If you have lost your password then you can contact us, <?php echo $fetch_info['name']; ?> !",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#06a944',
cancelButtonColor: '#68bf00',
confirmButtonText: 'Forgot Password'
}).then((result) => {
if (result.value) {
Swal.fire({
title: 'PASSWORD RECOVERY',
text: "<?php echo $fetch_info['name']; ?> proceed to contact us via mail. Please mention your name & username in the mail to get your password.",
icon: 'success',
confirmButtonText: 'Proceed'
})
.then((value) => {
window.open("mailto:hariket.sukeshkumar2020@gmail.com?subject=LOST MY PORTAL PASSWORD");
location.href='index.php'
});
}
else {
location.href='index.php'
}
}) </script>
<?php
}
else if ((strlen($_POST['pass']) > 0) && (strlen($_POST['uname']) == 0))
{
?>
<script>Swal.fire({
title: 'Where is your Username?',
text: "Without entering Username, we will not permit you to enter the Portal.",
icon: 'question',
showCancelButton: true,
confirmButtonColor: '#06a944',
cancelButtonColor: '#68bf00',
confirmButtonText: 'Lost my Username'
}).then((result) => {
if (result.value) {
Swal.fire(
'Not an Issue',
'Your data & assignments are still safe with us. Please write a mail at hariket.sukeshkumar2020@gmail.com to get your username',
'success'
)
.then((value) => {
window.open("mailto:hariket.sukeshkumar2020@gmail.com?subject=LOST MY PORTAL USERNAME");
location.href='index.php'
});
}
else {
location.href='index.php'
}
}) </script>
<?php
}
else if ((strlen($_POST['uname']) > 0) && (strlen($_POST['pass']) == 0))
{
?>
<script>Swal.fire({
title: 'Where is your Password?',
text: "Without entering Password, we will not permit you to enter the Portal.",
icon: 'question',
showCancelButton: true,
confirmButtonColor: '#06a944',
cancelButtonColor: '#68bf00',
confirmButtonText: 'Lost my Password'
}).then((result) => {
if (result.value) {
Swal.fire(
'Uhh.. Ohh !',
'Please write a mail at hariket.sukeshkumar2020@gmail.com to get your password. Please mention your username while requesting for password in the mail.',
'success'
)
.then((value) => {
window.open("mailto:hariket.sukeshkumar2020@gmail.com?subject=LOST MY PORTAL PASSWORD");
location.href='index.php'
});
}
else {
location.href='index.php'
}
}) </script>
<?php
}
else if (($_POST['uname']!= $fetch_info['username']) && (strlen($_POST['pass']) != 0) ){
echo "<script>swal.fire( 'Sorry !!' ,
'This username does not exist. If you are a new member, then please SIGN UP first' ,
'error' )
.then((value) => {
location.href='index.php'
});
</script>";
}
else {
echo "<script>swal.fire( 'Sorry !!' ,
'Error. Something unexpected as happened. Please wait, we will repair it soon' ,
'error' )
.then((value) => {
location.href='index.php'
});
</script>";
}
}
else {
echo "<script>location.href='index.php'</script>";
}
}
else
{
echo "<script>location.href='index.php'</script>";
}
?>
</body>
</html>