Matomo-Tracking und Aufrufzaehlung absichern
This commit is contained in:
@@ -28,6 +28,11 @@ if ($baseUrl !== '' && (!str_starts_with($baseUrl, 'https://') || parse_url($bas
|
||||
foreach (app_matomo_configuration_errors() as $matomoError) {
|
||||
$errors[] = $matomoError;
|
||||
}
|
||||
foreach (['nutzungsanalyse.php', 'app/analytics-relay.php', 'assets/js/privacy-settings.js', 'assets/css/privacy-settings.css'] as $analyticsFile) {
|
||||
if (!is_file(APP_ROOT . '/' . $analyticsFile)) {
|
||||
$errors[] = "First-Party-Analyse-Datei {$analyticsFile} fehlt.";
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$dbTablePrefix = app_db_table_prefix();
|
||||
@@ -78,7 +83,7 @@ if (preg_match('~@import\s+url\(["\']?https?://|url\(["\']?https?://~i', $mainCs
|
||||
}
|
||||
|
||||
$privacyText = app_legal_document_text('privacy_notice');
|
||||
foreach (['Matomo', 'kaffeeliste_analytics_consent', 'Cookie-Einstellungen'] as $privacyRequirement) {
|
||||
foreach (['Matomo', 'kaffeeliste_analytics_consent', 'kaffeeliste_analytics_visitor', 'Cookie-Einstellungen', 'anonyme Aufrufzahlen'] as $privacyRequirement) {
|
||||
if (!str_contains($privacyText, $privacyRequirement)) {
|
||||
$errors[] = "Datenschutzerklärung nennt {$privacyRequirement} nicht.";
|
||||
}
|
||||
@@ -86,7 +91,7 @@ foreach (['Matomo', 'kaffeeliste_analytics_consent', 'Cookie-Einstellungen'] as
|
||||
|
||||
try {
|
||||
$pdo = app_db_pdo();
|
||||
foreach (['legal_acceptances', 'legal_requests', 'tenant_billing', 'rate_limit_attempts'] as $table) {
|
||||
foreach (['legal_acceptances', 'legal_requests', 'tenant_billing', 'rate_limit_attempts', 'public_page_views'] as $table) {
|
||||
$stmt = $pdo->prepare(
|
||||
'SELECT 1 FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ?'
|
||||
@@ -97,9 +102,9 @@ try {
|
||||
}
|
||||
}
|
||||
$stmt = $pdo->prepare('SELECT COUNT(*) FROM schema_migrations WHERE version = ?');
|
||||
$stmt->execute(['0030_contract_termination.sql']);
|
||||
$stmt->execute(['0032_public_page_views.sql']);
|
||||
if ((int)$stmt->fetchColumn() !== 1) {
|
||||
$errors[] = 'Migration 0030_contract_termination.sql ist nicht angewendet.';
|
||||
$errors[] = 'Migration 0032_public_page_views.sql ist nicht angewendet.';
|
||||
}
|
||||
$unknownTenants = (int)$pdo->query("SELECT COUNT(*) FROM tenants WHERE customer_type = 'unknown'")->fetchColumn();
|
||||
if ($unknownTenants > 0) {
|
||||
|
||||
Reference in New Issue
Block a user