Checks jilo server only when logged in

main
Yasen Pramatarov 2024-10-23 15:13:01 +03:00
parent 36f287e169
commit fee54aa827
1 changed files with 10 additions and 10 deletions

View File

@ -146,18 +146,18 @@ if ($page == 'logout') {
$userDetails = $userObject->getUserDetails($user_id); $userDetails = $userObject->getUserDetails($user_id);
$userRights = $userObject->getUserRights($user_id); $userRights = $userObject->getUserRights($user_id);
$userTimezone = isset($userDetails[0]['timezone']) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set $userTimezone = isset($userDetails[0]['timezone']) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set
}
// check if the Jilo Server is running // check if the Jilo Server is running
require '../app/classes/server.php'; require '../app/classes/server.php';
$serverObject = new Server($dbWeb); $serverObject = new Server($dbWeb);
$server_host = '127.0.0.1'; $server_host = '127.0.0.1';
$server_port = '8080'; $server_port = '8080';
$server_endpoint = '/health'; $server_endpoint = '/health';
$server_status = $serverObject->getServerStatus($server_host, $server_port, $server_endpoint); $server_status = $serverObject->getServerStatus($server_host, $server_port, $server_endpoint);
if (!$server_status) { if (!$server_status) {
$error = 'The Jilo Server is not running. Some data may be old and incorrect.'; $error = 'The Jilo Server is not running. Some data may be old and incorrect.';
}
} }
// page building // page building