From aed70f3056cd37e3db26014c94c6a1d5263fc1a3 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Sun, 20 Aug 2023 22:03:33 +0800 Subject: [PATCH] Admin.php: fix a bug that prevents Lecturer from blocking/activating a TA --- Admin.php | 8 ++++---- Header.php | 7 ------- Script.php | 3 +-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Admin.php b/Admin.php index 9e4864a..19566e7 100644 --- a/Admin.php +++ b/Admin.php @@ -71,8 +71,8 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
Email
- Passport number/ID (used as the initial password) -
+ Passport No. (used as the initial password) +
User type: Reset"; + $btn = ""; if ($row['Status'] == "Active") { $newstatus = "Blocked"; $btnBlock = ""; @@ -224,7 +224,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { diff --git a/Script.php b/Script.php index 2ea70af..8bc2d67 100644 --- a/Script.php +++ b/Script.php @@ -987,13 +987,12 @@ if (!empty($_GET["action"])) { } } - if ($action == "statuschange" && $_SESSION['user_id'] == $uid && ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "Admin")) { + if ($action == "statuschange" && ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "Admin")) { $sql = "UPDATE users_table set Status='$status' where User_ID='$uid';"; if ($con->query($sql) === TRUE) { $_SESSION["info_Admin_Users"] = $type . " user Status updated successfully "; header("Location: Admin.php"); } else { - // echo "Error: " . $sql . "
" . $con->error; echo "Something really bad happened while changing status. Contact lanhui at zjnu.edu.cn. Thanks!"; } }