diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4f2709a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Lint + +on: + push: + pull_request: + +jobs: + php-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + - name: PHP Syntax-Check (alle Dateien) + run: | + set -e + fail=0 + while IFS= read -r f; do + php -l "$f" > /dev/null || fail=1 + done < <(git ls-files '*.php') + exit $fail + - name: Sprachdateien-Paritaet (de/en) + run: | + php -r ' + $de = require "lang/de.php"; $en = require "lang/en.php"; + $missing = array_merge(array_diff(array_keys($de), array_keys($en)), array_diff(array_keys($en), array_keys($de))); + if ($missing) { fwrite(STDERR, "Fehlende Keys: " . implode(", ", $missing) . "\n"); exit(1); } + echo "OK: " . count($de) . " Keys synchron\n"; + ' diff --git a/admin/audit_log.php b/admin/audit_log.php index 0af636a..1cfb77e 100644 --- a/admin/audit_log.php +++ b/admin/audit_log.php @@ -45,22 +45,23 @@ $users = $db->fetchAll("SELECT id, name FROM users WHERE is_active = 1 ORDER BY $currentPage = 'audit_log'; $adminBase = ''; +// WICHTIG: Die Keys muessen den tatsaechlich via writeAuditLog() geschriebenen +// Action-Namen entsprechen (user_create, site_edit, ...), sonst erscheinen +// die Eintraege als rohe Keys. $actionLabels = [ - 'voucher_created' => '🎫 Voucher erstellt', + 'voucher_create' => '🎫 Voucher erstellt', 'voucher_bulk' => '🎫 Bulk Voucher', 'user_login' => '🔐 Login', - 'user_logout' => '🚪 Logout', - 'user_created' => '👤 Benutzer erstellt', - 'user_updated' => '👤 Benutzer geändert', - 'user_deleted' => '👤 Benutzer gelöscht', - 'site_added' => '🌐 Site hinzugefügt', - 'site_updated' => '🌐 Site geändert', - 'site_deleted' => '🌐 Site gelöscht', - 'settings_saved' => '⚙️ Einstellungen gespeichert', + 'user_create' => '👤 Benutzer erstellt', + 'user_edit' => '👤 Benutzer geändert', + 'user_delete' => '👤 Benutzer gelöscht', + 'site_create' => '🌐 Site hinzugefügt', + 'site_edit' => '🌐 Site geändert', + 'site_delete' => '🌐 Site gelöscht', 'password_reset' => '🔑 Passwort-Reset', - 'template_created' => '📋 Profil erstellt', - 'template_updated' => '📋 Profil geändert', - 'template_deleted' => '📋 Profil gelöscht', + 'update_installed' => '🔄 Update installiert', + 'update_failed' => '🔄 Update fehlgeschlagen', + 'migrations_run' => '🗄️ Migrationen ausgeführt', ]; ?> @@ -81,7 +82,6 @@ $actionLabels = [ .table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-primary); } .table tr:last-child td { border-bottom: none; } .table tr:hover td { background: var(--bg-hover); } - .badge { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 11px; font-weight: 500; } .filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; } .filter-bar select { padding: 9px 12px; border: 2px solid var(--border-color); border-radius: 8px; font-size: 13px; background: var(--bg-input); color: var(--text-primary); } .filter-bar select:focus { outline: none; border-color: var(--accent); } diff --git a/admin/index.php b/admin/index.php index e432205..6b8a32a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -26,6 +26,9 @@ if (isset($_GET['ajax_stats'])) { $syncErrors = []; if ($syncFirst) { + // Mehrere Sites werden sequentiell synchronisiert (je bis zu ~15s + // bei Timeout) – PHP-Default von 30s reicht dann nicht. + @set_time_limit(30 + count($sites) * 20); foreach ($sites as $site) { try { $ctrl = new UniFiController($site['unifi_controller_url'], $site['unifi_username'], Crypto::decrypt($site['unifi_password']), $site['site_id']); @@ -122,11 +125,6 @@ $currentPage = 'dashboard'; .table th { text-align: left; padding: 11px 14px; background: var(--bg-table-head); color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; } .table td { padding: 13px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); font-size: 14px; } .table tr:last-child td { border-bottom: none; } - .badge { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 11px; font-weight: 500; } - .badge-success { background: #d4edda; color: #155724; } - .badge-warning { background: #fff3cd; color: #856404; } - .badge-danger { background: #f8d7da; color: #721c24; } - .badge-info { background: var(--bg-badge-info); color: var(--text-badge-info); } .btn-primary { background: var(--accent); color: white; } .btn-primary:hover { background: var(--accent-hover); } .btn-success { background: var(--success); color: white; } @@ -161,6 +159,13 @@ $currentPage = 'dashboard'; @media(max-width:768px){ .main-content{ margin-left:0!important; } .stats-grid{ grid-template-columns:1fr 1fr; } } + +
= htmlspecialchars($bv['code']) ?>
+ = htmlspecialchars($bv['code']) ?>
Code anklicken zum Kopieren
+= __('copy_hint') ?>