diff --git a/Controller/AuthController.php b/Controller/AuthController.php index b8808e8..79dab84 100644 --- a/Controller/AuthController.php +++ b/Controller/AuthController.php @@ -47,17 +47,17 @@ class AuthController $password = $_POST['password']; $result = $this->model->login($email, $password); - + if ($result === true) { - $_SESSION['user'] = $email; - header('Location: /bibarts/?controller=News&do=showNews'); - exit(); + $_SESSION['user'] = $email; + $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'); } } \ No newline at end of file diff --git a/Views/Auth/showLoginSuccess.phtml b/Views/Auth/showLoginSuccess.phtml new file mode 100644 index 0000000..459c67e --- /dev/null +++ b/Views/Auth/showLoginSuccess.phtml @@ -0,0 +1,15 @@ +
Sie werden in wenigen Sekunden zu den News weitergeleitet...
+Sie werden in wenigen Sekunden zum Login weitergeleitet...
+Das Event "" wurde erfolgreich erstellt!
WeiterDas Event mit der id"" wurde erfolgreich gelöscht!
WeiterDas Event mit der ID "" wurde erfolgreich bearbeitet!
WeiterKeine Gutscheine vorhanden.
- + \ No newline at end of file diff --git a/Views/News/showNews.phtml b/Views/News/showNews.phtml index 87aea09..f75478f 100644 --- a/Views/News/showNews.phtml +++ b/Views/News/showNews.phtml @@ -1,7 +1,6 @@ -+ |
Derzeit sind keine News verfügbar.
\ No newline at end of file diff --git a/Views/Standort/showStandorte.phtml b/Views/Standort/showStandorte.phtml index 3ac6cdb..3122c7f 100644 --- a/Views/Standort/showStandorte.phtml +++ b/Views/Standort/showStandorte.phtml @@ -1,5 +1,6 @@ +Keine Standorte gefunden.
- + \ No newline at end of file diff --git a/Views/header.phtml b/Views/header.phtml index 4ff88ce..b179475 100644 --- a/Views/header.phtml +++ b/Views/header.phtml @@ -15,7 +15,11 @@ Event Infos Profil - Login + + Logout + + Login + Register diff --git a/index.php b/index.php index abae14c..0d7b5c3 100644 --- a/index.php +++ b/index.php @@ -2,48 +2,46 @@ session_start(); include 'Views/header.phtml'; ?> -