-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgradForgotPasswordConfirm.php
417 lines (393 loc) · 16.4 KB
/
gradForgotPasswordConfirm.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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
include 'gradForgotPasswordController.php';
if (isset($_SESSION['login_user'])) {
header("location: home.php");
}
?>
<!DOCTYPE html>
<!-- Website template by freewebsitetemplates.com -->
<html>
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<link href="dnsc.png" rel="icon" type="image/x-icon"/>
<meta content="Shahrukh Khan" name="author"/>
<meta content="Login System with Github using OAuth PHP and MySQL" name="description"/>
<meta content="php,mysql,Github,oauth,social logins,thesoftwareguy" name="keywords"/>
<meta content="Login System with Github using OAuth PHP and MySQL" name="title"/>
<meta content="user-scalable=0, width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" name="viewport"/>
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"/>
<link href="popupmodal/css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/mobile.css" rel="stylesheet" type="text/css"/>
<link href="css/styleGrad.css" rel="stylesheet" type="text/css"/>
<title>
DNSC - Confirm Reset Password
</title>
<link href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500" rel="stylesheet">
<!-- Bootstrap -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="bootstrap/html5shiv.js"></script>
<script src="bootstrap/respond.min.js"></script>
<![endif]-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- <script src="js/mobile.js" type="text/javascript"></script> -->
<script src="popupmodal/js/jquery-1.11.0.min.js" type="text/javascript">
</script>
<script src="popupmodal/js/jquery.leanModal.min.js" type="text/javascript">
</script>
<style>
/* Full-width input fields */
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Set a style for all buttons */
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
/* Extra styles for the cancel button */
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
/* Center the image and position the close button */
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container {
padding: 16px;
}
span.psw {
float: left;
padding-top: 16px;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
/* Add Zoom Animation */
.animate {
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
}
/* */
.link_guide {
color: #007577;
font-size: 18px;
padding: 0 46px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
</style>
</head>
<body>
<div id="header">
<h1>
<a href="home.php">
SOCIO-ECONOMIC PROFILING & GRADUATE TRACER SURVEY
</a>
</h1>
<ul id="navigation">
<li>
<a href="home.php">
Home
</a>
</li>
<li>
<a href="socioLogin.php">
Socio-Economic
</a>
<ul>
<li>
<a href="socioLogin.php">
Socio Form
</a>
</li>
</ul>
</li>
<li>
<a href="graduatesLogin.php">
Graduates
</a>
</li>
<li>
<a href="about.php">
About
</a>
</li>
</ul>
</div>
<div id="body">
<img src="images/socio.jpg" width="100%"/>
<?php if (isset($_GET['id']) && isset($_GET['key'])) {
?>
<?php
$connection = new mysqli("localhost", "root", "", "tryit");
$resetPasswordGradId = $_GET['id'];
$uuidToken = $_GET['key'];
// Get account data
$accountDataQuery = $connection->query("SELECT * FROM graduate WHERE id = '$resetPasswordGradId';");
// Check if reset account is exist
$resetPasswordCheckerQuery = $connection->query("SELECT * FROM gradResetPassword WHERE graduate_id = '$resetPasswordGradId' AND is_reset = '0';");
$accountDataRows = $accountDataQuery->num_rows;
$confirmPasswordRows = $resetPasswordCheckerQuery->num_rows;
$accountDataRowData = $accountDataQuery->fetch_assoc();
$confirmPasswordRowData = $resetPasswordCheckerQuery->fetch_assoc();
$passwordHash = password_verify($accountDataRowData['pass'], $uuidToken);
?>
<?php if ($confirmPasswordRows > 0 && $passwordHash) {?>
<?php if ($confirmPasswordRowData['is_reset'] == 0) {?>
<hr>
<h3 style="color: #077054; font-family: latoregular;">
<center>
FILL UP YOUR NEW PASSWORD IN THE FORM BELOW.
</center>
</h3>
</hr>
<fieldset>
<legend>
<h1 style="font-family: Century Gothic; font-size: 50px;">
Confirm New Password
</h1>
</legend>
<form class="modal-content animate" id="confirmResetPasswordForm" method="POST">
<div class="container">
<div class="form-control">
<label style="font-family: Century Gothic;">
<i aria-hidden="true" class="fa fa-address-book">
</i>
<b>
New Password
</b>
</label>
<input name="newAccountGradId" required="" type="hidden" value="<?php echo $resetPasswordGradId; ?>"/>
<input name="newAccountUuidToken" required="" type="hidden" value="<?php echo $uuidToken; ?>"/>
<input name="newAccountPassword" required="" type="password"/>
<p class="help-block error_cntnr" style="color: red;">
<?php echo $error; ?>
</p>
</div>
<button name="confirmResetPasswordSubmit" id="confirmResetPasswordSubmit" type="submit">
Reset Password
</button>
<br>
<br>
</br>
</br>
</div>
</form>
</fieldset>
<?php } else {?>
<hr>
<br>
<br>
<br>
<h3 style="color: #077054; font-family: latoregular;">
<center>
USER PASSWORD ALREADY RESET!
<br>
PLEASE USE THE LINKS BELOW TO REDIRECT.
</br>
</center>
</h3>
</br>
</br>
</br>
</hr>
<br>
<br>
<center>
<a class="link_guide" href="home.php">
Home
</a>
|
<a class="link_guide" href="login.php">
Login
</a>
|
<a class="link_guide" href="forgotPassword.php">
Forgot Password?
</a>
</center>
</br>
</br>
<?php }?>
<?php } else {?>
<hr>
<br>
<br>
<br>
<h3 style="color: #077054; font-family: latoregular;">
<center>
USER RESET PASSWORD TOKEN RECORD NOT FOUND!
<br>
PLEASE CONTACT THE ADMINISTRATOR.
</br>
</center>
</h3>
</br>
</br>
</br>
</hr>
<br>
<br>
<center>
<a class="link_guide" href="home.php">
Home
</a>
|
<a class="link_guide" href="login.php">
Login
</a>
|
<a class="link_guide" href="forgotPassword.php">
Forgot Password?
</a>
</center>
</br>
</br>
<?php }?>
<?php } else {?>
<hr>
<br>
<br>
<br>
<h3 style="color: #077054; font-family: latoregular;">
<center>
SOMETHING WENT WRONG WITH YOUR LINK!
</center>
</h3>
</br>
</br>
</br>
</hr>
<br>
<br>
<center>
<a class="link_guide" href="home.php">
Home
</a>
|
<a class="link_guide" href="login.php">
Login
</a>
|
<a class="link_guide" href="forgotPassword.php">
Forgot Password?
</a>
</center>
</br>
</br>
<?php }?>
</div>
<div class="alert alert-danger" id="alertError" style="width:250px; height:auto; bottom:0; right:10px; position:fixed; display:none; padding-top:15px; padding-right:25px;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><div id="alertHeaderText"><i class="icon fa fa-warning" id="alert_icon"></i>Error!</div></h4>
<div id="alertErrorText"></div>
</div>
<div id="footer">
<div>
<span>
Davao del Norte State College est. 1995
</span>
<p>
Brgy. New Visayas, Panabo City, Davao del Norte, Philippines, 8105. All rights reserved.
</p>
</div>
<div id="connect">
<a href="https://facebook.com" id="facebook" target="_blank">
Facebook
</a>
<a href="https://twitter.com" id="twitter" target="_blank">
Twitter
</a>
<a href="https://google.com" id="googleplus" target="_blank">
Google+
</a>
</div>
</div>
<script src="assets/js/forgotPassword.js" type="text/javascript">
</script>
</body>
</html>