From 0834e1f733542a4ba0fe8474c2c4ffdaaf651571 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Wed, 19 Nov 2025 00:49:53 +0100 Subject: [PATCH] com --- public/account.php | 282 +++++++++++++++++--------------- public/assets/css/main.css | 186 +++++++++++++++++++++ public/assets/js/lang.js | 45 +++++ public/index.php | 149 ++++------------- public/login.php | 182 ++++++++++++++------- public/partials/footer.php | 13 ++ public/partials/header.php | 107 ++++++------ public/register.php | 259 +++++++++++++++-------------- src/Database.php | 25 --- src/{Auth.php => auth.php} | 0 src/demo.txt | 1 - src/{Session.php => sesion.php} | 0 12 files changed, 725 insertions(+), 524 deletions(-) create mode 100644 public/partials/footer.php delete mode 100644 src/Database.php rename src/{Auth.php => auth.php} (100%) delete mode 100644 src/demo.txt rename src/{Session.php => sesion.php} (100%) diff --git a/public/account.php b/public/account.php index 864835f..d7289cd 100644 --- a/public/account.php +++ b/public/account.php @@ -1,177 +1,201 @@ - + - Mein Konto – USBCheck + Mein Konto – usbcheck.it - + - + - + -
-
-
-

Mein Konto

-

- Verwalte deine Profildaten und behalte deine USB-Tests im Überblick. -

