added register check on login

if your account was removed when you were logged in, shit started to happen
This commit is contained in:
Václav Šmejkal 2024-05-22 15:43:12 +02:00
parent 87847d6696
commit f8d85b9b92
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -105,6 +105,8 @@ session_start();
function login($uname) function login($uname)
{ {
global $database;
if ($uname != null) if ($uname != null)
{ {
$_SESSION["username"] = $uname; $_SESSION["username"] = $uname;
@ -113,7 +115,7 @@ session_start();
$uname = $_SESSION["username"]; $uname = $_SESSION["username"];
} }
echo "<script>set_login_uname(\"" . $uname . "\")</script>"; if (($database -> query("SELECT username FROM user WHERE BINARY username=\"" . $uname . "\"")) -> num_rows == 1) echo "<script>set_login_uname(\"" . $uname . "\")</script>";
} }
?> ?>
</body> </body>