Share repeated controller and service code
CI / Deploy / test (push) Successful in 53s
CI / Deploy / deploy (push) Skipped

- AppController: joinUrl(), adminUrlFor(), setPollInterval() and protect()
  instead of copies in Admin-, Home-, Participate- and EmbedController.
- PollMailer::sendSafely() replaces two try/catch blocks around mail sending.
- Slide::optionIds() replaces five identical array_map() calls.
- PollStateService: one pollPayload() for presenter and embed; the vote
  action passes the already loaded slide instead of loading it again.
- ResultsService::forSlide() takes the answer/comment limit and the rating
  flag, so ReportService no longer queries answers, comments and the scale
  distribution twice and the export loads the slides only once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 22:50:56 +01:00
1 parent ad537b9b34
commit 3e44ded107
14 files changed
+189 -137

No files matched your search

+3 -1
View File
@@ -53,6 +53,8 @@ src/
Captcha/ CaptchaInterface + NoCaptcha / MathCaptcha / RecaptchaCaptcha, CaptchaFactory
Error/RedactingErrorLogger maskiert Admin-Token und Embed-Key in allen Log-Einträgen (`Error.logger` in app.php)
Controller/
AppController Basis aller Controller: `joinUrl()`, `adminUrlFor()`, `setPollInterval()`, `throttle()`, `json()`,
`protect()` (no-referrer/noindex/no-store für Seiten mit Geheimnis in der URL: Admin, Embed)
HomeController Startseite, Anlegen (/create), Bestätigung, Join, Recover
AdminAppController Basis für /admin/{token}: löst Poll über Token-Hash auf (404 sonst), setzt Privacy-Header (no-referrer, no-store)
AdminController Dashboard, Settings, Present, State-JSON, Control, QR, PDF-Export, Token rotieren, Zurücksetzen, Löschen
@@ -61,7 +63,7 @@ src/
ParticipateController /p/{code}: Ansicht, State-JSON, Abstimmen; anonymes Cookie plenario_pid
EmbedController /e/{key}/{id}: eine Folie zum Einbetten (z. B. Canva), activate/heartbeat/pause/control
ErrorController Fehlerseiten (Templates unter templates/Error, Layout `error`)
Mailer/ PollMailer (adminLink, recovery), Transport/FileTransport (lokal)
Mailer/ PollMailer (adminLink, recovery; `sendSafely()` loggt Transportfehler statt zu werfen), Transport/FileTransport (lokal)
Middleware/ HostHeaderMiddleware: prüft in Produktion den Host gegen APP_FULL_BASE_URL;
SecurityHeadersMiddleware (äußerste Schicht): CSP mit Nonce, Framing, nosniff, Referrer-/Permissions-Policy
für alle Antworten inkl. JSON und Fehlerseiten; vom Controller gesetzte Header gewinnen