+
+
+ -
+
+ + diff --git a/public/assets/css/main.css b/public/assets/css/main.css index 1e133a4..2825b7d 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -553,3 +553,189 @@ body { grid-template-columns: 1fr; } } + + +/* Auth / Forms / Account */ + +.auth-page { + padding: 4rem 0; +} + +.auth-layout { + max-width: 480px; + margin: 0 auto; +} + +.auth-card { + background: #fff; + border-radius: 18px; + padding: 1.6rem 1.8rem; + box-shadow: var(--shadow-soft); + border: 1px solid rgba(200, 203, 208, 0.5); +} + +.auth-title { + font-family: 'Montserrat', system-ui, sans-serif; + font-weight: 700; + font-size: 1.5rem; + margin: 0 0 0.35rem; + color: var(--deep-gray); +} + +.auth-subtitle { + font-size: 0.95rem; + color: #555; + margin: 0 0 1.5rem; +} + +.auth-flash-success, +.auth-flash-error { + border-radius: 12px; + padding: 0.75rem 0.9rem; + font-size: 0.9rem; + margin-bottom: 1rem; +} + +.auth-flash-success { + background: #e6f9ef; + border: 1px solid rgba(3, 193, 96, 0.4); + color: #145c32; +} + +.auth-flash-error { + background: #fde7ea; + border: 1px solid rgba(230, 57, 70, 0.4); + color: #7f1d1d; +} + +.form-row { + margin-bottom: 1rem; +} + +.form-label { + display: block; + font-size: 0.85rem; + color: #555; + margin-bottom: 0.3rem; +} + +.form-input, +.form-select, +.form-textarea { + width: 100%; + border-radius: 10px; + border: 1px solid var(--silver); + padding: 0.55rem 0.7rem; + font-size: 0.95rem; + font-family: inherit; + transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease; + background: #fff; +} + +.form-input:focus, +.form-select:focus, +.form-textarea:focus { + outline: none; + border-color: var(--brand-blue); + box-shadow: 0 0 0 1px rgba(0, 81, 255, 0.15); + background: #fff; +} + +.form-input[readonly], +.form-select[readonly] { + background: #f3f4f6; + color: #666; +} + +.form-error { + margin-top: 0.3rem; + font-size: 0.8rem; + color: var(--error-red); +} + +.form-help { + margin-top: 0.3rem; + font-size: 0.8rem; + color: #777; +} + +.form-actions { + margin-top: 1.5rem; + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.75rem; +} + +.auth-link { + font-size: 0.9rem; + color: var(--brand-blue); + text-decoration: none; +} + +.auth-link:hover { + text-decoration: underline; +} + +/* Account page */ + +.account-page { + padding: 4rem 0; +} + +.account-grid { + display: grid; + grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr); + gap: 2rem; +} + +.account-card { + background: #fff; + border-radius: 18px; + padding: 1.6rem 1.8rem; + box-shadow: var(--shadow-soft); + border: 1px solid rgba(200, 203, 208, 0.5); +} + +.account-title { + font-family: 'Montserrat', system-ui, sans-serif; + font-weight: 700; + font-size: 1.4rem; + margin: 0 0 0.4rem; + color: var(--deep-gray); +} + +.account-subtitle { + margin: 0 0 1.4rem; + font-size: 0.95rem; + color: #555; +} + +.account-meta { + font-size: 0.85rem; + color: #777; +} + +.account-avatar-preview { + display: flex; + align-items: center; + gap: 1rem; + margin-top: 0.75rem; +} + +.account-avatar-preview .user-avatar { + width: 44px; + height: 44px; + font-size: 1.05rem; +} + +.account-avatar-note { + font-size: 0.85rem; + color: #666; +} + +@media (max-width: 900px) { + .account-grid { + grid-template-columns: 1fr; + } +} diff --git a/public/assets/js/lang.js b/public/assets/js/lang.js index 4373c9b..f5a0136 100644 --- a/public/assets/js/lang.js +++ b/public/assets/js/lang.js @@ -3,6 +3,18 @@ (function () { const translations = { de: { + + header_slogan: "USB-Sticks testen", + btn_login: "Login", + + nav_how: "Ablauf", + nav_problem: "Problem", + nav_features: "Funktionen", + nav_security: "Sicherheit", + nav_faq: "FAQ", + + footer_imprint: "Impressum", + footer_privacy: "Datenschutz", brand_wordmark: "usbcheck.it", brand_subtitle: "USB-Sticks auf Fakes testen", btn_login: "Login", @@ -118,6 +130,17 @@ }, en: { + header_slogan: "Test USB drives", + btn_login: "Login", + + nav_how: "How it works", + nav_problem: "Why it matters", + nav_features: "Features", + nav_security: "Security", + nav_faq: "FAQ", + + footer_imprint: "Imprint", + footer_privacy: "Privacy policy", brand_wordmark: "usbcheck.it", brand_subtitle: "Test USB drives for fakes", btn_login: "Login", @@ -234,6 +257,17 @@ // Italienisch (kurz, sachlich) it: { + header_slogan: "Test delle chiavette USB", + btn_login: "Accesso", + + nav_how: "Come funziona", + nav_problem: "Perché è importante", + nav_features: "Funzioni", + nav_security: "Sicurezza", + nav_faq: "FAQ", + + footer_imprint: "Imprint", + footer_privacy: "Privacy", brand_wordmark: "usbcheck.it", brand_subtitle: "Controlla le chiavette USB contraffatte", btn_login: "Login", @@ -351,6 +385,17 @@ // Französisch (kurz, sachlich) fr: { + header_slogan: "Tester vos clés USB", + btn_login: "Connexion", + + nav_how: "Fonctionnement", + nav_problem: "Problème", + nav_features: "Fonctionnalités", + nav_security: "Sécurité", + nav_faq: "FAQ", + + footer_imprint: "Mentions légales", + footer_privacy: "Confidentialité", brand_wordmark: "usbcheck.it", brand_subtitle: "Tester les clés USB contrefaites", btn_login: "Connexion", diff --git a/public/index.php b/public/index.php index 495b975..ddb2bd8 100644 --- a/public/index.php +++ b/public/index.php @@ -1,124 +1,42 @@ - - - - - USBCheck – Test USB-Sticks auf Fakes - +// Sprachlogik: +$lang = $_GET['lang'] ?? 'en'; +$lang = in_array($lang, ['de','en','it','fr']) ? $lang : 'en'; - +// User-Dummy (später über Login ersetzen) +$userInitials = null; +?> + + + + + + usbcheck.it – Test USB-Sticks + + + + - + - + + + + -
- -
- -
- - +
@@ -512,20 +430,11 @@
- - + + +
- - - + - + \ No newline at end of file diff --git a/public/login.php b/public/login.php index 4f7eefe..8cf89bb 100644 --- a/public/login.php +++ b/public/login.php @@ -1,82 +1,146 @@ login($identifier, $password)) { - header('Location: /'); // nach Login auf Startseite - exit; - } else { - $error = 'Login fehlgeschlagen. Bitte Zugangsdaten prüfen.'; +// Optional: Redirect-Ziel (z. B. ?redirect=/account.php) +$redirect = '/account.php'; +if (!empty($_GET['redirect']) && is_string($_GET['redirect'])) { + // Nur interne Pfade erlauben, keine kompletten URLs + if (strpos($_GET['redirect'], '/') === 0) { + $redirect = $_GET['redirect']; } } +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // CSRF prüfen + if (!auth_verify_csrf($_POST['csrf_token'] ?? null)) { + $globalError = 'Sicherheitsfehler. Bitte die Seite neu laden und erneut versuchen.'; + } else { + $identifier = trim((string)($_POST['identifier'] ?? '')); + $password = (string)($_POST['password'] ?? ''); + + $result = auth_login($identifier, $password); + + if ($result['success'] === true) { + header('Location: ' . $redirect); + exit; + } else { + $errors = $result['errors'] ?? []; + } + } +} + +$csrfToken = auth_csrf_token(); ?> - + Login – usbcheck.it - - + + + + + + + + - -
-
-

- Anmelden bei usbcheck.it -

+ + - -
- -
- +
+
+
+
+

+ Anmelden bei usbcheck.it +

+

+ Melde dich mit deiner E-Mail-Adresse oder deinem Benutzernamen an, um deine USB-Tests und Geräte zu verwalten. +

-
-
- - -
+ +
+ +
+ -
- - -
+ +
+ +
+ - -
+
+
+ + +
+ +
+ + +
+ + + + +
+
-
+ + + + + + diff --git a/public/partials/footer.php b/public/partials/footer.php new file mode 100644 index 0000000..c4dd8d3 --- /dev/null +++ b/public/partials/footer.php @@ -0,0 +1,13 @@ + +
+
+

© usbcheck.it

+ +
+ + +
+
+
diff --git a/public/partials/header.php b/public/partials/header.php index d4bbded..c91ecd6 100644 --- a/public/partials/header.php +++ b/public/partials/header.php @@ -1,75 +1,62 @@ 'Deutsch', - 'en' => 'English', - 'it' => 'Italiano', - 'fr' => 'Français', -]; - -/** - * Baut eine URL und hängt immer ?lang= dran. - * $path sollte mit / beginnen, z.B. "/", "/fakecheck/", "/impressum". - */ -function usbcheck_url_with_lang(string $path, string $lang): string -{ - $path = $path ?: '/'; - $separator = str_contains($path, '?') ? '&' : '?'; - return $path . $separator . 'lang=' . urlencode($lang); -} ?> -