Merge branch 'feature/authentification' into frontendbackendtest
# Conflicts: # bibarts.sql
This commit is contained in:
33
Views/Auth/login.phtml
Normal file
33
Views/Auth/login.phtml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<?php if (!empty($errors['login'])): ?>
|
||||
<div class="error">
|
||||
<?php echo htmlspecialchars($errors['login']); ?>
|
||||
</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; ?>
|
||||
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
61
Views/Auth/register.phtml
Normal file
61
Views/Auth/register.phtml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
Reference in New Issue
Block a user