From 71c7f6015d75a3e30d252e83a426e1abf7d20ce5 Mon Sep 17 00:00:00 2001 From: Janis Steiner Date: Fri, 20 Sep 2024 16:26:42 +0100 Subject: [PATCH] fixed a bug where class was not loaded if logged in via autologin --- sys0-code/login/keepmeloggedin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys0-code/login/keepmeloggedin.php b/sys0-code/login/keepmeloggedin.php index 4694897..d9d4b7a 100644 --- a/sys0-code/login/keepmeloggedin.php +++ b/sys0-code/login/keepmeloggedin.php @@ -21,13 +21,14 @@ function logmein($link) $telegram_id=""; $notification_mail=0; $notification_telegram=0; - $sql = "SELECT keepmeloggedin, role, id, color,banned,telegram_id,notification_telegram,notification_mail FROM users WHERE username = ?"; + $class_id=0; + $sql = "SELECT keepmeloggedin, role, id, color,banned,telegram_id,notification_telegram,notification_mail, class_id FROM users WHERE username = ?"; $username=htmlspecialchars($username); $stmt = mysqli_prepare($link, $sql); mysqli_stmt_bind_param($stmt, "s", $username); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); - mysqli_stmt_bind_result($stmt, $usertoken,$role,$id,$color,$banned,$telegram_id,$notification_telegram,$notification_mail); + mysqli_stmt_bind_result($stmt, $usertoken,$role,$id,$color,$banned,$telegram_id,$notification_telegram,$notification_mail,$class_id); mysqli_stmt_fetch($stmt); mysqli_stmt_close($stmt); if ($usertoken!==$token) { @@ -48,6 +49,7 @@ function logmein($link) $_SESSION["telegram_id"]=$telegram_id; $_SESSION["notification_telegram"]=$notification_telegram; $_SESSION["notification_mail"]=$notification_mail; + $_SESSION["class_id"]=$class_id; log_("Logged $username in via autologin","LOGIN:AUTOLOGIN:SUCCESS"); return "success"; }