-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword.php
More file actions
54 lines (51 loc) · 1.76 KB
/
password.php
File metadata and controls
54 lines (51 loc) · 1.76 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
<?php session_start();
require_once("require/basic.php");
require_once("require/secure.php");
require_once("require/rplayers.php");
require_once("require/forms.php");
Secure(false);
if( isset( $_REQUEST["action"] ) )
{
$action = $_REQUEST["action"];
if($action == "Change Password")
{
$old = md5(trim($_REQUEST["old"]));
$new = md5(trim($_REQUEST["new"]));
$confirm = md5(trim($_REQUEST["confirm"]));
if( $new != $confirm ) set_alert("ERROR", "Entered passwords don't match");
if( PasswordCrypt() != $old ) set_alert("ERROR", "Old password does not match current");
else
{
change_password(ID(), trim($_REQUEST["new"]));
header("Location: login.php?logout=&reason=Password reset, please log back in");
exit();
}
}
}
page_head();
?>
<div class="row">
<div class="col-md-4">
<h2>Reset Your Password</h2>
<p>Warning: This process will log you out</p>
</div>
</div>
<div class="row">
<div class="col-md-3">
<form class="form-horizontal" method="post" action="">
<div class="form-group">
<div class="col-md-12"><input class="form-control" placeholder="Old Password" type="password" name="old" /></div>
</div>
<div class="form-group">
<div class="col-md-12"><input class="form-control" placeholder="New Password" type="password" name="new" /></div>
</div>
<div class="form-group">
<div class="col-md-12"><input class="form-control" placeholder="Confirm Password" type="password" name="confirm" /></div>
</div>
<input class="btn btn-default" type="submit" name="action" value="Change Password" />
</form>
</div>
</div>
<?php
page_foot();
?>