Add login page styles and refactor authentication views
- Introduced new styles for the login page, enhancing layout and responsiveness. - Updated the login view to utilize the new styles and improve user feedback for login errors and success messages. - Removed unused controllers and views related to contact and login functionalities to streamline the codebase. - Adjusted error message handling in the AuthController for better clarity on password requirements.
This commit is contained in:
@@ -2,32 +2,34 @@
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<?php if (!empty($errors['login'])): ?>
|
||||
<div class="error">
|
||||
<?php echo htmlspecialchars($errors['login']); ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php elseif (!empty($loginSuccess)): ?>
|
||||
<div class="msg">
|
||||
<p>Login für Benutzer <?php echo htmlspecialchars($_SESSION["user"]); ?> erfolgreich</p>
|
||||
<a href="?controller=Welcome&do=showWelcome">Weiter</a>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<!-- Formular anzeigen -->
|
||||
<form method="post">
|
||||
<input type="hidden" name="controller" value="Auth">
|
||||
<input type="hidden" name="do" value="login">
|
||||
|
||||
<label for="email">E-Mail:</label>
|
||||
<input type="email" name="email" id="email" value="<?= htmlspecialchars($validData['email'] ?? '') ?>">
|
||||
|
||||
<label for="password">Passwort:</label>
|
||||
<input type="password" name="password" id="password">
|
||||
|
||||
<button type="submit">Einloggen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
27
Views/Auth/showAuthForm.phtml
Normal file
27
Views/Auth/showAuthForm.phtml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include dirname(__DIR__) . '/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="login-container">
|
||||
<h1>Anmelden</h1>
|
||||
<form class="form-horizontal" action="#" method="post">
|
||||
<label>
|
||||
<input class="input-email" type="text" placeholder="E-Mail">
|
||||
</label>
|
||||
</form>
|
||||
<form class="form-horizontal" action="#" method="post">
|
||||
<label>
|
||||
<input class="input-passwort" type="text" placeholder="Passwort">
|
||||
</label>
|
||||
</form>
|
||||
<button class="button-loggin">Login</button>
|
||||
<a class="link-passwort-vergessen">Passwort vergessen?</a>
|
||||
<a class="link-konto-erstellen">Konto erstellen</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__) . '/footer.phtml';
|
||||
?>
|
||||
|
Reference in New Issue
Block a user