Wasserzeichen fuer den kostenlosen Tarif
Mandanten im Tarif "free" (bis 10 Teilnehmer) zeigen unten rechts eine kleine Marke mit Logo und Adresse der Kaffeeliste; zahlende Mandanten behalten ihre Oberflaeche ohne fremdes Logo. Die Sichtbarkeit haengt allein an tenant_billing.plan_code und wird als reine Leseabfrage geprueft - billing_fetch_or_init() waere ein Schreibzugriff im Seitenaufbau. Laesst sich der Tarif nicht lesen, bleibt die Marke aus. Das Logo ist ein Inline-SVG, das Linkziel kommt aus APP_MARKETING_URL bzw. aus APP_HOST ohne App-Subdomain. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,33 @@ function app_primary_url(string $path): string
|
||||
return $scheme . '://' . $host . '/' . ltrim($path, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Adresse der Marketing-Domain (z. B. https://kaffeeliste.de) - Ziel des
|
||||
* Wasserzeichens im kostenlosen Tarif. Explizit ueber APP_MARKETING_URL
|
||||
* setzbar; sonst wird sie aus APP_HOST abgeleitet, indem die
|
||||
* App-Subdomain wegfaellt (app.kaffeeliste.de -> kaffeeliste.de). In der
|
||||
* lokalen Entwicklung ohne APP_HOST bleibt der aktuelle Host uebrig, im
|
||||
* CLI-Betrieb ein leerer String.
|
||||
*/
|
||||
function app_marketing_url(): string
|
||||
{
|
||||
$configured = app_env('APP_MARKETING_URL');
|
||||
if ($configured !== null) {
|
||||
return rtrim($configured, '/');
|
||||
}
|
||||
|
||||
$scheme = app_is_https() ? 'https' : 'http';
|
||||
$host = app_primary_host();
|
||||
|
||||
if ($host !== null) {
|
||||
return $scheme . '://' . preg_replace('/^app\./i', '', $host);
|
||||
}
|
||||
|
||||
$requestHost = (string)($_SERVER['HTTP_HOST'] ?? '');
|
||||
|
||||
return $requestHost !== '' ? $scheme . '://' . $requestHost : '';
|
||||
}
|
||||
|
||||
function app_start_session(): void
|
||||
{
|
||||
if (PHP_SAPI === 'cli' || session_status() === PHP_SESSION_ACTIVE) {
|
||||
|
||||
Reference in New Issue
Block a user