Server fuer Konten, Akten und Squads

PHP 8 ohne Framework unter server/: oeffentliche Einstiege fuer
sva.tyrveil.com (Schnittstelle, Konto-Links, Verwaltung, Einrichtung) und
die Logik in sva-privat neben dem Dokumentenstamm.

- Konten mit E-Mail-Bestaetigung, Anmeldung per Token, Passwort
  vergessen, Konto loeschen
- Akten auf dem Server mit serververgebener Aktennummer und
  Versionspruefung; Portraets werden neu als PNG gespeichert
- Squads mit Einladungen, Fuehrung uebergeben, Aufloesen
- Verwaltung fuer info@tyrveil.com: Nutzer, Charaktere, Squads
- Bremsen gegen Durchprobieren, Token nur als Hash, CSRF-Schutz

werkzeuge/server_test.py prueft alles lokal mit SQLite (91 Faelle).
Der Release-Bau legt dist/server und dist/sva-privat an, ohne config.php.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-09-13 17:50:33 +02:00
parent 58a3573fd6
commit 6e4d4afc1d
23 changed files with 2872 additions and 1 deletions

View file

@ -0,0 +1,110 @@
<?php
/*
* Gemeinsames Aussehen der Webseiten (Konto-Links, Verwaltung, Einrichtung)
* im Stil der Downloadseite, dazu die Sicherheitskoepfe.
*/
declare(strict_types=1);
final class Web
{
public static function e(mixed $text): string
{
return htmlspecialchars((string) $text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}
public static function sicherheitskoepfe(): void
{
header('Content-Type: text/html; charset=utf-8');
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: DENY');
// Links aus Mails tragen ein Token in der Adresse - nie an Dritte weiterreichen
header('Referrer-Policy: no-referrer');
header('Cache-Control: no-store');
header("Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src 'self';"
. " form-action 'self'; frame-ancestors 'none'; base-uri 'none'");
}
public static function hinweis(string $text, string $art = 'info'): string
{
return '<p class="hinweis ' . self::e($art) . '">' . $text . '</p>';
}
public static function seite(string $titel, string $inhalt, string $breite = '560px', string $navigation = ''): never
{
self::sicherheitskoepfe();
$titelE = self::e($titel);
$rechtliches = self::e(sm_config('rechtliches_url', 'https://tyrveil.com/rechtliches#impressum'));
echo <<<HTML
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<title>$titelE – Squad Manager</title>
<link rel="icon" href="/icon.png">
<style>
:root { --bg:#151814; --panel:#1e231b; --panel-hi:#2a3125; --line:#3d4634; --fg:#c9cec0;
--dim:#7f8874; --olive:#6e8b3d; --olive-hi:#8cb04d; --amber:#d9a441; --rot:#b4472f;
--mono: Consolas, "Cascadia Mono", monospace; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.55 "Segoe UI", system-ui, sans-serif; }
main { max-width:$breite; margin:0 auto; padding:40px 20px; }
.kopf { display:flex; align-items:center; gap:14px; margin-bottom:28px; }
.kopf img { width:44px; height:44px; }
.kopf b { font-size:20px; letter-spacing:.04em; display:block; }
.kopf span { color:var(--dim); font-size:13px; }
h1 { font:700 14px var(--mono); letter-spacing:.08em; color:var(--olive-hi); text-transform:uppercase;
border-bottom:1px solid var(--line); padding-bottom:6px; margin:0 0 18px; }
h2 { font:700 13px var(--mono); letter-spacing:.06em; color:var(--olive-hi); margin:26px 0 10px; }
.karte { background:var(--panel); border:1px solid var(--line); padding:22px 24px; margin-bottom:18px; }
a { color:var(--olive-hi); }
label { display:block; margin:12px 0 4px; color:var(--dim); font-size:13px; }
input[type=text], input[type=email], input[type=password], input[type=search] {
width:100%; padding:9px 10px; background:var(--bg); color:var(--fg); border:1px solid var(--line);
font:inherit; }
input:focus { outline:1px solid var(--olive); }
button, .knopf { display:inline-block; margin-top:14px; padding:9px 18px; background:var(--olive);
color:#10130d; border:1px solid var(--olive-hi); font:600 14px "Segoe UI", sans-serif; cursor:pointer;
text-decoration:none; }
button.leise { background:transparent; color:var(--fg); border-color:var(--line); margin-top:0; padding:4px 10px; font-weight:400; }
button.gefahr { background:var(--rot); border-color:#d0664c; color:#fff; }
button.leise.gefahr { background:transparent; color:#e08a74; border-color:#6b3528; }
.hinweis { padding:10px 14px; border-left:3px solid var(--olive); background:var(--panel-hi); }
.hinweis.fehler { border-color:var(--rot); color:#f0b3a3; }
.hinweis.warnung { border-color:var(--amber); color:var(--amber); }
table { width:100%; border-collapse:collapse; font-size:14px; }
th { text-align:left; font:700 12px var(--mono); color:var(--dim); letter-spacing:.05em; padding:6px 8px;
border-bottom:1px solid var(--line); white-space:nowrap; }
td { padding:7px 8px; border-bottom:1px solid var(--panel-hi); vertical-align:top; }
td form { display:inline; }
.tabelle { overflow-x:auto; }
.dim { color:var(--dim); }
.mono { font-family:var(--mono); }
nav { display:flex; flex-wrap:wrap; gap:4px 18px; margin:-10px 0 24px; font:13px var(--mono); }
nav a { text-decoration:none; color:var(--fg); }
nav a.aktiv { color:var(--olive-hi); }
.zahlen { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:12px; }
.zahlen div { background:var(--panel); border:1px solid var(--line); padding:12px 14px; }
.zahlen b { display:block; font:700 26px var(--mono); color:var(--olive-hi); }
pre { white-space:pre-wrap; word-break:break-word; background:var(--bg); border:1px solid var(--line);
padding:12px; font:12px var(--mono); max-height:420px; overflow:auto; }
.suche { display:flex; gap:8px; margin-bottom:14px; }
.suche button { margin-top:0; }
footer { max-width:$breite; margin:0 auto; padding:0 20px 40px; font:12px var(--mono); color:var(--dim); }
footer a { color:var(--dim); }
</style>
</head>
<body>
<main>
<div class="kopf"><img src="/icon.png" alt=""><div><b>SQUAD MANAGER</b><span>$titelE</span></div></div>
$navigation
$inhalt
</main>
<footer><a href="$rechtliches">Impressum und Datenschutz</a></footer>
</body>
</html>
HTML;
exit;
}
}