Weitere Reviewänderungen

This commit is contained in:
2026-05-31 22:53:58 +02:00
parent 5db4ad3e63
commit 21bdb0d66d
3 changed files with 45 additions and 40 deletions
+1 -1
View File
@@ -15,5 +15,5 @@ if (isset($_SESSION["user_email"])) {
$_SESSION = [];
session_destroy();
header("Location: index.php?pfad=register");
header("Location: index.php");
exit();
+34 -36
View File
@@ -1,55 +1,53 @@
<?php
include_once 'php/controller/profile-controller.php';
$user = $user ?? null;
$error = $error ?? null;
?>
<!--
Content: Profil
Inhalt: Das eigene Profil, wenn man angemeldet ist.
Dort werden die aktuellen Profildaten angezeigt.
Form: Login-Bereich
Funktion: Benutzerauthentifizierung und Zugang zum eigenen Profil, Erstellen von Beiträgen, etc.
-->
<main class="login-page">
<div class="login-container">
<main class="form-page">
<h1>Bitte anmelden</h1>
<div class="form-container">
<?php if ($error): ?>
<p style="color:red;">
<?php echo htmlspecialchars($error); ?>
</p>
<?php endif; ?>
<h1>Mein Profil</h1>
<form method="post" action="index.php?pfad=login">
<form>
<label class="input-label">Name</label>
<input type="text"
class="login-input"
readonly
value="<?php echo htmlspecialchars($user["username"] ?? ""); ?>">
<label class="input-label">Email-Adresse</label>
<p class="input-label">Benutzername/E-Mail-Adresse:</p>
<input type="email"
name="email"
class="login-input"
readonly
value="<?php echo htmlspecialchars($user["email"] ?? ""); ?>">
placeholder="E-Mail-Adresse"
required
autofocus>
<label class="input-label">Passwort</label>
<p class="input-label">Passwort:</p>
<input type="password"
name="password"
class="login-input"
readonly
value="********">
placeholder="Passwort"
required>
<button type="submit"
value="anmelden"
name="loginSubmit"
class="login-button">
anmelden
</button>
<div class="register-link">
<a href="index.php?pfad=register">
Noch keinen Account? Jetzt hier registrieren!
</a>
</div>
</form>
<br>
<a href="index.php?pfad=deleteAccount" class="login-button">
Account löschen
</a>
<br><br>
<a href="index.php?pfad=logout" class="login-button">
Abmelden
</a>
</div>
</main>
+10 -3
View File
@@ -5,9 +5,17 @@ ob_start();
$pfad = $_GET["pfad"] ?? "home";
/*
Aktionen wie Logout oder Account löschen müssen vor der HTML-Ausgabe
verarbeitet werden, damit Weiterleitungen mit header() funktionieren.
Controller für Aktionen werden vor der HTML-Ausgabe geladen,
damit Weiterleitungen mit header() funktionieren.
*/
if ($pfad === "login") {
include_once "php/controller/login-controller.php";
}
if ($pfad === "register") {
include_once "php/controller/register-controller.php";
}
if ($pfad === "logout") {
include_once "content/logout.php";
exit();
@@ -57,7 +65,6 @@ if ($pfad === "deleteAccount") {
?>
</body>
</html>
<?php