This commit is contained in:
@@ -11,10 +11,12 @@ if (!$userId) {
|
||||
|
||||
$communityCfg = require __DIR__ . '/../../../config/community.php';
|
||||
$access = $pdo ? new \App\CommunityAccess($pdo, $communityCfg) : null;
|
||||
$community = $pdo ? new \App\Community($pdo, $communityCfg) : null;
|
||||
$migration = $pdo ? new \App\CommunityMigration($pdo) : null;
|
||||
$listingCatalog = $pdo ? new \App\ListingCatalog($pdo) : null;
|
||||
$communityPoints = $community ? $community->computePoints((int)$userId) : 0.0;
|
||||
|
||||
if (!$access || !$access->canModerateForum((int)$userId)) {
|
||||
if (!$access || !$access->canAccessCommunityAdmin((int)$userId, $communityPoints)) {
|
||||
http_response_code(403);
|
||||
echo '<main class="section"><div class="container"><div class="card dash-card"><h1>Kein Zugriff</h1><p class="muted">Dieser Bereich ist nur für Community-Admins freigegeben.</p></div></div></main>';
|
||||
return;
|
||||
@@ -22,9 +24,10 @@ if (!$access || !$access->canModerateForum((int)$userId)) {
|
||||
|
||||
$error = '';
|
||||
$info = '';
|
||||
$canModerateForum = $access->canModerateForum((int)$userId);
|
||||
$canManageApplications = $access->canManageApplications((int)$userId) && $access->supportsApplications();
|
||||
$canManageRoles = $access->canManageRoles((int)$userId);
|
||||
$canReviewListings = $listingCatalog !== null && !$access->hasRole((int)$userId, 'owner');
|
||||
$canReviewListings = $listingCatalog !== null && $access->canReviewListings((int)$userId, $communityPoints);
|
||||
$roleUserSearchQuery = trim((string)($_GET['role_user_query'] ?? ''));
|
||||
$roleUserSearchResults = ($canManageRoles || $canManageApplications) && $roleUserSearchQuery !== ''
|
||||
? $access->searchUsers($roleUserSearchQuery, 12)
|
||||
@@ -194,34 +197,36 @@ $migrationStatus = ($migration && $canManageApplications) ? $migration->status()
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="forum-board">
|
||||
<div class="forum-board__head">
|
||||
<div>
|
||||
<h2>Offene Meldungen</h2>
|
||||
<p class="muted">Gemeldete Inhalte prüfen und abschließen.</p>
|
||||
<?php if ($canModerateForum): ?>
|
||||
<section class="forum-board">
|
||||
<div class="forum-board__head">
|
||||
<div>
|
||||
<h2>Offene Meldungen</h2>
|
||||
<p class="muted">Gemeldete Inhalte prüfen und abschließen.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="forum-admin-list">
|
||||
<?php foreach ($reports as $report): ?>
|
||||
<article class="forum-admin-item">
|
||||
<div>
|
||||
<strong><?= htmlspecialchars((string)$report['target_type'], ENT_QUOTES) ?> #<?= (int)$report['target_id'] ?></strong>
|
||||
<p><?= nl2br(htmlspecialchars((string)$report['reason'], ENT_QUOTES)) ?></p>
|
||||
<p class="muted small">Gemeldet von <?= htmlspecialchars((string)($report['reporter_name'] ?: 'Mitglied'), ENT_QUOTES) ?> am <?= htmlspecialchars((string)$report['created_at'], ENT_QUOTES) ?></p>
|
||||
</div>
|
||||
<form method="post" class="forum-admin-item__actions">
|
||||
<input type="hidden" name="action" value="report_resolve">
|
||||
<input type="hidden" name="report_id" value="<?= (int)$report['id'] ?>">
|
||||
<textarea name="moderator_note" class="textarea" rows="3" placeholder="Moderationsnotiz"></textarea>
|
||||
<button class="btn" type="submit">Als erledigt markieren</button>
|
||||
</form>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!$reports): ?>
|
||||
<div class="forum-empty">Keine offenen Meldungen.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<div class="forum-admin-list">
|
||||
<?php foreach ($reports as $report): ?>
|
||||
<article class="forum-admin-item">
|
||||
<div>
|
||||
<strong><?= htmlspecialchars((string)$report['target_type'], ENT_QUOTES) ?> #<?= (int)$report['target_id'] ?></strong>
|
||||
<p><?= nl2br(htmlspecialchars((string)$report['reason'], ENT_QUOTES)) ?></p>
|
||||
<p class="muted small">Gemeldet von <?= htmlspecialchars((string)($report['reporter_name'] ?: 'Mitglied'), ENT_QUOTES) ?> am <?= htmlspecialchars((string)$report['created_at'], ENT_QUOTES) ?></p>
|
||||
</div>
|
||||
<form method="post" class="forum-admin-item__actions">
|
||||
<input type="hidden" name="action" value="report_resolve">
|
||||
<input type="hidden" name="report_id" value="<?= (int)$report['id'] ?>">
|
||||
<textarea name="moderator_note" class="textarea" rows="3" placeholder="Moderationsnotiz"></textarea>
|
||||
<button class="btn" type="submit">Als erledigt markieren</button>
|
||||
</form>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!$reports): ?>
|
||||
<div class="forum-empty">Keine offenen Meldungen.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($canManageRoles || $canManageApplications): ?>
|
||||
<section class="forum-board">
|
||||
|
||||
Reference in New Issue
Block a user