- 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.
38 lines
1.6 KiB
PHTML
38 lines
1.6 KiB
PHTML
<?php
|
|
include dirname(__DIR__).'/header.phtml';
|
|
?>
|
|
|
|
<div class="login-page-bg">
|
|
<div class="login-container">
|
|
<h2 class="login-title">Login</h2>
|
|
<?php if (!empty($errors['login'])): ?>
|
|
<div class="login-error">
|
|
<?php echo htmlspecialchars($errors['login']); ?>
|
|
</div>
|
|
<?php elseif (!empty($loginSuccess)): ?>
|
|
<div class="login-success">
|
|
<p>Login für Benutzer <?php echo htmlspecialchars($_SESSION["user"]); ?> erfolgreich</p>
|
|
<a class="login-link" href="?controller=Welcome&do=showWelcome">Weiter</a>
|
|
</div>
|
|
<?php else: ?>
|
|
<form method="post" class="login-form">
|
|
<input type="hidden" name="controller" value="Auth">
|
|
<input type="hidden" name="do" value="login">
|
|
<div class="login-field">
|
|
<label for="email">E-Mail:</label>
|
|
<input type="email" name="email" id="email" value="<?= htmlspecialchars($validData['email'] ?? '') ?>">
|
|
</div>
|
|
<div class="login-field">
|
|
<label for="password">Passwort:</label>
|
|
<input type="password" name="password" id="password">
|
|
</div>
|
|
<button class="login-btn" type="submit">Einloggen</button>
|
|
</form>
|
|
<div style="text-align:center; margin-top: 1.5em;">
|
|
<a href="?controller=Auth&do=register" class="login-link">Konto erstellen</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php include dirname(__DIR__).'/footer.phtml'; ?> |