/
resetpassword.php
64 lines (56 loc) · 1.75 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
<?php
include_once "common/database.php";
if(isset($_GET['v']) && isset($_GET['e']))
{
include_once "inc/class.users.inc.php";
$users = new MarktPlatzUsers($db);
$ret = $users->verifyAccount();
}
elseif(isset($_POST['v']))
{
include_once "inc/class.users.inc.php";
$users = new MarktPlatzUsers($db);
$status = $users->updatePassword() ? "changed" : "failed";
header("Location: /accounts.php?password=$status");
exit;
}
else
{
header("Location: /login.php");
exit;
}
$pageTitle = "Reset Your Password";
include_once "common/header.php";
include_once("common/sidebar.php");
if(isset($ret[0])):
echo isset($ret[1]) ? $ret[1] : NULL;
if($ret[0]<3):
?>
<article id="main">
<div id="loginbox">
<form action="accountverify.php" method="post">
<fieldset>
<legend>Login</legend>
<p>
<label for="p">Choose a New Password:</label>
<input type="password" name="p" id="p" attribut="login" />
</p>
<p>
<label for="r">Re-Type Password:</label>
<input type="password" name="r" id="r" attribut="login" /><br />
</p>
<p>
<input type="hidden" name="v" value="<?php echo $_GET['v'] ?>" />
<input type="submit" name="verify" id="verify" value="Reset Your Password" class="button" />
</p>
</div>
</form>
</div>
</articel>
<?php
endif;
else:
echo '<meta http-equiv="refresh" content="0;/">';
endif;
include_once 'common/footer.php';
?>