Admin-ToDo/Review-Seite + Staging-Self-Service-Admin-Login

- admin-todo.html: mobile-freundliche ToDo/Review-Liste (Prioritaeten, Haekchen +
  Notizfelder je Punkt, localStorage, Notizen-Export), admin-gated, noindex. In
  admin-licenses.html Nav + Backend-Werkzeuge verlinkt.
- admin.php: devPin auch bei STAGING=1 (v3, Mail bewusst tot) -> Self-Service-
  Admin-Login ohne Mailversand. Prod unveraendert (STAGING dort nie definiert,
  2FA-Mail-Pflicht bleibt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 11:31:02 +02:00
parent a568f81b0a
commit c950f954d1
3 changed files with 186 additions and 4 deletions
+6 -4
View File
@@ -46,11 +46,13 @@ if ($action === 'login') {
unset($_SESSION['admin_id']); // Sicherstellen dass nicht schon eingeloggt
$resp = ['message' => 'PIN wurde an Ihre E-Mail gesendet.', 'email' => maskEmail($admin['email_2fa'])];
// Dev-Umgebung (localhost): es geht keine Mail raus → PIN direkt zurückgeben,
// damit man sich lokal anmelden kann. Auf Prod (IS_PRODUCTION) NIEMALS.
if (!IS_PRODUCTION) {
// Dev-Umgebung (localhost) ODER Staging (v3, STAGING=1 in .env.production, Mail
// bewusst tot): PIN direkt zurückgeben, damit man sich ohne Mailversand anmelden
// kann. Auf Prod (IS_PRODUCTION ohne STAGING) NIEMALS — dort greift 2FA per Mail.
$isStaging = defined('STAGING') && (STAGING === '1' || STAGING === 1 || STAGING === true);
if (!IS_PRODUCTION || $isStaging) {
$resp['devPin'] = $pin;
$resp['message'] = 'Dev-Umgebung kein Mailversand. PIN steht unten.';
$resp['message'] = ($isStaging ? 'Staging' : 'Dev-Umgebung') . ' kein Mailversand. PIN steht unten.';
}
Response::ok($resp);
}