-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangePassword.php
49 lines (42 loc) · 1.33 KB
/
ChangePassword.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
<?php
require_once 'Include/Load.php';
$session = App::getSession();
$link = App::getDatabase();
$user = App::getUser();
$user->restrict();
$validator = App::getValidator();
if ($validator->isPosted()){
$result = $user->changePassword($_POST['og_password']);
if ($result){
if (is_array($result)){
$session->setFlash('alert', implode(', ', $result));
} else {
$session->setFlash('success', 'Your Password has been updated');
}
} else{
$session->setFlash('alert', "Your Account's Password is incorrect");
}
}
?>
<?php require_once 'Include/Header.php'; ?>
<div class="login-box">
<h2>Change Password</h2>
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
<div class="user-box">
<input type="password" name="og_password" required="">
<label>Old Password</label>
</div>
<div class="user-box">
<input type="password" name="new_password" required="">
<label>New Password</label>
</div>
<div class="user-box">
<input type="password" name="confirm_password" required="">
<label>Confirm Password</label>
</div>
<button type="submit">Submit</button>
</form>
</div>
<?php require_once 'Include/Mode.php'; ?>
</body>
</html>