-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgot.php
More file actions
168 lines (151 loc) · 4.66 KB
/
Copy pathforgot.php
File metadata and controls
168 lines (151 loc) · 4.66 KB
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
<?php
include_once("mysql.scupoints.inc.php");
$response = "";
$skip = false;
$password_change = false;
//STEP 1 of 3 We create the form to change password request which sends you an email
if (isset($_POST['email']))
{
$response = sendPasswordReset($_POST['email'] );
if (strstr($response,"Success") != False) //if success is found
{
$_SESSION['response'] = $response;
$_SESSION['email'] = strtok($_POST['email'],'@');
$skip = false;
}
}
//SET 2 of 3 Check to see if the code from the email matches
if (isset($_GET['code']) && isset($_GET['email']))
{
//we check to see if the code matches their email if it does then we echo the form to reset the password
if ($_GET['code']==calculateResetCode($_GET['email'])) {
$_SESSION['email_authorized'] = $_GET['email'];
$password_change = true;
}
else
die("Code invalid");
}
//STEP 3 of 3 then we check here to see passwords match and we change them
if (isset($_POST['newpass']) && isset($_POST['newpass2']))
{
if ($_POST['newpass'] == $_POST['newpass2'])
{
$response = resetPassword( $_SESSION['email_authorized'], $_POST['newpass'] );
if (strstr($response,"Password Updated") != False) //if Password Updated is found that means they registered
{
//redirect to the main login because they did it right
echo <<<redir
<script>
window.location="register.php";
</script>
redir;
}
}
}
?>
<html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SCUPoints[Register]</title>
<meta name="description" content="Custom Login Form Styling with CSS3" />
<meta name="author" content="rirribarren" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/modernizr.custom.63321.js"></script>
<!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
<style>
@import url(http://fonts.googleapis.com/css?family=Raleway:400,700);
body {
background: #7f9b4e url(images/scubg.png) no-repeat center top;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
.container > header h1,
.container > header h2 {
color: #fff;
text-shadow: 0 1px 1px rgba(0,0,0,0.7);
}
marquee {
marquee-speed: slow;
}
.clean-red{
border:solid 2px #D55544;
background: #F6CBCA;
color:#DE645C;
padding:4px;
text-align:center;
}
.clean-red > a {
color: #FFAACC;
}
</style>
</head>
<body>
<div class="container">
<!-- Codrops top bar -->
<div class="codrops-top">
<a href="main.php"><strong>« HomePage: </strong></a>
<span class="right" style="width:70%;"><marquee><strong>SCU Points</strong></marquee></span>
</div><!--/ Codrops top bar -->
<header>
<h1>SCU Points<br><strong>Reset Password Form</strong></h1>
<h2>Don't waste leftover points</h2>
<div class="support-note">
<span class="note-ie">Sorry, only modern browsers.</span>
</div>
</header>
<section class="main">
<!--
<iframe src="https://www.facebook.com/plugins/registration?client_id=312549098871198&redirect_uri=http://www.gunzhaxplz.com/scupoints.com/register.php&fields=name,gender,email,first_name,last_name"
scrolling="auto"
frameborder="no"
style="border:none"
allowTransparency="true"
width="100%"
height="390"></iframe>
-->
<form action="" method="POST" class="form-4">
<?php if ($password_change==False)
{
?>
<h1>Enter your email</h1>
<p>
<label for="email">SCU email</label>
<input type="text" name="email" placeholder="SCU Email" required>
</p>
<?php
} else
{
?>
<h1>Enter your new password</h1>
<p>
<label for="newpass">Enter New Password</label>
<input type="password" name="newpass" placeholder="Password" required>
</p>
<p>
<label for="newpass2">Re-Enter New Password</label>
<input type="password" name="newpass2" placeholder="Password Again" required>
</p>
<?php
}
?>
<p>
<?php
if (strstr($response,"Success")==False && strlen($response) > 3)
{
echo "<span class='clean-red' id='response'>".$response."</span>";
}
?>
</p>
<p>
<input type="submit" name="submit" value="Continue">
</p>
</form>
</section>
</div>
</body>
</html>