sadasd
All checks were successful
Deploy / deploy (push) Successful in 56s

This commit is contained in:
2026-08-19 20:04:01 +02:00
parent c2eaa5c186
commit c567d19deb
13 changed files with 177 additions and 38 deletions

View File

@@ -6,6 +6,7 @@ $profileInitial = 'P';
$showAdminLink = false;
$showSystemLink = false;
$showProfileLevelsLink = false;
$showCategoriesLink = false;
if ($isLoggedIn) {
try {
@@ -25,10 +26,13 @@ if ($isLoggedIn) {
$communityCfg = dirname(__DIR__, 2) . '/config/community.php';
if (file_exists($communityCfg)) {
$communityConfig = require $communityCfg;
$community = new \App\Community($pdo, $communityConfig);
$communityAccess = new \App\CommunityAccess($pdo, $communityConfig);
$showAdminLink = $communityAccess->canModerateForum((int)$_SESSION['user_id']);
$navCommunityPoints = $community->computePoints((int)$_SESSION['user_id']);
$showAdminLink = $communityAccess->canAccessCommunityAdmin((int)$_SESSION['user_id'], $navCommunityPoints);
$showSystemLink = $communityAccess->canManageApplications((int)$_SESSION['user_id']);
$showProfileLevelsLink = $communityAccess->canManageRoles((int)$_SESSION['user_id']);
$showCategoriesLink = $communityAccess->canManageCategories((int)$_SESSION['user_id'], $navCommunityPoints);
}
}
} catch (\Throwable) {
@@ -37,6 +41,7 @@ if ($isLoggedIn) {
$showAdminLink = false;
$showSystemLink = false;
$showProfileLevelsLink = false;
$showCategoriesLink = false;
}
}
?>
@@ -68,6 +73,9 @@ if ($isLoggedIn) {
<a href="/dashboard?section=places" role="menuitem">Orte &amp; Veranstaltungen</a>
<a href="/dashboard?section=community" role="menuitem">Community</a>
<a href="/dashboard?section=settings" role="menuitem">Einstellungen</a>
<?php if ($showCategoriesLink): ?>
<a href="/dashboard?section=categories" role="menuitem">Kategorien</a>
<?php endif; ?>
<?php if ($showProfileLevelsLink): ?>
<a href="/dashboard?section=profile-levels" role="menuitem">Profil-Levels</a>
<?php endif; ?>
@@ -98,6 +106,9 @@ if ($isLoggedIn) {
<a class="btn ghost" href="/dashboard?section=places">Orte &amp; Veranstaltungen</a>
<a class="btn ghost" href="/dashboard?section=community">Community</a>
<a class="btn ghost" href="/dashboard?section=settings">Einstellungen</a>
<?php if ($showCategoriesLink): ?>
<a class="btn ghost" href="/dashboard?section=categories">Kategorien</a>
<?php endif; ?>
<?php if ($showProfileLevelsLink): ?>
<a class="btn ghost" href="/dashboard?section=profile-levels">Profil-Levels</a>
<?php endif; ?>