LuminaWebsite/dashboard.php
Maaxxs 620ef68015 Add a Raids page fed by the guild's external raids API
New raids.php shows upcoming raids (date, requirements, gearscore,
groups and their signups) pulled from https://api.maaxxs-coding.de/api/raids
via includes/raids_api.php (cURL + X-API-Key header), gated behind a
new raids.view permission so it fits the existing permission-group
model. Fresh installs seed raids.view onto Mitglied automatically;
existing installs need to add it once via the Berechtigungsgruppen UI
(documented in the README). API/network failures show a friendly
error instead of crashing the page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 12:44:17 +02:00

58 lines
2 KiB
PHP

<?php
require_once __DIR__ . '/includes/bootstrap.php';
require_permission('dashboard.view');
$user = current_user();
$canViewUsers = user_has_permission('users.view');
$canManageRoles = user_has_permission('roles.manage');
$canViewRaids = user_has_permission('raids.view');
$pageTitle = 'Dashboard';
include __DIR__ . '/includes/header.php';
?>
<div class="panel">
<h1>Willkommen, <?= e($user['display_name'] !== '' ? $user['display_name'] : $user['username']) ?>!</h1>
<p class="text-muted">Dies ist dein Mitgliederbereich. Die eigentliche Gilden-Homepage folgt hier später.</p>
</div>
<?php if ($canViewRaids): ?>
<div class="panel">
<div class="card-grid">
<div class="panel stat-card">
<div class="icon-badge"><?= icon('calendar') ?></div>
<div>
<h3>Raids</h3>
<p class="text-muted"><a href="/raids.php">Anstehende Raid-Termine ansehen</a></p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($canViewUsers || $canManageRoles): ?>
<div class="panel">
<h2>Administration</h2>
<div class="card-grid">
<?php if ($canViewUsers): ?>
<div class="panel stat-card">
<div class="icon-badge"><?= icon('users') ?></div>
<div>
<h3>Benutzerverwaltung</h3>
<p class="text-muted"><a href="/admin/users.php">Mitglieder anlegen, bearbeiten, deaktivieren</a></p>
</div>
</div>
<?php endif; ?>
<?php if ($canManageRoles): ?>
<div class="panel stat-card">
<div class="icon-badge"><?= icon('shield') ?></div>
<div>
<h3>Berechtigungsgruppen</h3>
<p class="text-muted"><a href="/admin/roles.php">Rollen und Berechtigungen verwalten</a></p>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php include __DIR__ . '/includes/footer.php'; ?>