Merge pull request 'Profilbearbeitung: Reviewnacharbeitung' (#22) from Profilbearbeitung into dev

Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
2026-06-03 22:25:42 +02:00
8 changed files with 195 additions and 153 deletions
+19 -11
View File
@@ -2,7 +2,7 @@
include_once 'php/controller/profile-controller.php';
$user = $user ?? null;
$isEditMode = isset($_GET["edit"]) && $_GET["edit"] === "1";
$isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
?>
<main class="form-page">
@@ -10,8 +10,8 @@ $isEditMode = isset($_GET["edit"]) && $_GET["edit"] === "1";
<div class="container">
<?php if (isset($error) && $error): ?>
<p style="color:red;">
<?php if (!empty($error)): ?>
<p class="alert-message is-error">
<?php echo htmlspecialchars($error); ?>
</p>
<?php endif; ?>
@@ -22,7 +22,7 @@ $isEditMode = isset($_GET["edit"]) && $_GET["edit"] === "1";
<input type="text"
name="vorname"
class="login-input"
value="<?php echo htmlspecialchars($user["vorname"] ?? ""); ?>"
value="<?php echo htmlspecialchars($_POST["vorname"] ?? $user["vorname"] ?? ""); ?>"
<?php echo $isEditMode ? "" : "readonly"; ?>
required>
@@ -30,7 +30,7 @@ $isEditMode = isset($_GET["edit"]) && $_GET["edit"] === "1";
<input type="text"
name="nachname"
class="login-input"
value="<?php echo htmlspecialchars($user["nachname"] ?? ""); ?>"
value="<?php echo htmlspecialchars($_POST["nachname"] ?? $user["nachname"] ?? ""); ?>"
<?php echo $isEditMode ? "" : "readonly"; ?>
required>
@@ -38,18 +38,26 @@ $isEditMode = isset($_GET["edit"]) && $_GET["edit"] === "1";
<input type="email"
name="email"
class="login-input"
value="<?php echo htmlspecialchars($user["email"] ?? ""); ?>"
value="<?php echo htmlspecialchars($_POST["email"] ?? $user["email"] ?? ""); ?>"
<?php echo $isEditMode ? "" : "readonly"; ?>
required>
<label class="input-label">
<?php echo $isEditMode ? "Neues Passwort" : "Passwort"; ?>
</label>
<input type="password"
name="password"
class="login-input"
placeholder="<?php echo $isEditMode ? "Leer lassen, wenn es gleich bleiben soll" : "********"; ?>"
<?php echo $isEditMode ? "" : "readonly"; ?>>
<?php if ($isEditMode): ?>
<input type="password"
name="password"
class="login-input"
placeholder="Leer lassen, wenn es gleich bleiben soll">
<?php else: ?>
<input type="password"
name="password"
class="login-input"
value="********"
readonly>
<?php endif; ?>
<br><br>
+9 -4
View File
@@ -1,16 +1,18 @@
<?php
include_once 'php/controller/register-controller.php';
$error = $error ?? null;
?>
<!--
Form: Registrierung
Funktion: Erstellung neuer Benutzerkonten
-->
<main class="login-page">
<div class="login-container">
<h1>Jetzt Registrieren!</h1>
<?php if ($error): ?>
<p style="color:red;">
<?php if (!empty($error)): ?>
<p class="alert-message is-error" style="color:red;">
<?php echo htmlspecialchars($error); ?>
</p>
<?php endif; ?>
@@ -22,6 +24,7 @@ $error = $error ?? null;
name="email"
class="login-input"
placeholder="mustermann@web.de"
value="<?php echo htmlspecialchars($_POST["email"] ?? ""); ?>"
required>
<p class="input-label">Vorname:</p>
@@ -29,6 +32,7 @@ $error = $error ?? null;
name="vorname"
class="login-input"
placeholder="Max"
value="<?php echo htmlspecialchars($_POST["vorname"] ?? ""); ?>"
required>
<p class="input-label">Nachname:</p>
@@ -36,6 +40,7 @@ $error = $error ?? null;
name="nachname"
class="login-input"
placeholder="Mustermann"
value="<?php echo htmlspecialchars($_POST["nachname"] ?? ""); ?>"
required>
<p class="input-label">Passwort:</p>