Реструктура стилей, страница логина, уведомления

This commit is contained in:
2024-01-13 03:24:42 +03:00
parent 6958b75414
commit 4e1c36d670
29 changed files with 612 additions and 94 deletions

View File

@ -1,4 +1,7 @@
<?php
// Things related to authentication
// Includes
if ($IS_FRONTEND)
@ -9,7 +12,7 @@ else
// End currently active session
function EndSession () {
function AUTH_EndSession () {
session_unset();
session_destroy();
if (isset($_COOKIE["PHPSESSID"])) {
@ -35,8 +38,7 @@ if (session_status() === PHP_SESSION_ACTIVE && isset($_SESSION["userid"])) { //
$s->bind_param("s", $_SESSION["userid"]);
$s->execute();
if (!(bool)$s->get_result()->fetch_assoc()) { // If not, then destroy session
EndSession();
echo "user id does not exist";
AUTH_EndSession();
die("user id used in session does not exist");
}
$LOGGED_IN = true;
@ -48,7 +50,7 @@ if (session_status() === PHP_SESSION_ACTIVE && isset($_SESSION["userid"])) { //
if ($Config["debug"] && isset($_REQUEST["debug"])) { // If there are not any session and debug mode is on
// ATTENTION: FOR DEBUG PURPOSES ONLY!
if ($_REQUEST["debug"] == "drop") {
EndSession();
AUTH_EndSession();
die("session discarded");
}
$_SESSION["userid"] = intval($_REQUEST["debug"]);