From a381ad09d85dc71bc697120ab6313e6c0a154259 Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 25 Sep 2026 17:39:44 +0200 Subject: [PATCH] =?UTF-8?q?Poprawka=20botto=20bar=20i=20wersje=20j=C4=99zy?= =?UTF-8?q?kowe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 + api/cache/.htaccess | 7 + api/guest_action_queue.php | 17 +- api/request_ip.php | 46 +++- api/waiter_feed.php | 19 ++ config/waiter.php | 11 + public/app.php | 205 ++++++++-------- public/assets/css/app.css | 169 ++++++++++--- public/assets/js/locales/de.js | 1 + public/assets/js/locales/en.js | 1 + public/assets/js/locales/pl.js | 1 + public/assets/js/modules/access.js | 4 +- public/assets/js/modules/bill.js | 41 +--- public/assets/js/modules/config.js | 8 - public/assets/js/modules/geo.js | 378 +++++++++++++++-------------- public/assets/js/modules/i18n.js | 139 +++++++++-- public/assets/js/modules/menu.js | 62 +++-- public/assets/js/modules/orders.js | 59 +++-- public/staff/auth.php | 15 +- public/waiter/app.js | 6 +- public/waiter/index.php | 5 + 21 files changed, 770 insertions(+), 428 deletions(-) create mode 100644 api/cache/.htaccess create mode 100644 config/waiter.php 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

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