- Implemented a new method in AuthController to display the registration form with localized labels and session error handling. - Updated the login view to include a link for account creation. - Enhanced the registration view with a link to the login form. - Removed the obsolete showRegisterPage view to streamline the codebase.
65 lines
2.9 KiB
PHTML
65 lines
2.9 KiB
PHTML
<?php include dirname(__DIR__).'/header.phtml'; ?>
|
|
|
|
<?php if (!empty($success)) : ?>
|
|
<div class="success-message" style="color: green; margin-bottom: 1em;">
|
|
<p><?php echo htmlspecialchars($success); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($errors)) : ?>
|
|
<div class="error-messages" style="color: red; margin-bottom: 1em;">
|
|
<ul>
|
|
<?php foreach ($errors as $field => $error) : ?>
|
|
<li><?php echo htmlspecialchars($error); ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form action="?controller=Auth&do=register" method="post">
|
|
<label for="vorname">Vorname:</label>
|
|
<input type="text" name="vorname" id="vorname" value="<?php echo htmlspecialchars($validData['vorname'] ?? ''); ?>" required>
|
|
|
|
<label for="nachname">Nachname:</label>
|
|
<input type="text" name="nachname" id="nachname" value="<?php echo htmlspecialchars($validData['nachname'] ?? ''); ?>" required>
|
|
|
|
<label for="straße">Straße:</label>
|
|
<input type="text" name="straße" id="straße" value="<?php echo htmlspecialchars($validData['straße'] ?? ''); ?>" required>
|
|
|
|
<label for="hausnr">Hausnummer:</label>
|
|
<input type="text" name="hausnr" id="hausnr" value="<?php echo htmlspecialchars($validData['hausnr'] ?? ''); ?>" required>
|
|
|
|
<label for="postleitzahl">Postleitzahl:</label>
|
|
<input type="text" name="postleitzahl" id="postleitzahl" value="<?php echo htmlspecialchars($validData['postleitzahl'] ?? ''); ?>" required>
|
|
|
|
<label for="ort">Ort:</label>
|
|
<input type="text" name="ort" id="ort" value="<?php echo htmlspecialchars($validData['ort'] ?? ''); ?>" required>
|
|
|
|
<label for="land">Land:</label>
|
|
<input type="text" name="land" id="land" value="<?php echo htmlspecialchars($validData['land'] ?? ''); ?>" required>
|
|
|
|
<label for="tel">Telefonnummer:</label>
|
|
<input type="text" name="tel" id="tel" value="<?php echo htmlspecialchars($validData['tel'] ?? ''); ?>">
|
|
|
|
<label for="email">E-Mail-Adresse:</label>
|
|
<input type="email" name="email" id="email" value="<?php echo htmlspecialchars($validData['email'] ?? ''); ?>" required>
|
|
|
|
<label for="password">Passwort:</label>
|
|
<input type="password" name="password" id="password" required>
|
|
|
|
<label for="password_repeat">Passwort wiederholen:</label>
|
|
<input type="password" name="password_repeat" id="password_repeat" required>
|
|
|
|
<label for="isAdmin">
|
|
<input type="checkbox" name="isAdmin" id="isAdmin" value="1" <?php echo (!empty($validData['isAdmin'])) ? 'checked' : ''; ?>>
|
|
Admin-Rechte
|
|
</label>
|
|
|
|
<button type="submit">Registrieren</button>
|
|
</form>
|
|
|
|
<div style="text-align:center; margin-top: 1.5em;">
|
|
<a href="?controller=Auth&do=showAuthForm" class="login-link">Bereits registriert? Hier einloggen</a>
|
|
</div>
|
|
|
|
<?php include dirname(__DIR__).'/footer.phtml'; ?> |