Display-Seiten: Betriebszeiten, PIN, Gerätesperre, Sprache und Vorschau
All checks were successful
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 39s
CI / Unit Tests & Static Analysis (push) Successful in 38s
CI / PHP Lint (pull_request) Successful in 41s
CI / PHP Lint-1 (pull_request) Successful in 49s
CI / Unit Tests & Static Analysis (pull_request) Successful in 41s
All checks were successful
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 39s
CI / Unit Tests & Static Analysis (push) Successful in 38s
CI / PHP Lint (pull_request) Successful in 41s
CI / PHP Lint-1 (pull_request) Successful in 49s
CI / Unit Tests & Static Analysis (pull_request) Successful in 41s
Die Display-Seiten hängen an öffentlichen Links, deshalb bekommen sie Regler, mit denen sich der Missbrauch begrenzen lässt, und ein paar Komfortfunktionen für den Betrieb: - Betriebszeiten je Seite (auch über Mitternacht hinweg); außerhalb zeigt die Seite einen Hinweis statt des Buttons - Optionale PIN von der Rezeption, geprüft mit hash_equals - Wartezeit je Gerät über ein Cookie, zusätzlich zum globalen Cooldown - Feste Sprache je Seite, sonst Browsersprache; Gäste können unten umschalten - Reporting zeigt die Ausgabe pro Display-Seite - Vorschau der Seite direkt in der Administration - Backup exportiert und importiert die neuen Felder mit Migration 0007, 16 neue Sprachschlüssel, 7 zusätzliche Tests (69 Tests, 152 Assertions). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
88f40a3d21
commit
dd8e805e27
28 changed files with 478 additions and 26 deletions
|
|
@ -58,13 +58,20 @@ class Database {
|
|||
public function fetchAll($sql, $params = []) {
|
||||
$s = preg_replace('/\s+/', ' ', strtolower($sql));
|
||||
|
||||
if (str_contains($s, 'from kiosks')) {
|
||||
if (str_contains($s, 'left join vouchers v on v.kiosk_id')) {
|
||||
return [
|
||||
['name'=>'Empfang Erdgeschoss','site_name'=>'Hauptstandort Nord','total'=>412,'in_period'=>96],
|
||||
['name'=>'Tagungsraum West','site_name'=>'Campus West','total'=>87,'in_period'=>14],
|
||||
];
|
||||
}
|
||||
if (str_contains($s, 'from kiosks')) {
|
||||
$rows = [
|
||||
['id'=>1,'site_id'=>1,'template_id'=>1,'name'=>'Empfang Erdgeschoss','token'=>'a1b2c3d4e5f60718293a4b5c6d7e8f90',
|
||||
'headline'=>'Willkommen im Hotel Seeblick','subline'=>'Tippen Sie auf den Knopf – Ihr WLAN-Code erscheint sofort.',
|
||||
'logo_url'=>'/demo-assets/logo.svg','background_url'=>'/demo-assets/background.svg',
|
||||
'bg_overlay'=>55,'accent_color'=>'#0f766e','card_style'=>'dark',
|
||||
'is_active'=>1,'daily_limit'=>150,'cooldown_seconds'=>15,'display_seconds'=>90,'last_used_at'=>null,
|
||||
'active_from'=>'06:00','active_to'=>'23:00','device_cooldown_seconds'=>300,'pin'=>null,'language'=>null,
|
||||
'site_name'=>'Hauptstandort Nord','site_active'=>1,'template_name'=>'Tagesgast',
|
||||
'tpl_max_uses'=>2,'tpl_expire_minutes'=>480,'qos_rate_max_down'=>20000,'qos_rate_max_up'=>5000,'qos_usage_quota'=>0,
|
||||
'total_vouchers'=>412,'today_vouchers'=>23,'created_at'=>'2026-06-01 10:00:00'],
|
||||
|
|
@ -72,10 +79,19 @@ class Database {
|
|||
'headline'=>'','subline'=>'','logo_url'=>null,'background_url'=>null,'bg_overlay'=>45,
|
||||
'accent_color'=>null,'card_style'=>'light',
|
||||
'is_active'=>1,'daily_limit'=>0,'cooldown_seconds'=>30,'display_seconds'=>60,
|
||||
'active_from'=>null,'active_to'=>null,'device_cooldown_seconds'=>0,'pin'=>'4711','language'=>'en',
|
||||
'last_used_at'=>null,'site_name'=>'Campus West','site_active'=>1,'template_name'=>null,
|
||||
'tpl_max_uses'=>0,'tpl_expire_minutes'=>0,'qos_rate_max_down'=>0,'qos_rate_max_up'=>0,'qos_usage_quota'=>0,
|
||||
'total_vouchers'=>87,'today_vouchers'=>4,'created_at'=>'2026-07-12 09:30:00'],
|
||||
];
|
||||
|
||||
// Token-Abfrage: nur den passenden Kiosk liefern, sonst zeigt die
|
||||
// Demo immer die erste Seite.
|
||||
if (str_contains($s, 'k.token = ?') && isset($params[0])) {
|
||||
$rows = array_values(array_filter($rows, fn ($r) => $r['token'] === $params[0]));
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
if (str_contains($s, 'count(*) as count from sites')) return [['count'=>4]];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue