diff --git a/admin.php b/admin.php index a9a6958..8f6fdfc 100644 --- a/admin.php +++ b/admin.php @@ -68,6 +68,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { "); $stmt->execute([$userId, $isDemo, json_encode($newSettings)]); + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'integration', null, ['provider' => 'OUTLOOK', 'tenant_id' => $tenantId], 'SUCCESS', $adminUser['email']); + $message = "Centrale Microsoft 365 instellingen (Agenda, E-mail & Teams) zijn succesvol opgeslagen."; $messageType = 'success'; } @@ -93,6 +95,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { "); $stmt->execute([$userId, json_encode($existingSettings)]); + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'integration', null, ['provider' => 'JIRA', 'domain' => $companyDomain], 'SUCCESS', $adminUser['email']); + $message = "Standaard Atlassian Jira bedrijfsdomein is succesvol opgeslagen."; $messageType = 'success'; } @@ -136,6 +140,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $stmt->execute([$filterCode, $filterName, $projectKey ?: null, $jqlClause, $description, $isActive, $sortOrder]); $message = "Nieuw wachtrijfilter '{$filterName}' is succesvol toegevoegd."; } + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'jira_queue_filter', $filterId ?: null, ['filter_code' => $filterCode, 'filter_name' => $filterName], 'SUCCESS', $adminUser['email']); $messageType = 'success'; } } @@ -146,6 +151,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($filterId > 0) { $stmt = $db->prepare("DELETE FROM jira_queue_filters WHERE id = ?"); $stmt->execute([$filterId]); + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'jira_queue_filter', $filterId, ['action' => 'delete'], 'SUCCESS', $adminUser['email']); $message = "Wachtrijfilter is succesvol verwijderd."; $messageType = 'success'; } @@ -160,6 +166,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $fCode = trim($fCode); $upd->execute([$fCode !== '' ? $fCode : null, (int)$uId]); } + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'jira_assignments', null, [], 'SUCCESS', $adminUser['email']); $message = "Standaard Jira wachtrijtoewijzingen voor het team zijn succesvol opgeslagen."; $messageType = 'success'; } @@ -185,6 +192,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { set_system_setting('pomodoro_break', $pomoBreak); set_system_setting('default_task_duration', $taskDuration); + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'workday_settings', null, ['workday_start' => $workdayStart, 'workday_end' => $workdayEnd], 'SUCCESS', $adminUser['email']); + $message = "Organisatie werkdagstandaarden zijn succesvol bijgewerkt."; $messageType = 'success'; } @@ -205,6 +214,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { set_system_setting('ai_provider', $aiProvider); set_system_setting('ai_model', $aiModel); + fociz_log_audit($userId, 'SETTINGS_UPDATED', 'ai_settings', null, ['ai_enabled' => $aiEnabled, 'ai_provider' => $aiProvider, 'ai_model' => $aiModel], 'SUCCESS', $adminUser['email']); + $message = "AI Co-Pilot instellingen zijn succesvol opgeslagen."; $messageType = 'success'; } @@ -297,6 +308,13 @@ try { error_log("Fout bij ophalen jira filters/users: " . $e->getMessage()); } +$auditLogs = []; +try { + $auditLogs = $db->query("SELECT * FROM audit_logs ORDER BY created_at DESC LIMIT 50")->fetchAll() ?: []; +} catch (Throwable $e) { + error_log("Fout bij ophalen audit logs: " . $e->getMessage()); +} + $pageTitle = 'Systeembeheer & Integraties — Fociz'; require_once __DIR__ . '/includes/header.php'; ?> @@ -1194,6 +1212,116 @@ require_once __DIR__ . '/includes/header.php'; + + +
+ Centrale registratie van alle inlogpogingen, 2FA-verificaties, IP-detecties en beheerdersacties conform NIST SP 800-63B. +
+| Tijdstip | +Gebruiker / Doel | +Actie | +IP-adres | +Status | +Details | +
|---|---|---|---|---|---|
| + + Nog geen beveiligingsgebeurtenissen geregistreerd. + | +|||||
| + = date('d-m-Y H:i:s', strtotime($log['created_at'])) ?> + | ++ = htmlspecialchars($log['user_email'] ?? 'Systeem / Onbekend') ?> + | ++ + = htmlspecialchars($action) ?> + + | ++ = htmlspecialchars($log['ip_address'] ?? '—') ?> + | ++ + = htmlspecialchars($status) ?> + + | ++ = htmlspecialchars($detailsStr ?: '—') ?> + | +