Deployment-Vorbereitung: Domain-Split und Legacy-/Debug-Seiten entfernt

- index.php zeigt bei abweichendem Host (APP_HOST-Env) die Landingpage
  statt des Dashboards, damit kaffeeliste.de und app.kaffeeliste.de aus
  demselben Webspace bedient werden koennen. Ohne gesetztes APP_HOST
  (lokale Entwicklung) unveraendertes Verhalten.
- landing.php verlinkt Login/Registrierung ueber APP_HOST fest auf die
  App-Domain, damit Besucher der Marketingdomain dort landen.
- functionsLDAP.php entfernt (nur ueber die tote IIS/AUTH_USER-Branch
  erreichbar, vollstaendig durch app/saas-auth.php ersetzt); zugehoerige
  tote AD/LDAP-Variablen aus config.php und der AUTH_USER-Zweig aus
  functions.php entfernt.
- mailausgebe.php, umfrage.php, umfrageergebnisse.php entfernt: aus der
  Navigation nicht erreichbare Debug-/Einzweck-Seiten ohne echte
  Berechtigungspruefung (mailausgebe.php dumpte alle Mitglieder-E-Mails,
  umfrageergebnisse.php hatte nur einen auskommentierten Basic-Auth-
  Block). scripts/http-smoke.php entsprechend bereinigt.
This commit is contained in:
2026-07-17 11:37:41 +02:00
parent d2330c81cd
commit cb799c7c66
10 changed files with 47 additions and 979 deletions
+28
View File
@@ -50,6 +50,34 @@ function app_send_security_headers(): void
}
}
/**
* The application's own primary hostname in production (e.g.
* app.kaffeeliste.de), configured via APP_HOST. Unset in dev, where
* index.php should keep behaving exactly as before (no host split).
*/
function app_primary_host(): ?string
{
return app_env('APP_HOST');
}
/**
* Builds a URL that always points at the app's own host, even when the
* current request came in on a different domain (e.g. the marketing
* domain linking to /login.php). Falls back to a relative path when
* APP_HOST isn't configured, so local dev is unaffected.
*/
function app_primary_url(string $path): string
{
$host = app_primary_host();
if ($host === null) {
return ltrim($path, '/');
}
$scheme = app_is_https() ? 'https' : 'http';
return $scheme . '://' . $host . '/' . ltrim($path, '/');
}
function app_start_session(): void
{
if (PHP_SAPI === 'cli' || session_status() === PHP_SESSION_ACTIVE) {