Asked for: alliances ("Consilium Elyseum") with their own view, a member-list tab with the allied legions and their
members, an own raid area, a calendar that shows them only alliance entries, and live map sessions the legion can
share with them - watching only, or drawing only with an extra permission. There is one Discord role "Consilium
Elyseum" for all allies, so which legion each ally belongs to is stored on the website.
- Permissions consilium.view / consilium.draw / consilium.manage. An account with consilium.view but without
dashboard.view is a guest of the Consilium (consilium_only(), sql_is_consilium_only()) and sees only the alliance
area; raids, calendar and map stay restricted even with extra rights like raids.view or map.view.
- includes/consilium.php; consilium.php is the allies' start page instead of the dashboard (next raids and entries,
legions, running shared map sessions); admin/consilium.php: setup hints, allied legions, member assignment.
users.consilium_legion_id, table consilium_legions (schema 69); allies pick their legion under Mein Profil.
- Members: new tab "Consilium Elyseum" (legions with their members), the only tab allies see. Legion-only lists
(dues, Lumipunkte, member pickers, raid and activity points) leave allies out.
- Raids: two areas, legion and Consilium, told apart by the Discord channel ("Consilium-Raids" under Verwaltung ->
Discord-Bot, settings.consilium_raid_channel; the bot API returns channel_id). Allies only see and sign up for
Consilium raids, which give no Lumipunkte; raids created in the Consilium area are posted to its channel.
- Calendar: audience "Consilium Elyseum". Allies see only those entries and the Consilium raids (also in their iCal
subscription), their own entries are always Consilium entries; the public calendar shows no Consilium raids; the
legion sees them marked with 🤝.
- Map: whoever may edit a public tactic shares its running live session with the Consilium (consilium_share, logged).
The share lives in the bot's live relay and only for that session: it ends with "Freigabe beenden" or 60 s after
the last legion member left; making the tactic private or deleting it ends it as well. Allies see only running
shared sessions under Karte (and on their start page), join and watch; with consilium.draw they add strokes,
areas, points and text - no figures, nothing moved, erased or undone, no tactics, steps, copies or history.
Enforced in tactics_api.php (guest branch: shared tactics only, only live_token and shape_create) and in the relay
(guest tickets, event whitelist, guests are disconnected when the share ends). Needs the bot update (api.py,
database/db.py, live_tactics.py).
- Navigation, privacy page, patch note, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
182 lines
8.2 KiB
PHP
182 lines
8.2 KiB
PHP
<?php
|
||
declare(strict_types=1);
|
||
|
||
/**
|
||
* Impressum und Datenschutz (impressum.php, datenschutz.php).
|
||
*
|
||
* Name, Anschrift und E-Mail des Betreibers sowie den Hoster traegt die Leitung unter
|
||
* admin/legal.php ein (Tabelle settings, Recht site.legal). Die Links dazu stehen unten auf den
|
||
* oeffentlichen Seiten, in der Seitenleiste und auf der Wartungsseite.
|
||
*
|
||
* Inhalte von fremden Servern (Videos von YouTube/Twitch/Vimeo, Bilder und Videodateien anderer
|
||
* Seiten im Wiki) laden erst nach einem Klick: embed_consent_html() setzt einen Platzhalter,
|
||
* assets/js/embed-consent.js laedt den Inhalt. Vorher geht keine Anfrage an den Anbieter.
|
||
*/
|
||
|
||
// Stand der Datenschutzerklaerung - bei inhaltlichen Aenderungen an datenschutz.php mitziehen.
|
||
const LEGAL_PRIVACY_UPDATED = '2026-09-28';
|
||
|
||
// Betreiber: ladungsfaehige Anschrift ueber den Impressum-Service Online-Impressum.de (Clear-Media UG,
|
||
// nimmt Post an und leitet sie weiter; online-impressum.de/lumina-ascendes - die Seite dort heisst
|
||
// ohne das zweite "n"), E-Mail ueber die eigene Domain (Postfach bei Living-Bots). Unter
|
||
// admin/legal.php ueberschreibbar - leere Felder dort bedeuten "diese Angaben".
|
||
const LEGAL_OPERATOR_DEFAULT = [
|
||
'name' => 'Max Olchov',
|
||
'address' => "c/o Online-Impressum 11235\nEuroparing 90\n53757 Sankt Augustin",
|
||
'email' => 'info@lumina-ascendens.de',
|
||
];
|
||
|
||
// Hoster der Website (Webspace plesk2.living-bots.net) laut Impressum von Living-Bots -
|
||
// unter admin/legal.php ueberschreibbar.
|
||
const LEGAL_HOSTER_DEFAULT = "Living-Bots.net, Oliver Horscht\nSYNLINQ c/o Living-Bots.net\nHanauer Landstraße 328–330\n60314 Frankfurt am Main";
|
||
|
||
const LEGAL_NAME_MAX = 120;
|
||
const LEGAL_ADDRESS_MAX = 400;
|
||
const LEGAL_EMAIL_MAX = 190;
|
||
const LEGAL_HOSTER_MAX = 400;
|
||
|
||
// Anbieter eingebetteter Videos: Schluessel => Name, Unternehmen, Datenschutzerklaerung.
|
||
// Bilder und Videodateien anderer Server laufen als "host:<Servername>".
|
||
const EMBED_PROVIDERS = [
|
||
'youtube' => ['label' => 'YouTube', 'company' => 'Google', 'privacy' => 'https://policies.google.com/privacy'],
|
||
'twitch' => ['label' => 'Twitch', 'company' => 'Twitch Interactive', 'privacy' => 'https://www.twitch.tv/p/legal/privacy-notice/'],
|
||
'vimeo' => ['label' => 'Vimeo', 'company' => 'Vimeo', 'privacy' => 'https://vimeo.com/privacy'],
|
||
];
|
||
|
||
/**
|
||
* Angaben des Betreibers: was unter admin/legal.php eingetragen ist, sonst LEGAL_OPERATOR_DEFAULT.
|
||
*
|
||
* @return array{name: string, address: string, email: string}
|
||
*/
|
||
function legal_operator(): array
|
||
{
|
||
$operator = [];
|
||
foreach (LEGAL_OPERATOR_DEFAULT as $field => $default) {
|
||
$value = trim(setting_get('legal_' . $field));
|
||
$operator[$field] = $value !== '' ? $value : $default;
|
||
}
|
||
return $operator;
|
||
}
|
||
|
||
/** Hoster fuer die Datenschutzerklaerung (mehrzeilig). */
|
||
function legal_hoster(): string
|
||
{
|
||
$hoster = trim(setting_get('legal_hoster'));
|
||
return $hoster !== '' ? $hoster : LEGAL_HOSTER_DEFAULT;
|
||
}
|
||
|
||
/** Name und Anschrift sind Pflicht (§ 18 Abs. 1 MStV). */
|
||
function legal_complete(): bool
|
||
{
|
||
$operator = legal_operator();
|
||
return $operator['name'] !== '' && $operator['address'] !== '';
|
||
}
|
||
|
||
/** Mehrzeiliger Text als HTML mit Zeilenumbruechen. */
|
||
function legal_lines_html(string $text): string
|
||
{
|
||
return nl2br(e(trim($text)), false);
|
||
}
|
||
|
||
/**
|
||
* mailto-Link mit maskierten Zeichen - gegen Adress-Sammler, die nur Klartext im Quelltext suchen.
|
||
* Im Browser sieht die Adresse ganz normal aus.
|
||
*/
|
||
function legal_email_html(string $email): string
|
||
{
|
||
$masked = '';
|
||
foreach (mb_str_split($email) as $char) {
|
||
$masked .= '&#' . mb_ord($char) . ';';
|
||
}
|
||
return '<a href="mailto:' . $masked . '">' . $masked . '</a>';
|
||
}
|
||
|
||
/** Links zu Impressum und Datenschutzerklaerung (Footer, Seitenleiste, Wartungsseite). */
|
||
function legal_links_html(string $class = 'legal-links'): string
|
||
{
|
||
return '<nav class="' . e($class) . '" aria-label="Rechtliches">'
|
||
. '<a href="/impressum.php">Impressum</a><span aria-hidden="true">·</span><a href="/datenschutz.php">Datenschutz</a>'
|
||
. '</nav>';
|
||
}
|
||
|
||
/** Gehoert die Adresse zu dieser Website? Relative Adressen (/assets/...) immer. */
|
||
function legal_is_own_url(string $url): bool
|
||
{
|
||
$host = strtolower((string) parse_url($url, PHP_URL_HOST));
|
||
if ($host === '') {
|
||
return true;
|
||
}
|
||
$own = strtolower((string) preg_replace('/:\d+$/', '', (string) ($_SERVER['HTTP_HOST'] ?? '')));
|
||
$strip = static fn (string $h): string => (string) preg_replace('/^www\./', '', $h);
|
||
return $own !== '' && $strip($host) === $strip($own);
|
||
}
|
||
|
||
/** Schluessel fuer Inhalte eines fremden Servers ("host:cdn.example.com"). */
|
||
function embed_host_provider(string $url): string
|
||
{
|
||
$host = strtolower((string) parse_url($url, PHP_URL_HOST));
|
||
return 'host:' . preg_replace('/^www\./', '', $host);
|
||
}
|
||
|
||
/** Anzeigename eines Anbieters: "YouTube" bzw. der Servername. */
|
||
function embed_provider_label(string $provider): string
|
||
{
|
||
if (isset(EMBED_PROVIDERS[$provider])) {
|
||
return EMBED_PROVIDERS[$provider]['label'];
|
||
}
|
||
return str_starts_with($provider, 'host:') ? substr($provider, 5) : $provider;
|
||
}
|
||
|
||
/**
|
||
* Platzhalter fuer einen Inhalt von einem fremden Server. Erst ein Klick auf "laden" setzt den
|
||
* eigentlichen Inhalt ein (assets/js/embed-consent.js).
|
||
*
|
||
* @param string $kind video (Player im iframe), videofile (<video>) oder image (<img>)
|
||
* @param string $provider Schluessel aus EMBED_PROVIDERS oder "host:<Servername>"
|
||
* @param string $src Adresse des Inhalts (unmaskiert)
|
||
* @param array{class?: string, title?: string, alt?: string, autoplay_src?: string} $opts
|
||
*/
|
||
function embed_consent_html(string $kind, string $provider, string $src, array $opts = []): string
|
||
{
|
||
$isImage = $kind === 'image';
|
||
$label = embed_provider_label($provider);
|
||
$known = EMBED_PROVIDERS[$provider] ?? null;
|
||
|
||
$attrs = ' data-embed="' . e($kind) . '" data-embed-provider="' . e($provider) . '" data-embed-src="' . e($src) . '"';
|
||
if (!empty($opts['autoplay_src'])) {
|
||
$attrs .= ' data-embed-autoplay-src="' . e($opts['autoplay_src']) . '"';
|
||
}
|
||
if (isset($opts['title'])) {
|
||
$attrs .= ' data-embed-title="' . e($opts['title']) . '"';
|
||
}
|
||
if (isset($opts['alt'])) {
|
||
$attrs .= ' data-embed-alt="' . e($opts['alt']) . '"';
|
||
}
|
||
$class = trim(($opts['class'] ?? '') . ' embed-consent' . ($isImage ? ' embed-consent-image' : ''));
|
||
|
||
if ($isImage) {
|
||
$alt = trim((string) ($opts['alt'] ?? ''));
|
||
$title = 'Bild' . ($alt !== '' ? ' „' . e($alt) . '“' : '') . ' von ' . e($label);
|
||
$text = 'Liegt auf einem fremden Server. Erst wenn du es lädst, verbindet sich dein Browser damit - dabei wird z. B. deine IP-Adresse übertragen.';
|
||
} else {
|
||
$title = 'Video von ' . e($label);
|
||
$text = $known !== null
|
||
? 'Erst wenn du es lädst, verbindet sich dein Browser mit ' . e($label) . ($known['company'] !== $known['label'] ? ' (' . e($known['company']) . ')' : '')
|
||
. ' - dabei werden z. B. deine IP-Adresse und Angaben zu deinem Gerät übertragen.'
|
||
: 'Liegt auf einem fremden Server. Erst wenn du es lädst, verbindet sich dein Browser damit - dabei wird z. B. deine IP-Adresse übertragen.';
|
||
}
|
||
$remember = $known !== null ? 'Videos von ' . e($label) . ' immer direkt laden' : 'Inhalte von ' . e($label) . ' immer direkt laden';
|
||
|
||
// Bilder stehen mitten im Text (<p>) - dort sind nur Inline-Elemente erlaubt. Sie koennen auch in
|
||
// einem Link stehen ([](...)); ein zweiter Link darin wuerde den Platzhalter zerreissen.
|
||
$tag = $isImage ? 'span' : 'div';
|
||
$more = $isImage ? '' : ' <a href="/datenschutz.php#eingebettete-inhalte">Mehr dazu</a>';
|
||
return '<' . $tag . ' class="' . e($class) . '"' . $attrs . '>'
|
||
. '<span class="embed-consent-inner">'
|
||
. '<span class="embed-consent-title">' . $title . '</span>'
|
||
. '<span class="embed-consent-text">' . $text . $more . '</span>'
|
||
. '<button type="button" class="button button-small" data-embed-load>' . ($isImage ? 'Bild laden' : 'Video laden') . '</button>'
|
||
. '<label class="embed-consent-remember"><input type="checkbox" data-embed-remember> ' . $remember . '</label>'
|
||
. '</span>'
|
||
. '</' . $tag . '>';
|
||
}
|