-
Notifications
You must be signed in to change notification settings - Fork 1
/
forgotpassword1.php
executable file
·275 lines (215 loc) · 8.92 KB
/
forgotpassword1.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
<?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
$error="";
if(isset($_GET['username'])&&isset($_GET['code']))
{
$username = $_GET['username'];
$confirmcode=$_GET['code'];
$query = "SELECT * FROM users WHERE username = '{$username}'";
$result = mysqli_query($conn, $query);
confirm_query($result);
while ($row = mysqli_fetch_assoc($result)) {
$db_code = $row['confirm_code'];
$ectstamp= $row['ectstamp'];
$confirmed=$row['confirmed'];
}
$time=time();
if(($ectstamp+1800)<$time)
{
if($db_code==$confirmcode)
{
$query_update="UPDATE users SET ectstamp='0',confirm_code='0' WHERE username='{$username}'";
$result_update=mysqli_query($conn,$query_update);
}
redirect_to("linkexpire.php");
}
}
?>
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Cambuzz</title>
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Custom Fonts -->
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<!-- Animate CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.min.css" type="text/css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/creative.css" type="text/css">
<link rel="stylesheet" src="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" />
<link rel="stylesheet" type="text/css" href="css/background.css" />
<link rel="stylesheet" type="text/css" href="css/buttoncreatebuzz.css">
<script src="js/modernizr.custom.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
</head>
<body id="page-top">
<ul class="cb-slideshow">
<li><span>Image 01</span>
</li>
<li><span>Image 02</span>
</li>
<li><span>Image 03</span>
</li>
<li><span>Image 04</span>
</li>
<li><span>Image 05</span>
</li>
<li><span>Image 06</span>
</li>
</ul>
<header>
<div class="header-content">
<div class="header-content-inner">
<div class="heading-text animated fadeInUp">cambu<span class="animated tada">zz</span></div>
<p class="animated fadeInUp"><span style="font-size: 20px;"># </span>VITC Chapter</p>
</div>
</div>
<div class="mockup-content">
<div class="morph-button morph-button-modal morph-button-modal-2 morph-button-fixed login">
<button type="button" style="background-color: white;">Change Password</button>
<div class="morph-content" style="background-color: white;">
<div>
<div class="content-style-form content-style-form-1" id="logindiv1">
<span class="icon icon-close">Close the dialog</span>
<h2 style="font-size:20px;">Change Password</h2>
<form class="loginform">
<input type="text" style="display:none;" id="username" value="<?php echo $_GET['username'];?>">
<p>
<label>New Password</label>
<input type="password" id="password" required name="password" value="" />
</p>
<p>
<label>Confirm Password</label>
<input type="password" id="cpassword" required name="cpassword" value="" />
</p>
<p>
<div id="tempdiv" value=""></div>
</p>
<p>
<input type="submit" class="btn btn-danger" name="submit" value="Change Password" style="text-align: center;">
</p>
</form>
</div>
</div>
</div>
</div>
<!-- Sign Up Button -->
<!-- morph-button -->
</div>
</form>
</header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/classie/1.0.1/classie.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/uiMorphingButton_fixed.js"></script>
<script src="HTTP://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
(function() {
var docElem = window.document.documentElement,
didScroll, scrollPosition;
// trick to prevent scrolling when opening/closing button
function noScrollFn() {
window.scrollTo(scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0);
}
function noScroll() {
window.removeEventListener('scroll', scrollHandler);
window.addEventListener('scroll', noScrollFn);
}
function scrollFn() {
window.addEventListener('scroll', scrollHandler);
}
function canScroll() {
window.removeEventListener('scroll', noScrollFn);
scrollFn();
}
function scrollHandler() {
if (!didScroll) {
didScroll = true;
setTimeout(function() {
scrollPage();
}, 60);
}
};
function scrollPage() {
scrollPosition = {
x: window.pageXOffset || docElem.scrollLeft,
y: window.pageYOffset || docElem.scrollTop
};
didScroll = false;
};
scrollFn();
[].slice.call(document.querySelectorAll('.login')).forEach(function(bttn) {
new UIMorphingButton(bttn, {
closeEl: '.icon-close',
onBeforeOpen: function() {
// don't allow to scroll
noScroll();
},
onAfterOpen: function() {
// can scroll again
canScroll();
},
onBeforeClose: function() {
// don't allow to scroll
noScroll();
},
onAfterClose: function() {
// can scroll again
canScroll();
}
});
});
// for demo purposes only
[].slice.call(document.querySelectorAll('form button')).forEach(function(bttn) {
bttn.addEventListener('click', function(ev) {
ev.preventDefault();
});
});
})();
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.loginform').on('submit',function()
{
var p=$("#password").val();
var p1=$("#cpassword").val();
var username=$("#username").val();
if(p==p1)
{
var msg;
$.ajax({
method: "POST",
url: "forgotpassword2.php",
data: { username:username,password:p }
})
.done(function(msg) {
if(msg="done")
{
window.location.href="index.php";
}
});
}
else
$("#tempdiv").html("Passwords do not match");
return false;
});
});
</script>
</body>
</html>
<?php
if (isset ($conn)){
mysqli_close($conn);
}
?>