From b78062c9da3d27dd6d7c70c99880b503f13f6501 Mon Sep 17 00:00:00 2001 From: GaoxingAbdullah Date: Sun, 27 Nov 2022 19:57:50 +0800 Subject: [PATCH] Script.php - Fixed Bug 510 - newly created account for lecturer/ TA can't log in with the default password --- Script.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Script.php b/Script.php index 7191f4d..16b8065 100644 --- a/Script.php +++ b/Script.php @@ -279,11 +279,12 @@ if (!empty($_POST["frm_createlecturrer"])) { $_SESSION["info_Admin_Users"]="Email address : ".$email." is already in use."; header("Location: Admin.php"); } + $password_hash = password_hash("$password-Lrr@2022", PASSWORD_DEFAULT); $sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`) VALUES " - . "('$email','$password','$fullname','$type')"; + . "('$email','$password_hash','$fullname','$type')"; if ($con->query($sql) === TRUE) { - $_SESSION["info_Admin_Users"] = $type . " user Created successfully : email " . $email . " and $password as Password."; + $_SESSION["info_Admin_Users"] = $type . " user Created successfully : email " . $email . " and $password-Lrr@2022 as Password."; header("Location: Admin.php"); } else { echo "Error: " . $sql . "
" . $con->error;