Poprawka botto bar i wersje językowe

This commit is contained in:
2026-09-25 17:39:44 +02:00
parent 3056eb6c3d
commit a381ad09d8
21 changed files with 770 additions and 428 deletions
+14 -1
View File
@@ -26,13 +26,26 @@ function requireAdminAuth(bool $redirectToLogin = true): void
header('Location: login.php');
exit;
}
http_response_code(401);
header('Content-Type: application/json; charset=utf-8');
echo json_encode([
'status' => 'error',
'message' => 'Unauthorized',
], JSON_UNESCAPED_UNICODE);
exit;
}
function attemptAdminLogin(string $username, string $password): bool
{
startAdminSession();
if (hash_equals(ADMIN_USERNAME, $username) && hash_equals(ADMIN_PASSWORD, $password)) {
$userOk = hash_equals(ADMIN_USERNAME, $username);
$passOk = strlen($password) === strlen(ADMIN_PASSWORD)
&& hash_equals(ADMIN_PASSWORD, $password);
if ($userOk && $passOk) {
session_regenerate_id(true);
$_SESSION['staff_logged_in'] = true;
$_SESSION['staff_username'] = ADMIN_USERNAME;
return true;