forked from clongmor/Camagru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpasswordreset.php
64 lines (58 loc) · 2.9 KB
/
passwordreset.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
session_start();
include "templates/header.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Password Reset</title>
</head>
<body class="purp_body">
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<div class="title">
Reset Password
</div>
<section class="section">
<div class="container has-text-centered">
<div class="columns is-centered">
<div class="column is-5 is-4-desktop">
<?php
echo "<form method='post' action='forms/resetpassword.php?username=".$_GET['username']."&token=".$_GET['token']."'>";
?>
<div class="field">
<div class="control">
<!-- Remove the value="" -->
<input class="input" type="password" name="password" placeholder="Password" value="">
</div>
</div>
<div class="field">
<div class="control">
<!-- Remove the value="" -->
<input class="input" type="password" name="repeatpassword" placeholder="Repeat Password" value="">
</div>
</div>
<div class="field">
<button class="button is-primary is-fullwidth" href="forms/resetpassword.php" value="submit" type="Submit">Change Password!</button>
</div>
<?php
// If $_SESSION['error'] is set, then it'll display the error, else it's display that the password has been successfully reset.
if ($_SESSION['resetpasswordsuccess'] == TRUE) {
echo "Password reset is successfull. Please login with new password.";
} else if ($_SESSION['error'] !== NULL) {
echo "Password reset error: ".$_SESSION['error'];
$_SESSION['error'] = NULL;
}
?>
</span>
</form>
</div>
</div>
</div>
</section>
</div>
</div>
</section>
</body>
</html>