Compare commits

...

2 Commits

Author SHA1 Message Date
a7921f6d5b access: Fix 404 when invalid client was specified 2024-12-29 12:12:24 +01:00
34e5c44115 access: Fix today check 2024-12-29 12:11:43 +01:00
2 changed files with 7 additions and 6 deletions

View File

@ -17,14 +17,14 @@ foreach ($COMBINED_ACCESS as $name => $data) {
$client['id'] = $name;
}
}
if ($_SERVER['PATH_INFO'] !== "/$client[id]/") {
header('Status: 308');
header("Location: /access/$client[id]/");
exit();
} else if ($client === null) {
if ($client === null) {
header('Status: 404');
header('Content-Length: 0');
exit();
} else if ($_SERVER['PATH_INFO'] !== "/$client[id]/") {
header('Status: 308');
header("Location: /access/$client[id]/");
exit();
}
if ($client['api']) {

View File

@ -83,7 +83,8 @@ async function updateOverview(client) {
const date = new Date(dateString);
const row = document.createElement('div');
row.className = 'day';
if (now.getDate() === date.getDate()) row.classList.add('today');
if (now.getFullYear() === date.getFullYear() && now.getMonth() === date.getMonth() && now.getDate() === date.getDate())
row.classList.add('today');
row.innerHTML = `<div><span style="font-size: 0.75em; display: block">${fmtDateWeekday(date)}</span>${fmtDate(date)}</div>`;
const container = document.createElement('div');
container.className = 'schedule-container';