. // (team.update, trash.purge, auth.login_failed, export.membership_leads…). require_once __DIR__ . '/../shared/platform-tools/functions_audit.php'; function audit(string $action, array $d = []): void { platform_audit($GLOBALS['pdo'] ?? null, $action, $d); } // Email mascarado para registos de falhas: permite ver padrões (o mesmo // endereço atacado muitas vezes) sem guardar o endereço de quem se enganou. function audit_mask_email(string $email): string { $email = strtolower(trim($email)); if (!str_contains($email, '@')) return $email === '' ? '' : mb_substr($email, 0, 1) . '…'; [$u, $d] = explode('@', $email, 2); return mb_substr($u, 0, 1) . '…@' . $d; }