Rechtstexte und B2C-Vertragsabläufe absichern

This commit is contained in:
2026-08-22 14:31:56 +02:00
parent d320a4fd7a
commit a31a235422
58 changed files with 2502 additions and 316 deletions
+31 -5
View File
@@ -35,12 +35,12 @@ $checks = [
[
'label' => 'Impressum',
'path' => 'impressum.php',
'contains' => ['Impressum', 'In den Sieben Stücken 9d', '30655 Hannover'],
'contains' => ['Impressum', 'In den Sieben Stücken 9d', '30655 Hannover', 'ticketsystem.ctb-it.de'],
],
[
'label' => 'AGB',
'path' => 'agb.php',
'contains' => ['Allgemeine Geschäftsbedingungen', 'Entwurf'],
'contains' => ['Allgemeine Geschäftsbedingungen', 'Verbraucher', 'Verträge hier kündigen'],
],
[
'label' => 'Preise',
@@ -52,6 +52,26 @@ $checks = [
'path' => 'datenschutz.php',
'contains' => ['Datenschutzerklärung', 'Verantwortlicher', 'Auftragsverarbeiter'],
],
[
'label' => 'AVV',
'path' => 'avv.php',
'contains' => ['Auftragsverarbeitungsvertrag', 'Technische und organisatorische Maßnahmen', 'netcup'],
],
[
'label' => 'Widerrufsbelehrung',
'path' => 'widerruf.php',
'contains' => ['Widerrufsbelehrung', 'vierzehn Tagen', 'Vertrag widerrufen'],
],
[
'label' => 'Elektronische Widerrufsfunktion',
'path' => 'widerrufen.php',
'contains' => ['Vertrag widerrufen', 'Widerruf prüfen'],
],
[
'label' => 'Kündigungsschaltfläche',
'path' => 'kuendigen.php',
'contains' => ['Vertrag kündigen', 'Kündigung prüfen'],
],
[
'label' => 'Dashboard',
'path' => 'index.php',
@@ -396,6 +416,10 @@ $passes = 0;
echo "HTTP smoke base URL: {$baseUrl}\n";
// Der Smoke-Test erzeugt absichtlich einen Login. Frühere lokale Testläufe
// dürfen diesen nicht über das produktive IP-Limit beeinflussen.
$pdo->prepare('DELETE FROM rate_limit_attempts WHERE bucket = ?')->execute(['login_ip:127.0.0.1']);
// Testmandant anlegen und per HTTP anmelden.
try {
$seeded = smoke_seed($pdo, $smokeSlug, $smokeEmail, $smokePassword, $suffix);
@@ -415,16 +439,17 @@ foreach ($checks as $i => $check) {
$authCookies = [];
$loginPage = smoke_fetch(smoke_url($baseUrl, 'login.php'), $authCookies);
preg_match('/name="csrf_token" value="([^"]+)"/', $loginPage['body'], $csrfMatch);
smoke_fetch(smoke_url($baseUrl, 'login.php'), $authCookies, 'POST', http_build_query([
$loginResponse = smoke_fetch(smoke_url($baseUrl, 'login.php'), $authCookies, 'POST', http_build_query([
'csrf_token' => $csrfMatch[1] ?? '',
'email' => $smokeEmail,
'password' => $smokePassword,
'tenant_slug' => $smokeSlug,
]));
if (empty($authCookies)) {
if ($loginResponse['status'] !== 302 || !str_contains((string)$loginResponse['location'], 'index.php')) {
smoke_cleanup($pdo, $smokeTenantId, $smokeEmail);
fwrite(STDERR, "HTTP smoke: Anmeldung fehlgeschlagen (keine Session).\n");
$pdo->prepare('DELETE FROM rate_limit_attempts WHERE bucket = ?')->execute(['login_ip:127.0.0.1']);
fwrite(STDERR, "HTTP smoke: Anmeldung fehlgeschlagen (kein Redirect auf index.php).\n");
exit(1);
}
@@ -519,6 +544,7 @@ foreach ($skippedUnsafe as $skip) {
}
smoke_cleanup($pdo, $smokeTenantId, $smokeEmail);
$pdo->prepare('DELETE FROM rate_limit_attempts WHERE bucket = ?')->execute(['login_ip:127.0.0.1']);
if ($failures !== []) {
echo "\nHTTP smoke failed with " . count($failures) . " failure(s):\n";