adasd
This commit is contained in:
@@ -40,14 +40,42 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<div style="margin-top:1rem;" class="grid">
|
||||
<?php foreach ($modules as $module): ?>
|
||||
<?php if (empty($module['enabled'])) { continue; } ?>
|
||||
<?php
|
||||
$auth = is_array($module['auth'] ?? null) ? $module['auth'] : [];
|
||||
$authRequired = !empty($auth['required']);
|
||||
$authUsers = is_array($auth['users'] ?? null) ? array_filter($auth['users']) : [];
|
||||
$authGroups = is_array($auth['groups'] ?? null) ? array_filter($auth['groups']) : [];
|
||||
$hasSpecificAccess = $authRequired && ($authUsers !== [] || $authGroups !== []);
|
||||
$accessLabel = $hasSpecificAccess
|
||||
? 'Spezielle Zugriffsrechte'
|
||||
: ($authRequired ? 'Login erforderlich' : 'Kein Modulschutz');
|
||||
?>
|
||||
<div class="card" style="background:var(--panel-2);">
|
||||
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px;">
|
||||
<div>
|
||||
<strong><?= e($module['title']) ?></strong>
|
||||
<div class="muted" style="font-size:.85rem;"><?= e($module['description'] ?? '') ?></div>
|
||||
</div>
|
||||
<span class="pill" style="border-color:var(--accent-2); color:var(--accent-2);">aktiv</span>
|
||||
<div style="display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;">
|
||||
<span class="pill" style="border-color:var(--accent-2); color:var(--accent-2);">aktiv</span>
|
||||
<span class="pill" title="<?= e($accessLabel) ?>" style="<?= $hasSpecificAccess ? 'border-color:#f59e0b; color:#fbbf24;' : '' ?>">
|
||||
<?= e($accessLabel) ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($hasSpecificAccess): ?>
|
||||
<div class="muted" style="margin-top:.65rem; font-size:.85rem;">
|
||||
<?php if ($authGroups !== []): ?>
|
||||
Gruppen: <?= e(implode(', ', $authGroups)) ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($authGroups !== [] && $authUsers !== []): ?>
|
||||
·
|
||||
<?php endif; ?>
|
||||
<?php if ($authUsers !== []): ?>
|
||||
Benutzer: <?= e((string)count($authUsers)) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div style="margin-top:.75rem; display:flex; gap:10px; flex-wrap:wrap;">
|
||||
<a class="nav-link" href="/module/<?= e($module['name']) ?>">Öffnen</a>
|
||||
<a class="nav-link" href="/modules/setup/<?= e($module['name']) ?>">Setup</a>
|
||||
|
||||
Reference in New Issue
Block a user