Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_REQUEST["button"]))
- {
- $username = !empty($_POST["loginName"]) ? trim($_POST["loginName"]) : null;
- $password = !empty($_POST["loginPassword"]) ? trim($_POST["loginPassword"]) : null;
- $currentUser = getLogIn($username,$password);
- $passHash = getHashedPassword($username);
- $validPass = password_verify($password, $passHash);
- if ($validPass) {
- echo "Success";
- foreach($currentUser as $user)
- {
- if($user->userName== $username && $user->userPass==$password)
- {
- if($user->userType == "Administrator") {
- $_SESSION['secondMenu']=menuDecision($currentuser["userType"]);
- header('Location: ../View/accountAdministrator.php');
- }
- else if($user->userType == "Customer")
- {
- $_SESSION['secondMenu']=menuDecision($currentuser["userType"]);
- header('Location: ../View/accountCustomer.php');
- }
- else
- {
- $_SESSION['secondMenu']=menuDecision($currentuser["userType"]);
- $_SESSION['errorMessage']="The login details supplied do not match any valid user.";
- require_once("../View/account.php");
- }
- }
- }
- else {
- echo "Error";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement