diff --git a/.gitignore b/.gitignore index c2658d7..60637c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ node_modules/ +.vscode/sftp.json +.env +.env.* +config/*.local.php diff --git a/api/cache/.htaccess b/api/cache/.htaccess new file mode 100644 index 0000000..5e8bd59 --- /dev/null +++ b/api/cache/.htaccess @@ -0,0 +1,7 @@ +# Blokuj publiczny dostęp do cache (mapowanie QR → stoliki, menu JSON). + + Require all denied + + + Deny from all + diff --git a/api/guest_action_queue.php b/api/guest_action_queue.php index 2de423b..433c2b6 100644 --- a/api/guest_action_queue.php +++ b/api/guest_action_queue.php @@ -19,14 +19,17 @@ function resolveGuestQueueTableId(string $tableId, string $qrHash): string { global $conn; - if ($tableId === '' && $qrHash !== '' && isset($conn)) { - $resolved = getTableNameByHash($conn, $qrHash); - if ($resolved !== '') { - $tableId = $resolved; - } + // Wymagamy prawidłowego hasha QR — samo tableId (łatwe do odgadnięcia) nie wystarczy. + if ($qrHash === '' || !isset($conn)) { + return ''; } - return trim($tableId); + $resolved = getTableNameByHash($conn, $qrHash); + if ($resolved === '') { + return ''; + } + + return trim($resolved); } function hasPendingGuestAction(PDO $pdo, string $tableId, string $messageType): bool @@ -285,7 +288,7 @@ if ($tableId === '') { http_response_code(422); echo json_encode([ 'status' => 'error', - 'message' => 'tableId is required', + 'message' => 'Valid qrHash is required', ], JSON_UNESCAPED_UNICODE); exit; } diff --git a/api/request_ip.php b/api/request_ip.php index c67daf9..ffafdc5 100644 --- a/api/request_ip.php +++ b/api/request_ip.php @@ -1,17 +1,51 @@ 'error', + 'message' => 'Unauthorized', + ], JSON_UNESCAPED_UNICODE); + exit; +} + if ($_SERVER['REQUEST_METHOD'] !== 'GET') { http_response_code(405); echo json_encode([ diff --git a/config/waiter.php b/config/waiter.php new file mode 100644 index 0000000..82f557f --- /dev/null +++ b/config/waiter.php @@ -0,0 +1,11 @@ + 'biesiada_waiter_feed_2026', +]; diff --git a/public/app.php b/public/app.php index b64b28f..d35979d 100644 --- a/public/app.php +++ b/public/app.php @@ -24,7 +24,7 @@ foreach (($menuConfig['languages'] ?? []) as $code => $meta) { - + @@ -54,18 +54,18 @@ foreach (($menuConfig['languages'] ?? []) as $code => $meta) {
📍

Witamy w Karcznie

-

+

Przeglądaj menu od razu — albo potwierdź, że jesteś u nas, aby wezwać kelnera, śledzić zamówienie i poprosić o rachunek.

@@ -87,114 +87,115 @@ foreach (($menuConfig['languages'] ?? []) as $code => $meta) { -
-
-
-

Karczma Biesiada

-
-
-
Wybierz stolik
-
+
+
+
+
+
+

Karczma Biesiada

+
+
+
Wybierz stolik
+
-
-
+
+
-
-
-
- Aktualny status -
Oczekiwanie...
+
+
+
+ Aktualny status +
Oczekiwanie...
+
+
⏳
+
+ +
+
+
+ +
+ Sprawdzamy co pysznego się przygotowuje... +
+
+ +
+

Twoje zamówione dania

+ +
+
+ + + + +
+ + -
-
-
+
-
- Sprawdzamy co pysznego się przygotowuje... -
- - -
-

Twoje zamówione dania

- -
-
- - - - +
+
- - -