/
resetpassword.php
65 lines (57 loc) · 1.99 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
<?php
include_once "common/base.php";
if(isset($_GET['v']) && isset($_GET['e']))
{
include_once "inc/class.users.inc.php";
$users = new FocusUsers($db);
$ret = $users->verifyAccount();
}
elseif(isset($_POST['v']))
{
include_once "inc/class.users.inc.php";
$users = new ColoredListsUsers($db);
$status = $users->updatePassword() ? "changed" : "failed";
header("Location: /account.php?password=$status");
exit;
}
else
{
header("Location: /login.php");
exit;
}
$pageTitle = "Reset Your Password";
include_once "common/header.php";
if(isset($ret[0])):
echo isset($ret[1]) ? $ret[1] : NULL;
if($ret[0]<3):
?>
<div class="inner cover">
<br/><br/>
<form class="form-horizontal" role="form" method="post" action="accountverify.php">
<div class="form-group">
<label for="p" class="control-label col-xs-2">Choose a New Password:</label>
<div class="col-xs-10">
<input type="password" class="form-control" id="p" name="p" placeholder="Password" value="">
</div>
</div>
<div class="form-group">
<label for="r" class="control-label col-xs-2">Re-Type Password:</label>
<div class="col-xs-10">
<input type="password" class="form-control" id="r" name="r" placeholder="Password" value="">
</div>
</div>
<input type="hidden" name="v" value="<?php echo $_GET['v'] ?>" />
<div class="form-group">
<div class="col-xs-offset-2 col-xs-10">
<button type="submit" name="verify" id="verify" class="btn btn-primary">Reset Your Password</button>
</div>
</div>
</form>
</div>
<?php
endif;
else:
echo '<meta http-equiv="refresh" content="0;/">';
endif;
include_once 'common/close.php';
?>