Files
kaffeekasse-saas/konto.php
T
clemensandClaude Sonnet 5 f3045dbab9 M8: Datenexport pro Mandant
Neue Seite datenexport.php (Owner/Admin) laedt einen vollstaendigen
JSON-Export des eigenen Mandanten herunter: Stammdaten, Einstellungen,
Teilnehmer, Mitglieder mit Rolle, alle Ledger-Buchungen, Hinweise,
CSV-Importe, Mail-Versandlog und Admin-Protokoll. Passwort- und
Token-Hashes werden bewusst nicht exportiert; der Export selbst wird im
Audit-Log protokolliert. Link von konto.php aus.

Live getestet: eigens angelegter Test-Mandant, Export heruntergeladen,
Header und JSON-Struktur geprueft, keine Passwoerter im Export gefunden.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 20:10:30 +02:00

81 lines
2.7 KiB
PHP

<?php
require_once __DIR__ . '/functions.php';
$user = saas_require_login();
$devVerificationToken = null;
if (saas_should_show_auth_links() && !empty($_SESSION['saas_dev_email_verification_token'])) {
$devVerificationToken = (string)$_SESSION['saas_dev_email_verification_token'];
unset($_SESSION['saas_dev_email_verification_token']);
}
include 'header.php';
include 'headerline.php';
include 'nav.php';
?>
<section id="banner">
<div class="content">
<h2>Kundenkonto</h2>
<?php if (isset($_GET['registered'])): ?>
<div class="hint-box success"><p>Das Kundenkonto wurde angelegt.</p></div>
<?php endif; ?>
<?php if ($devVerificationToken !== null): ?>
<div class="hint-box success">
<p>Der Verifizierungslink wurde vorbereitet.</p>
<p><a href="email-verifizieren.php?token=<?php echo saas_html($devVerificationToken); ?>">Dev-Link zur E-Mail-Verifizierung</a></p>
</div>
<?php endif; ?>
<table>
<tr>
<th>Name</th>
<td><?php echo saas_html($user['display_name']); ?></td>
</tr>
<tr>
<th>E-Mail</th>
<td><?php echo saas_html($user['email']); ?></td>
</tr>
<tr>
<th>Kunde</th>
<td><?php echo saas_html($user['tenant_name']); ?></td>
</tr>
<tr>
<th>Kundenkürzel</th>
<td><?php echo saas_html($user['tenant_slug']); ?></td>
</tr>
<tr>
<th>Rolle</th>
<td><?php echo saas_html($user['role']); ?></td>
</tr>
<tr>
<th>E-Mail bestätigt</th>
<td><?php echo $user['email_verified_at'] !== null ? 'ja' : 'nein'; ?></td>
</tr>
</table>
<?php if ($user['email_verified_at'] === null): ?>
<form method="post" action="email-verifikation-senden.php">
<?php echo app_csrf_field(); ?>
<button type="submit">E-Mail-Verifizierung vorbereiten</button>
</form>
<?php endif; ?>
<?php if (saas_can_manage_tenant_settings($user)): ?>
<ul class="actions">
<li><a href="mandant-einstellungen.php" class="button">Mandant-Einstellungen</a></li>
<li><a href="datenexport.php" class="button">Datenexport</a></li>
</ul>
<?php endif; ?>
<form method="post" action="logout.php">
<?php echo app_csrf_field(); ?>
<button type="submit">Abmelden</button>
</form>
</div>
</section>
<?php include 'footer.php'; ?>