Script.php - Fixed Bug 510 - newly created account for lecturer/ TA can't log in with the default password

Bug510-Abdulai
YAKUBU ABDULAI 2022-11-27 19:57:50 +08:00
parent 67647de04a
commit b78062c9da
1 changed files with 3 additions and 2 deletions

View File

@ -279,11 +279,12 @@ if (!empty($_POST["frm_createlecturrer"])) {
$_SESSION["info_Admin_Users"]="Email address : ".$email." is already in use."; $_SESSION["info_Admin_Users"]="Email address : ".$email." is already in use.";
header("Location: Admin.php"); header("Location: Admin.php");
} }
$password_hash = password_hash("$password-Lrr@2022", PASSWORD_DEFAULT);
$sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`) VALUES " $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) { 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"); header("Location: Admin.php");
} else { } else {
echo "Error: " . $sql . "<br>" . $con->error; echo "Error: " . $sql . "<br>" . $con->error;