-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresetAdminPasswordProcess.php
More file actions
45 lines (30 loc) · 1003 Bytes
/
resetAdminPasswordProcess.php
File metadata and controls
45 lines (30 loc) · 1003 Bytes
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
<?php
include "connection.php";
session_start();
if($_SESSION["ad"]){
$email = $_SESSION["ad"]["email"];
$currentPw = $_POST["cp"];
$newPw = $_POST["np"];
$confirmPw = $_POST["rp"];
if(empty($currentPw)){
echo("Please enter your current password");
}else if(empty($newPw)){
echo("Please enter your new password");
}else if(empty($confirmPw)){
echo("Please confirm your password");
}else if(strlen($newPw) < 5 || (strlen($confirmPw) > 15)){
echo("Password Must Contain Between 5 to 15 characters");
}else if($newPw != $confirmPw){
echo("Password do not match");
}else{
if($_SESSION["ad"]["password"] == $currentPw){
Database::iud("UPDATE `admin` SET `password` = '".$confirmPw."' WHERE `email` = '".$email."' ");
echo("success");
}else{
echo("Your current password is incorrect");
}
}
}else{
echo("Please login to your admin account");
}
?>