Security-, Bugfix- und UX-Überarbeitung auf Basis des Code-Reviews
Sicherheit: - Bulk-Erstellung serverseitig auf eingeloggte Nutzer beschränkt; expire_minutes wird validiert (anonym: nur Default/Template-Werte, eingeloggt: max. 1 Jahr) - IP-basiertes Rate-Limit über neue Tabelle request_throttle (Voucher-Erstellung + Passwort-Reset-Anfragen), Session-Fallback für Alt-Installationen; Migration 0002 - session_regenerate_id() nach Login, Secure-Cookie-Flag bei HTTPS - Admin-/Aktiv-Status wird pro Request live aus der DB geprüft (Rechteentzug & Deaktivierung wirken sofort); Schutz vor Selbst-Degradierung im Benutzer-Edit - Alle state-ändernden Admin-Aktionen von GET auf POST umgestellt (kein CSRF-Token mehr in URLs) - login_simple.php (Legacy, Debug-Leak) entfernt; cron_test.php nur noch für Admins; .htaccess auf Apache-2.4-Syntax inkl. cron_test.php - M365 Client Secret wird nicht mehr ins Formular zurückgegeben - Updater: Zip-Slip-/Pfad-Traversal-Schutz, Backup vor dem Anwenden mit automatischem Rollback bei Fehlern, AuditLogger-Bug behoben - cron_sync: Token-Vergleich mit hash_equals; login_attempts-Pruning - CSV-Export gegen Excel-Formula-Injection abgesichert Bugfixes: - M365-Login: Fallback auf userPrincipalName, wenn Graph kein 'mail' liefert (Nutzer ohne Exchange-Postfach konnten sich nie anmelden) - PRG-Pattern überall: F5 erzeugt keine Duplikat-Voucher und wiederholt keine Admin-Aktionen (Session-Flash-Messages) - QR-Code nicht mehr invertiert (schwarz auf weiß, scanbar) - Bulk-Erstellung nutzt den UniFi 'n'-Parameter: 1 API-Call statt n× Login + Voucherlisten-Abruf; exaktes Code-Matching per create_time statt "global neuester Voucher" - Mailer: doppelte Zeilenumbrüche behoben, AUTH nur mit Credentials, SMTP-Dot-Stuffing, CLI-sicherer EHLO-Host - forgot_password: System-URL-Auto-Detect (Reset-Link war sonst relativ/kaputt) + Rate-Limit - Audit-Log-Labels an tatsächliche Action-Keys angepasst; Voucher-Erstellung (einzeln & bulk) wird jetzt auditiert - Site-Edit testet die Verbindung auch ohne Passwortänderung UX/UI: - Alert-/Badge-Styles zentral in global.css mit Dark-Mode-Variablen (vorher 7× dupliziert mit hart codierten Hellfarben) - Sticky-Formulare + Tab-Erhalt nach Validierungsfehlern (Bulk), Settings kehren nach dem Speichern zum aktiven Tab zurück - Gültigkeit menschenlesbar (z.B. "8 Stunden" statt "480 Minuten") - Voucher-Name-Default "Gast/Guest" im öffentlichen Modus - Favicon auch auf Login-/öffentlichen Seiten - Verbindungstest-Button pro Site-Karte (Health-Check) - i18n-Pass: Confirm-Dialoge, Toasts, Fehl-/Erfolgsmeldungen in de/en - Sprachumschalter ohne fetch+reload (kein Re-Submit-Dialog) - A11y: Esc schließt Modals, aria-live für Toasts, aria-labels auf Icon-Buttons; APP_KEY-Warnbanner im Dashboard - Dashboard-Sync: set_time_limit passend zur Site-Anzahl; Voucher-Sync mit Map statt SELECT pro Voucher Tooling: - GitHub-Actions-Workflow: PHP-Lint aller Dateien + de/en-Key-Parität https://claude.ai/code/session_01KKVpVPJjrTKGoRgpJcySD4
This commit is contained in:
parent
f747a3d429
commit
6e19958a37
31 changed files with 1040 additions and 628 deletions
59
lang/en.php
59
lang/en.php
|
|
@ -93,12 +93,12 @@ return [
|
|||
'voucher_create_btn' => 'Create Voucher',
|
||||
'voucher_creating' => 'Creating Voucher...',
|
||||
'voucher_success_title' => '✓ Your Access Code',
|
||||
'voucher_validity' => 'Valid for {minutes} minutes from creation',
|
||||
'voucher_validity' => 'Valid for {duration} from creation',
|
||||
'voucher_qr_label' => 'Scan QR code to connect',
|
||||
'voucher_print_btn' => 'Print Code',
|
||||
'voucher_no_sites' => 'No available sites found.',
|
||||
'voucher_no_sites_admin'=> 'Click here to create sites',
|
||||
'voucher_no_sites_user' => 'Please contact your administrator.',
|
||||
'voucher_no_sites_user' => 'Your account has no site access yet. Please contact your administrator to be granted permissions.',
|
||||
'voucher_template_select'=> '-- No Profile (manual) --',
|
||||
'voucher_template_label'=> 'Quick Profile (optional)',
|
||||
|
||||
|
|
@ -286,4 +286,59 @@ return [
|
|||
'never' => 'Never',
|
||||
'unknown' => 'Unknown',
|
||||
'or' => 'or',
|
||||
|
||||
// Durations (human readable)
|
||||
'dur_minutes' => '{n} minutes',
|
||||
'dur_hour_one' => '1 hour',
|
||||
'dur_hours' => '{n} hours',
|
||||
'dur_day_one' => '1 day',
|
||||
'dur_days' => '{n} days',
|
||||
|
||||
// Voucher creation (messages)
|
||||
'voucher_created_ok' => 'Voucher created successfully!',
|
||||
'voucher_created_mail' => 'Voucher created. Email sent.',
|
||||
'voucher_name_default' => 'Guest',
|
||||
'voucher_deleted' => 'Voucher deleted successfully!',
|
||||
'voucher_delete_failed'=> 'Voucher could not be deleted',
|
||||
'error_rate_limited' => 'Too many requests. Please wait a moment.',
|
||||
|
||||
// Clipboard / UI
|
||||
'toast_copied' => 'Copied!',
|
||||
'click_to_copy' => 'Click to copy',
|
||||
'copy_hint' => 'Click a code to copy it',
|
||||
'loading' => 'Loading…',
|
||||
'syncing' => 'Syncing…',
|
||||
'vouchers_loaded' => '{count} vouchers loaded',
|
||||
|
||||
// Confirm dialogs
|
||||
'confirm_delete_user' => 'Really delete this user?',
|
||||
'confirm_delete_site' => 'Really delete this site?',
|
||||
'confirm_delete_template' => 'Really delete this profile?',
|
||||
'confirm_delete_voucher' => 'Really delete this voucher?',
|
||||
'confirm_send_reset' => 'Send a password reset link to {email}?',
|
||||
'confirm_delete_token' => 'Really delete the token?',
|
||||
|
||||
// Admin messages
|
||||
'users_status_updated' => 'User status updated!',
|
||||
'sites_status_updated' => 'Site status updated!',
|
||||
'error_self_delete' => 'You cannot delete yourself',
|
||||
'error_self_deactivate' => 'You cannot deactivate yourself',
|
||||
'error_self_demote' => 'You cannot remove your own administrator rights',
|
||||
'error_pw_mismatch' => 'Passwords do not match',
|
||||
'error_pw_current' => 'Current password is incorrect',
|
||||
'error_email_exists' => 'Email address already exists',
|
||||
'error_user_create' => 'User could not be created',
|
||||
'reset_link_sent' => 'Password reset link has been sent to {email}.',
|
||||
'reset_link_failed' => 'User not found or no local password set.',
|
||||
'cron_token_generated' => 'New cron token generated!',
|
||||
'cron_token_deleted' => 'Cron token deleted!',
|
||||
'm365_secret_hint' => 'Leave empty to keep the current secret. To disable M365 login, clear the Client ID.',
|
||||
|
||||
// Site connection test
|
||||
'site_test_btn' => 'Test connection',
|
||||
'site_test_ok' => 'Connection successful',
|
||||
'site_test_fail' => 'Connection failed',
|
||||
|
||||
// System warnings
|
||||
'crypto_warning' => 'Encryption inactive: no valid APP_KEY is set in config.php. UniFi passwords are stored in plain text. If the APP_KEY changes (e.g. after a server move), controller logins will silently fail.',
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue