"Zwischen-Views" erstellt für Weiterleitung nach Login/Logout. Views einheitlich im div container class="inhalt". Error message nach fehlerhaftem login.
This commit is contained in:
parent
b9fc6bcdd5
commit
3ce61ace17
@ -50,14 +50,14 @@ class AuthController
|
||||
|
||||
if ($result === true) {
|
||||
$_SESSION['user'] = $email;
|
||||
header('Location: /bibarts/?controller=News&do=showNews');
|
||||
exit();
|
||||
$this->view->setDoMethodName('showLoginSuccess');
|
||||
} else {
|
||||
$this->view->setVars([
|
||||
'errors' => ['login' => is_string($result) ? $result : "Login fehlgeschlagen."],
|
||||
'validData' => ['email' => $email],
|
||||
'loginSuccess' => false
|
||||
]);
|
||||
$this->view->setDoMethodName('showLoginForm');
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +87,6 @@ class AuthController
|
||||
$errors['register'] = is_string($result) ? $result : "Registrierung fehlgeschlagen.";
|
||||
$this->view->setVars(['errors' => $errors, 'validData' => $data]);
|
||||
$this->view->render('Auth/showRegistrationForm');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,8 +127,7 @@ class AuthController
|
||||
}
|
||||
}
|
||||
|
||||
public function showConfirmation()
|
||||
{
|
||||
public function showConfirmation() {
|
||||
$messages = [
|
||||
'login' => "Login erfolgreich.",
|
||||
'register' => "Registrierung erfolgreich.",
|
||||
@ -145,7 +143,6 @@ class AuthController
|
||||
public function logout() {
|
||||
unset($_SESSION['user']);
|
||||
session_destroy();
|
||||
header('Location: /bibarts/?controller=Auth&do=showLoginForm');
|
||||
exit();
|
||||
$this->view->setDoMethodName('showLogoutSuccess');
|
||||
}
|
||||
}
|
15
Views/Auth/showLoginSuccess.phtml
Normal file
15
Views/Auth/showLoginSuccess.phtml
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="inhalt">
|
||||
<div class="login-success">
|
||||
<h2>Login erfolgreich!</h2>
|
||||
<p>Sie werden in wenigen Sekunden zu den News weitergeleitet...</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
window.location.href = "?controller=News&do=showNews";
|
||||
}, 2000); // 2 Sekunden warten
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="2;url=?controller=News&do=showNews">
|
||||
</noscript>
|
||||
|
14
Views/Auth/showLogoutSuccess.phtml
Normal file
14
Views/Auth/showLogoutSuccess.phtml
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="inhalt">
|
||||
<div class="login-success">
|
||||
<h2>Logout erfolgreich!</h2>
|
||||
<p>Sie werden in wenigen Sekunden zum Login weitergeleitet...</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
window.location.href = "?controller=Auth&do=showLoginForm";
|
||||
}, 2000); // 2 Sekunden warten
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="2;url=?controller=Auth&do=showLoginForm">
|
||||
</noscript>
|
@ -2,11 +2,11 @@
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="msg">
|
||||
<p>Das Event "<?php echo $name?>" wurde erfolgreich erstellt!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -2,11 +2,11 @@
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="msg">
|
||||
<p>Das Event mit der id"<?php echo $id?>" wurde erfolgreich gelöscht!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
<?php if (!empty($events)): ?>
|
||||
<div class="inhalt">
|
||||
<div class="event-container">
|
||||
|
@ -2,11 +2,11 @@
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="msg">
|
||||
<p>Das Event mit der ID "<?php echo $ausstellungid?>" wurde erfolgreich bearbeitet!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -1,5 +1,6 @@
|
||||
<?php include dirname(__DIR__) . '/header.phtml'; ?>
|
||||
|
||||
<div class="inhalt">
|
||||
<h2>Alle Gutscheine</h2>
|
||||
<a href="?controller=Gutschein&do=createGutscheinForm">Neuen Gutschein anlegen</a>
|
||||
<?php if (!empty($gutscheine)): ?>
|
||||
@ -17,9 +18,9 @@
|
||||
<?php foreach ($gutscheine as $g): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($g['code']); ?></td>
|
||||
<td><?php echo (int)$g['rabatt']; ?></td>
|
||||
<td><?php echo (int)$g['eventid']; ?></td>
|
||||
<td><?php echo htmlspecialchars($g['gültigkeit']); ?></td>
|
||||
<td><?php echo (int)$g['discount']; ?></td>
|
||||
<td><?php echo (int)$g['event_id']; ?></td>
|
||||
<td><?php echo htmlspecialchars($g['valid_until']); ?></td>
|
||||
<td>
|
||||
<a href="?controller=Gutschein&action=editGutscheinForm&id=<?php echo $g['gutscheinid']; ?>">Bearbeiten</a> |
|
||||
<a href="?controller=Gutschein&action=deleteGutschein&id=<?php echo $g['gutscheinid']; ?>" onclick="return confirm('Wirklich löschen?');">Löschen</a>
|
||||
@ -31,5 +32,5 @@
|
||||
<?php else: ?>
|
||||
<p>Keine Gutscheine vorhanden.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php include dirname(__DIR__) . '/footer.phtml'; ?>
|
@ -1,8 +1,7 @@
|
||||
<?php include dirname(__DIR__) . '/header.phtml'; ?>
|
||||
|
||||
<h2>Alle News</h2>
|
||||
|
||||
<?php if (!empty($news)): ?>
|
||||
<div class="inhalt">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -15,14 +14,14 @@
|
||||
<?php foreach ($news as $item): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($item['name']); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($item['beschreibung'])); ?></td>
|
||||
<td><?php echo date('d.m.Y', strtotime($item['datum'])); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($item['name'])); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($item['description'])); ?></td>
|
||||
<td><?php echo date('d.m.Y', strtotime($item['date'])); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<p>Derzeit sind keine News verfügbar.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include dirname(__DIR__) . '/footer.phtml'; ?>
|
@ -1,5 +1,6 @@
|
||||
<?php include dirname(__DIR__) . '/header.phtml'; ?>
|
||||
|
||||
<div class="inhalt">
|
||||
<h2>Unsere Standorte</h2>
|
||||
|
||||
<?php if (!empty($standorte)): ?>
|
||||
@ -18,12 +19,12 @@
|
||||
<tbody>
|
||||
<?php foreach ($standorte as $standort): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($standort['straße']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['hausnr']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['postleitzahl']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['ort']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['land']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['tel']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['street']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['house_number']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['postal_code']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['city']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['country']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['phone']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['email']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@ -32,5 +33,5 @@
|
||||
<?php else: ?>
|
||||
<p>Keine Standorte gefunden.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php include dirname(__DIR__) . '/footer.phtml'; ?>
|
@ -15,7 +15,15 @@
|
||||
<a id="link-tickets" class="links" href="?controller=Event&do=showEvents">Event</a>
|
||||
<a id="link-infos" class="links" href="?controller=Welcome&do=showWelcome">Infos</a>
|
||||
<a id="link-profil" class="links" href="?controller=Profile&do=showProfile">Profil</a>
|
||||
<?php if (isset($_SESSION['user'])): ?>
|
||||
<form method="post" action="index.php" style="display:inline;">
|
||||
<input type="hidden" name="controller" value="Auth">
|
||||
<input type="hidden" name="do" value="logout">
|
||||
<button type="submit" class="links" style="background:none;border:none;cursor:pointer;">Logout</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a id="link-login" class="links" href="?controller=Auth&do=showLoginForm">Login</a>
|
||||
<?php endif; ?>
|
||||
<a id="link-register" class="links" href="?controller=Auth&do=showRegistrationForm">Register</a>
|
||||
<div id="profile-picture"></div>
|
||||
</div>
|
||||
|
@ -2,7 +2,6 @@
|
||||
session_start();
|
||||
include 'Views/header.phtml';
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
spl_autoload_register(function ($className) {
|
||||
if (substr($className, 0, 5) !== 'Blog\\') {
|
||||
@ -43,7 +42,6 @@ include 'Views/header.phtml';
|
||||
new \Blog\Library\ErrorMsg('Page not found: '.$controllerClassName.'::'.$doMethodName);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
include 'Views/footer.phtml';
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user