From 708a50bcf87ce5ce4a5745720a4232919cb79a98 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Mon, 6 Jan 2025 19:28:19 +0200 Subject: [PATCH] Fixes login logic --- public_html/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public_html/index.php b/public_html/index.php index 3d702dd..767fd36 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -168,16 +168,17 @@ if ($page == 'logout') { // if user is logged in, we need user details and rights if (isset($currentUser)) { - $user_id = $userObject->getUserId($currentUser)[0]['id']; - $userDetails = $userObject->getUserDetails($user_id); - $userRights = $userObject->getUserRights($user_id); - $userTimezone = isset($userDetails[0]['timezone']) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set // If by error a logged in user requests the login page if ($page === 'login') { header('Location: ' . htmlspecialchars($app_root)); exit(); } + $user_id = $userObject->getUserId($currentUser)[0]['id']; + $userDetails = $userObject->getUserDetails($user_id); + $userRights = $userObject->getUserRights($user_id); + $userTimezone = isset($userDetails[0]['timezone']) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set + // check if the Jilo Server is running require '../app/classes/server.php';