LuminaWebsite/includes/bootstrap.php
Maaxxs cd8716e791 Data export and account deletion (anonymization) with a grace period
- Data export (Art. 15/20 GDPR, includes/data_export.php): ZIP with daten.json, LIESMICH.txt and the
  member's own images (avatar, characters, gallery, bug reports). It covers every table related to the
  account plus, via the bot API, raid sign-ups, premades, created events and activity checks. Password hash,
  tokens and player reports (they name the reporters) are left out. The ZIP is written by data_export_zip(),
  so the PHP zip extension is not needed.
- Members find export and deletion under "Mein Profil" at the very bottom in a collapsed "Konto & Daten"
  section (data_export.php, account_delete.php).
- Leadership: new icon "Daten & Löschung" in the user admin (admin/user_export.php, permission users.export).
  It downloads the export or creates a download link for someone without access (datenauskunft.php?t=...,
  7 days, 5 downloads, only the SHA-256 hash stored in data_export_links). The link page shows a button first,
  so link previews don't use up downloads. It also works in maintenance mode.
- Account deletion (includes/account_deletion.php): the account is anonymized instead of removed.
  - Deleted: profile, avatar, characters, gallery, gear sets, private tactics, groups, tokens, calendar
    participations and bug report images.
  - Contributions remain as "Ehemaliges Mitglied" without name or Discord ID.
  - Requested by the member (type LÖSCHEN) or by the leadership (users.delete, also immediately).
  - Executed after 7 days by account_deletion_run_due(); logging in before that cancels it and tells the member.
- The user admin shows "Löschung am ..." and "Gelöscht (unkenntlich)". Privacy policy, README and a
  leadership patch note are updated. Schema v44 (users.deletion_scheduled_at, users.deleted_at, data_export_links).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:02:42 +02:00

56 lines
2 KiB
PHP

<?php
declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', '0');
// Manche Hoster liefern per Default einen abweichenden Zeichensatz im
// Content-Type-Header aus, der die <meta charset>-Angabe im HTML überstimmt
// und dann Umlaute (oe/ae/ue) kaputt macht. Deshalb hier explizit erzwingen.
ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');
// Alle Zeiten in deutscher Zeit. Der Bot rechnet Raid- und Event-Zeiten ebenfalls als deutsche
// Zeit um. Ohne diese Zeile nimmt PHP die Zeitzone des Hosters (oft UTC) - dann erscheint ein
// Raid um 9 Uhr auf der Website als 7 Uhr (Sommerzeit), und beim naechsten Bearbeiten wuerde
// er sogar auf 7 Uhr verschoben.
date_default_timezone_set('Europe/Berlin');
header('Content-Type: text/html; charset=UTF-8');
if (session_status() !== PHP_SESSION_ACTIVE) {
session_set_cookie_params([
'httponly' => true,
'samesite' => 'Lax',
]);
session_start();
}
require_once __DIR__ . '/db.php';
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/map_links.php';
require_once __DIR__ . '/member_picker.php';
require_once __DIR__ . '/auth.php';
require_once __DIR__ . '/permissions.php';
require_once __DIR__ . '/schema.php';
require_once __DIR__ . '/settings.php';
require_once __DIR__ . '/admin_log.php';
require_once __DIR__ . '/security.php';
require_once __DIR__ . '/moderation.php';
require_once __DIR__ . '/patchnotes.php';
require_once __DIR__ . '/legal.php';
require_once __DIR__ . '/account_deletion.php';
require_once __DIR__ . '/site_notice.php';
ensure_schema();
// Beantragte Kontoloeschungen, deren Frist abgelaufen ist, ausfuehren (hoechstens alle 15 Minuten)
account_deletion_run_due();
// Sitzung abgelaufen, aber "angemeldet bleiben"-Cookie da: wieder anmelden (includes/auth.php)
auth_remember_restore();
// Tempolimit fuer abgeschickte Formulare (Spam-/Missbrauchsschutz, siehe includes/security.php)
security_guard_post();
// Wartungsmodus: alle ohne site.maintenance sehen nur die Wartungsseite (includes/site_notice.php)
maintenance_gate();