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
+48 -3
View File
@@ -3,6 +3,7 @@
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/app/saas-mail.php';
require_once __DIR__ . '/app/rate-limit.php';
require_once __DIR__ . '/app/legal.php';
$pdo = app_db_pdo();
$errors = [];
@@ -11,6 +12,7 @@ $values = [
'tenant_slug' => trim((string)($_POST['tenant_slug'] ?? '')),
'display_name' => trim((string)($_POST['display_name'] ?? '')),
'email' => trim((string)($_POST['email'] ?? '')),
'customer_type' => (string)($_POST['customer_type'] ?? ''),
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@@ -26,13 +28,30 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'email' => $values['email'],
'password' => (string)($_POST['password'] ?? ''),
'password_confirm' => (string)($_POST['password_confirm'] ?? ''),
'customer_type' => $values['customer_type'],
'accept_terms' => !empty($_POST['accept_terms']),
'acknowledge_privacy' => !empty($_POST['acknowledge_privacy']),
'accept_dpa' => !empty($_POST['accept_dpa']),
]);
if ($result['ok']) {
$contractMail = saas_send_registration_contract_mail(
$values['email'],
$values['tenant_name'],
(string)$result['identity']['tenant_slug'],
$values['customer_type']
);
$verificationMail = ['ok' => true];
if (!empty($result['email_verification_token'])) {
saas_send_email_verification_mail($values['email'], (string)$result['email_verification_token']);
$verificationMail = saas_send_email_verification_mail($values['email'], (string)$result['email_verification_token']);
}
saas_session_login($result['identity']);
if (empty($contractMail['ok'])) {
$_SESSION['saas_contract_mail_failed'] = true;
}
if (empty($verificationMail['ok'])) {
$_SESSION['saas_verification_mail_failed'] = true;
}
if (saas_should_show_auth_links() && !empty($result['email_verification_token'])) {
$_SESSION['saas_dev_email_verification_token'] = (string)$result['email_verification_token'];
}
@@ -68,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="public-auth-grid">
<div class="public-auth-copy">
<h1>Registrierung</h1>
<p>Lege einen neuen Kundenbereich an. Danach bist du als Owner angemeldet und kannst die Kaffeeliste für dein Team einrichten.</p>
<p>Lege kostenlos einen neuen Kundenbereich an. Das Angebot kann privat oder geschäftlich genutzt werden.</p>
</div>
<div class="public-panel">
@@ -85,6 +104,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<form method="post" action="register.php">
<?php echo app_csrf_field(); ?>
<div class="row">
<div class="col-12">
<fieldset>
<legend>Du registrierst dich als</legend>
<input type="radio" name="customer_type" id="customer_type_business" value="business"<?php echo $values['customer_type'] === 'business' ? ' checked' : ''; ?> required>
<label for="customer_type_business">Unternehmen / selbstständige Tätigkeit</label>
<input type="radio" name="customer_type" id="customer_type_consumer" value="consumer"<?php echo $values['customer_type'] === 'consumer' ? ' checked' : ''; ?> required>
<label for="customer_type_consumer">Verbraucher / private Nutzung</label>
</fieldset>
</div>
<div class="col-6 col-12-small">
<label for="tenant_name">Kundenname</label>
<input type="text" name="tenant_name" id="tenant_name" value="<?php echo saas_html($values['tenant_name']); ?>" required>
@@ -109,9 +137,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<label for="password_confirm">Passwort wiederholen</label>
<input type="password" name="password_confirm" id="password_confirm" minlength="8" required>
</div>
<div class="col-12">
<input type="checkbox" name="accept_terms" id="accept_terms" value="1" required>
<label for="accept_terms">Ich akzeptiere die <a href="agb.php" target="_blank" rel="noopener">AGB (Stand <?php echo saas_html(APP_TERMS_VERSION); ?>)</a>.</label>
</div>
<div class="col-12">
<input type="checkbox" name="acknowledge_privacy" id="acknowledge_privacy" value="1" required>
<label for="acknowledge_privacy">Ich habe die <a href="datenschutz.php" target="_blank" rel="noopener">Datenschutzerklärung (Stand <?php echo saas_html(APP_PRIVACY_VERSION); ?>)</a> gelesen. Dies ist keine Einwilligung in optionale Werbung oder Tracking.</label>
</div>
<div class="col-12">
<input type="checkbox" name="accept_dpa" id="accept_dpa" value="1" required>
<label for="accept_dpa">Ich vereinbare den <a href="avv.php" target="_blank" rel="noopener">Auftragsverarbeitungsvertrag (Stand <?php echo saas_html(APP_DPA_VERSION); ?>)</a>, soweit ich Daten anderer Personen in der Kaffeeliste verwalte.</label>
</div>
</div>
<p><small>Das Kundenkonto ist kostenlos. Verbraucher haben ein 14-tägiges <a href="widerruf.php">Widerrufsrecht</a>.</small></p>
<ul class="actions">
<li><button type="submit" class="primary">Kundenkonto anlegen</button></li>
<li><button type="submit" class="primary">Kostenloses Kundenkonto anlegen</button></li>
<li><a href="login.php" class="button">Zum Login</a></li>
</ul>
</form>
@@ -124,7 +165,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<a href="impressum.php">Impressum</a>
<a href="agb.php">AGB</a>
<a href="datenschutz.php">Datenschutz</a>
<a href="avv.php">AVV</a>
<a href="widerruf.php">Widerrufsbelehrung</a>
<a class="legal-action-link" href="widerrufen.php">Vertrag widerrufen</a>
<a href="preise.php">Preise</a>
<a class="legal-action-link" href="kuendigen.php">Verträge hier kündigen</a>
</footer>
<script src="assets/js/jquery.min.js"></script>