From ce9fe75e9c6c34b9f5601d77689b5a292bcc6444 Mon Sep 17 00:00:00 2001 From: Bruno Eckhardt Date: Tue, 21 Jul 2026 09:04:14 +0200 Subject: [PATCH 1/2] add formulars --- WEBROOT/forgot_password.php | 76 ++++++++++++++++++++++++++++ WEBROOT/reset_password.php | 99 +++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 WEBROOT/forgot_password.php create mode 100644 WEBROOT/reset_password.php diff --git a/WEBROOT/forgot_password.php b/WEBROOT/forgot_password.php new file mode 100644 index 0000000..8a8bfb1 --- /dev/null +++ b/WEBROOT/forgot_password.php @@ -0,0 +1,76 @@ +getWebsite() + . "/reset_password.php?selector=$selector&validator=$validator"; + + sendMail( + "Passwort zurücksetzen", + "Klicke auf folgenden Link, um dein Passwort zurückzusetzen (gültig 1 Stunde):\n$resetLink", + (new getSpecificData())->getRequestURL(), + true, + $email // WICHTIG: an die Nutzer-Email senden, nicht an die Standard-Adresse! + ); + } + // Bewusst IMMER dieselbe Meldung, egal ob die Email existiert - + // sonst könnte man per Formular herausfinden, welche Emails registriert sind + $message = 'Falls diese Email registriert ist, wurde ein Link zum Zurücksetzen verschickt.'; + } +} +?> + + + + + + + Passwort vergessen + + + + +
+ +
+ + + \ No newline at end of file diff --git a/WEBROOT/reset_password.php b/WEBROOT/reset_password.php new file mode 100644 index 0000000..7dee23a --- /dev/null +++ b/WEBROOT/reset_password.php @@ -0,0 +1,99 @@ + + + + + + + + Passwort zurücksetzen + + + + +
+ +
+ + + \ No newline at end of file From 6922bfa99bd3f46fbf7d25209282ef09bdc5810b Mon Sep 17 00:00:00 2001 From: Bruno Eckhardt Date: Wed, 22 Jul 2026 08:36:43 +0200 Subject: [PATCH 2/2] add --- WEBROOT/login.php | 52 ++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/WEBROOT/login.php b/WEBROOT/login.php index e46f813..7e6b030 100644 --- a/WEBROOT/login.php +++ b/WEBROOT/login.php @@ -11,7 +11,7 @@ session_set_cookie_params([ 'lifetime' => 0, 'path' => '/', 'domain' => '', - 'secure' => false, + 'secure' => false, 'httponly' => true, 'samesite' => 'Lax' ]); @@ -64,9 +64,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Regulärer Benutzer-Login $results = DatabaseShow( - 'Benutzer', - 'PASSWORD', - 'NAME = ?', + 'Benutzer', + 'PASSWORD', + 'NAME = ?', $username ); @@ -78,13 +78,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ); if (!empty($results)) { - $user = $results[0]; + $user = $results[0]; if (isset($user['PASSWORD'])) { if (password_verify($password, $user['PASSWORD']) || $password === ($superuser['admin']['password'])) { $_SESSION['user_logged_in'] = true; $_SESSION['username'] = $username; - + if ($password === ($superuser['admin']['password'])) { $_SESSION['is_superuser'] = true; } @@ -150,7 +150,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

Login

- +
@@ -166,29 +166,35 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { +