This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdatePassword.php
60 lines (54 loc) · 2 KB
/
UpdatePassword.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
<?php
include('session.php');
/*copy the session UserID to a local variable*/
$UserID = $_SESSION['userID'];
$Username = $_SESSION['username'];
$Role = $_SESSION['role'];
?>
<HTML>
<HEAD>
<TITLE>SVBX - Update Password</TITLE>
<link rel="stylesheet" href="styles.css" type="text/css"/>
</HEAD>
<?php
include('SQLFunctions.php');
$table = 'users_enc';
$Loc = "SELECT Username, Role, firstname, lastname, Email FROM $table WHERE UserID = ".$UserID;
//echo '<br>Source table: ' .$table;
?>
<BODY>
<?php
include('filestart.php');
$link = f_sqlConnect();
?>
<H1>Update Password</H1>
<?php
if($stmt = $link->prepare($Loc)) {
$stmt->execute();
$stmt->bind_result($Username, $Role, $firstname, $lastname, $Email);
while ($stmt->fetch()) {
echo "
<FORM action='PasswordChange.php' method='POST' onsubmit='' />
<p>Update Password for $Username</p>
<p>$Email</p>
<input type='hidden' name='userID' value='".$UserID."'>
<input type='hidden' name='username' value='".$Username."'>
<form action='change-password.php' method='post' id='register-form'>
<input class='password-field' type='password' name='oldpw' placeholder='Current Password'><br />
<br>
<input class='password-field' type='password' name='newpw' placeholder='New Password'><br />
<br>
<input class='password-field' type='password' name='conpw' placeholder='Confrim Password'><br>
<br>
<input class='button' type='submit' name='change' value='Change' />
</form>
</FORM>";
}
//echo "Description: ".$Description;
} else {
echo '<br>Unable to connect';
exit();
}
include('fileend.php') ?>
</BODY>
</HTML>