From 4ac03f766cf2eaf2f68e175751ecb94b1d460174 Mon Sep 17 00:00:00 2001 From: GaoxingAbdullah Date: Mon, 5 Dec 2022 15:45:57 +0800 Subject: [PATCH] Script.php: Moved lecturer and TA append password variable to get credential file. --- Script.php | 4 ++-- get_mysql_credentials.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Script.php b/Script.php index 59e67a4..54c068b 100644 --- a/Script.php +++ b/Script.php @@ -279,12 +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); + $password_hash = password_hash("$password-$append_password", PASSWORD_DEFAULT); $sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`) VALUES " . "('$email','$password_hash','$fullname','$type')"; if ($con->query($sql) === TRUE) { - $_SESSION["info_Admin_Users"] = $type . " user created successfully. Use email " . $email . " as account name and $password-Lrr@2022 as password."; + $_SESSION["info_Admin_Users"] = $type . " user created successfully. Use email " . $email . " as account name and $password-$append_password as password."; header("Location: Admin.php"); } else { echo "Error: " . $sql . "
" . $con->error; diff --git a/get_mysql_credentials.php b/get_mysql_credentials.php index c520376..d7f707d 100644 --- a/get_mysql_credentials.php +++ b/get_mysql_credentials.php @@ -2,4 +2,6 @@ $csv = array_map('str_getcsv', file('./../../lrr_submission/KeepItSafe.txt')); $mysql_username = $csv[0][0]; $mysql_password = $csv[0][1]; +//append password for Lecturer and TA +$append_password = "Lrr@2022" ; ?>