From ef69eb3ba400664aa8fb8df5342220d5b917a5a2 Mon Sep 17 00:00:00 2001 From: Konstantin Protzen Date: Fri, 22 Sep 2023 23:40:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20[See=20@noten-app/beta#1](https://g?= =?UTF-8?q?ithub.com/noten-app/beta/issues/1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login/login.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/login/login.php b/login/login.php index d29739f..b9724d9 100644 --- a/login/login.php +++ b/login/login.php @@ -24,13 +24,13 @@ if (mysqli_connect_errno()) exit("Error connecting to our database! Please try again later."); // Check if account exists -if ($input_type == "email") $stmt = $con->prepare("SELECT id, displayname, password, email, account_version, rounding, sorting, gradesystem FROM " . $settings["database_tables"]["accounts"] . " WHERE email = ?"); -else $stmt = $con->prepare("SELECT id, displayname, password, email, account_version, rounding, sorting, gradesystem FROM " . $settings["database_tables"]["accounts"] . " WHERE username = ?"); +if ($input_type == "email") $stmt = $con->prepare("SELECT id, displayname, password, email, account_version, rounding, sorting, gradesystem, school_year FROM " . $settings["database_tables"]["accounts"] . " WHERE email = ?"); +else $stmt = $con->prepare("SELECT id, displayname, password, email, account_version, rounding, sorting, gradesystem, school_year FROM " . $settings["database_tables"]["accounts"] . " WHERE username = ?"); $stmt->bind_param('s', $input["email_or_username"]); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 0) exit("Account not found!"); -$stmt->bind_result($id, $displayname, $password_hash, $email, $account_version, $setting_rounding, $setting_sorting, $setting_system); +$stmt->bind_result($id, $displayname, $password_hash, $email, $account_version, $setting_rounding, $setting_sorting, $setting_system, $school_year); $stmt->fetch(); // Add salt and password and check if right @@ -48,5 +48,6 @@ $_SESSION["setting_sorting"] = $setting_sorting; $_SESSION["setting_system"] = $setting_system; $_SESSION["beta_tester"] = $beta_tester; +$_SESSION["school_year"] = $school_year; header("Location: https://beta.noten-app.de");