-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetPassword.php
244 lines (232 loc) · 12.5 KB
/
resetPassword.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
<?php
$configs = include('./php/dbconf.php');
$servername = $configs->servername;
$username = $configs->username;
$dbpassword = $configs->dbpassword;
$dbname = $configs->dbname;
// 1. Create a database connection
$connection = new mysqli($servername, $username, $dbpassword, $dbname);
if ($connection->connect_errno) {
printf("Connect failed: %s\n", $connection->connect_error);
exit();
}
// 2. Select a database to use
$db_select = mysqli_select_db($connection, $dbname);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>A3Michigan</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="./layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">
<link rel="stylesheet" href="./css/bootstrap-min.css">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body id="top">
<div class="container">
<nav id="" class="navbar navbar-inverse bg-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">A3M</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="index.html">HOME</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">ABOUT<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="whatwedo.html">WHAT WE DO</a></li>
<li><a href="index.html#services">SERVICES</a></li>
<li><a href="feedback.php">FEEDBACK</a></li>
</ul>
</li>
<!--<li class="active"><a href="survey.html">SURVEY</a></li>-->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">FORMS<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="membership-form.html">MEMBERSHIP</a></li>
<li><a href="bylaws.html">BYLAWS</a></li>
</ul>
</li>
<li><a href="donation.php">DONATE</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">GALLERIES<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="algeria.html">ALGERIA</a></li>
<li><a href="usa.html">USA</a></li>
<li><a href="michigan.html">MICHIGAN</a></li>
</ul>
</li>
<li><a href="events.html">EVENTS</a></li>
<li><a href="news.html">NEWS</a></li>
<li><a href="#contact">CONTACT</a></li>
<li><a href="./membership.php">REGISTER</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user" aria-hidden="true"></i> ACCOUNT <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="profile.php">PROFILE</a></li>
<li><a href="login.php">LOGIN</a></li>
<li><a href="logout.php">LOGOUT</a></li>
</ul>
</li>
</ul>
</div>
</nav>
</div>
<div class="backstretchOverlay">
<section id="breadcrumb" class="hoc clear">
<div class="bread-headder">Reset Password</div>
<ul>
<li><a href="./index.html">Home</a></li>
<li><a href="./resetPassword.php">Reset Password</a></li>
</ul>
</section>
</div>
<div class="wrapper row3">
<main class="hoc container clear">
<br>
<div class="col-xs-12 col-sm-10 col-md-8 col-sm-offset-2 col-md-offset-2">
<div class="row" >
<div class="col-md-12">
<form name="frmForgot" action="" id="frmForgot" method="post">
<?php
if (isset($_GET['action'])) {
if ($_GET['action'] == "reset" && $_GET['id']) {
$encrypt = mysqli_real_escape_string($connection, $_GET['encrypt']);
if(md5(1290*3+$_GET['id']) === $encrypt) {
?>
<div class="form-group" style="margin-bottom: 25px" >
<input type="password" class="form-control" name="password" id="password" placeholder="Password" required>
</div>
<div class="form-group" style="margin-bottom: 25px" >
<input type="password" class="form-control" name="confirmPassword" id="confirmPassword" placeholder="Confirm Password" required>
</div>
<input class="btn btn-lg btn-primary btn-block" value="Submit" type="submit" name="reset-password" id="reset-password">
<?php
}
}
}
if ($_POST) {
$user_id = $_GET['id'];
$newPass = $_POST["password"];
if($newPass === $_POST["confirmPassword"]) {
$query = "SELECT * FROM users where userID='$user_id'";
$result = mysqli_query($connection, $query);
$row = mysqli_fetch_array($result, MYSQLI_NUM);
if ($row[0]) {
$query = "update users set password='$newPass' where userID='$user_id'";
mysqli_query($connection, $query);
echo '<div class="alert alert-success">
<strong>Success!</strong>
Your password changed successfully <a href="https://www.a3michigan.org/login.php">click here to login</a>.
</div>';
} else {
echo '<div class="alert alert-danger">
<strong>Error!</strong> Something went wrong with your request, please try again. <a href="https://www.a3michigan.org/recoverPassword.php">Forget Password?</a>
</div>';
}
}
else {
echo '<div class="alert alert-danger">
<strong>Error!</strong> The Confirmation password you entered does not match!!.
</div>';
}
}
?>
</form>
</div>
</div>
</div>
</main>
</div>
<!-- ################################################## Footer ################################# -->
<div class="footerbg" id="contact">
<footer id="footer" class="hoc clear">
<div class=" col-lg-4 col-md-4 col-sm-12">
<h6 class="heading">A3M</h6>
<p>A3M is an Algerian-American association that serves the needs of the Algerian-American Community in Michigan.</p>
<!-- <ul class="faico clear">-->
<!-- <li><a class="faicon-facebook" href="#"><i class="fa fa-facebook"></i></a></li>-->
<!-- <li><a class="faicon-twitter" href="#"><i class="fa fa-twitter"></i></a></li>-->
<!-- <li><a class="faicon-dribble" href="#"><i class="fa fa-dribbble"></i></a></li>-->
<!-- <li><a class="faicon-linkedin" href="#"><i class="fa fa-linkedin"></i></a></li>-->
<!-- <li><a class="faicon-google-plus" href="#"><i class="fa fa-google-plus"></i></a></li>-->
<!-- <li><a class="faicon-vk" href="#"><i class="fa fa-vk"></i></a></li>-->
<!-- </ul>-->
</div>
<div class=" col-lg-4 col-md-4 col-sm-12">
<h6 class="heading">Address and Phone Numbers</h6>
<ul class="nospace btmspace-30 linklist contact">
<li><i class="fa fa-map-marker"></i>
<address>
Algerian-American Association
of Michigan
<br> 3385 Buckingham Trl
<br> W Bloomfield, MI 48323
</address>
</li>
<li><i class="fa fa-envelope-o"></i> [email protected]</li>
</ul>
</div>
<div class=" col-lg-4 col-md-4 col-sm-12">
<h6 class="heading">Location</h6>
<script src='https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyAz02yCRNu3uItDorLGL2s3tTJX6ye9DeU'></script>
<div>
<div id='gmap_canvas' style='height:335px;'></div>
<style>#gmap_canvas img {
max-width: none !important;
background: none !important
}</style>
</div>
<a href='http://maps-generator.com/'>maps-generator.com</a>
<script type='text/javascript'
src='https://embedmaps.com/google-maps-authorization/script.js?id=edb9cbe68b8845fb95f39b7df84c61d04cc2fbd7'></script>
<script type='text/javascript'>function init_map() {
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(42.331427, -83.0457538),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('gmap_canvas'), myOptions);
marker = new google.maps.Marker({
map: map, position: new google.maps.LatLng(42.331427, -83.0457538)});
infowindow = new google.maps.InfoWindow({content: '<strong></strong><br><br> Detroit<br>'});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker);
});
infowindow.open(map, marker);
}
google.maps.event.addDomListener(window, 'load', init_map);</script>
</div>
<!-- ################################################################################################ -->
</footer>
</div>
<div class="wrapper row5">
<div id="copyright" class="hoc clear">
<p class="fl_left">Copyright © 2016 - All Rights Reserved - <a href="http://www.a3michigan">www.a3michigan.com</a>
</p>
</div>
</div>
<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>
<div style="z-index: 99999;position: fixed;bottom: 20px;left: 20px;">
<a href="./donation.php">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" alt="PayPal - The safer, easier way to pay online!">
</a>
</div>
<!-- JAVASCRIPTS -->
<script src="./layout/scripts/jquery.backtotop.js"></script>
<script src="./layout/scripts/jquery.mobilemenu.js"></script>
<script src="./layout/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/backstretch.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
<script type="text/javascript" src="./js/fitText.js"></script>
</body>
</html>