Files

54 lines
2.3 KiB
PHP

<?php
/*
* Reflector Dashboard — web front-end for SvxReflector
* Copyright (C) 2026 SA7AUX (Björn)
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version. See the LICENSE file for details.
*/
declare(strict_types=1);
require __DIR__ . '/lib.php';
start_session();
$uuid = $_SESSION['uid'] ?? null;
if (!is_string($uuid) || $uuid === '') { header('Location: /'); exit; }
$me = acct_get($uuid);
$lvl = acct_admin_level($uuid);
if ($lvl < 2) { header('Location: /'); exit; }
$page_title = 'Admin · Global Bans — Reflector Dashboard';
require __DIR__ . '/header.php';
?>
<div class="container py-4" style="max-width:800px;">
<div id="page-admin-bans">
<div class="panel">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Global Bans <span id="banReadonlyBadge" class="badge bg-secondary ms-2 small" style="display:none;">read-only</span></h5>
<button class="btn btn-outline-secondary btn-sm" id="btnBansRefresh">Refresh</button>
</div>
<p class="small text-secondary mb-3">A global ban blocks the callsign on the portal — a banned callsign cannot register or sign in.</p>
<div class="row g-3">
<!-- Callsigns -->
<div class="col-12 col-md-6">
<h6>Callsigns</h6>
<div style="max-height:300px; overflow-y:auto; border:1px solid var(--line); padding:6px; border-radius:4px;">
<ul class="list-unstyled mb-0 small mono" id="banCsList"></ul>
</div>
<div class="d-flex gap-2 mt-2 ban-add-row">
<input type="text" class="form-control form-control-sm mono" id="banCsAdd" placeholder="CALLSIGN" maxlength="10" style="text-transform:uppercase;">
<button class="btn btn-outline-danger btn-sm" data-ban-add="callsign">Ban</button>
</div>
</div>
</div>
<div id="banMsg" class="small mt-3" style="display:none;"></div>
</div>
</div>
</div>
<?php
$extra_scripts = '<script>var ADMIN_LEVEL = ' . $lvl . ';</script><script src="/auth/admin_bans.js?v=' . @filemtime(__DIR__ . '/admin_bans.js') . '"></script>';
require __DIR__ . '/footer.php';
?>