103 lines
5.6 KiB
PHP
103 lines
5.6 KiB
PHP
<div class="container-fluid py-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h4 class="mb-0">Rate Limit Blocks</h4>
|
|
<small class="text-muted">URL-only admin utility</small>
|
|
</div>
|
|
|
|
<?php if (session()->getFlashdata('success')): ?>
|
|
<div class="alert alert-success"><?= esc(session()->getFlashdata('success')) ?></div>
|
|
<?php endif; ?>
|
|
<?php if (session()->getFlashdata('error')): ?>
|
|
<div class="alert alert-danger"><?= esc(session()->getFlashdata('error')) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<ul class="nav nav-tabs mb-3">
|
|
<li class="nav-item">
|
|
<a class="nav-link <?= $activeTab === 'ip' ? 'active' : '' ?>" href="<?= base_url('security/rate-limits?tab=ip') ?>">
|
|
Blocked IP List (<?= count($blockedIps) ?>)
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link <?= $activeTab === 'user' ? 'active' : '' ?>" href="<?= base_url('security/rate-limits?tab=user') ?>">
|
|
Blocked User List (<?= count($blockedUsers) ?>)
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<?php if ($activeTab === 'ip'): ?>
|
|
<div class="card">
|
|
<div class="card-body table-responsive">
|
|
<table class="table table-striped table-bordered align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>IP</th>
|
|
<th>Block Level</th>
|
|
<th>Cache Identifier (Fingerprint)</th>
|
|
<th>Blocked At</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (empty($blockedIps)): ?>
|
|
<tr><td colspan="5" class="text-center text-muted">No active blocked IP records.</td></tr>
|
|
<?php else: ?>
|
|
<?php foreach ($blockedIps as $row): ?>
|
|
<tr>
|
|
<td><?= esc($row['display_identifier'] ?? '-') ?></td>
|
|
<td><span class="badge bg-danger"><?= esc(strtoupper((string) ($row['block_level'] ?? '-'))) ?></span></td>
|
|
<td><small><?= esc($row['cache_identifier'] ?? '-') ?></small></td>
|
|
<td><?= esc((string) ($row['blocked_at'] ?? '-')) ?></td>
|
|
<td>
|
|
<form method="post" action="<?= base_url('security/rate-limits/unblock-ip') ?>" class="d-flex gap-2">
|
|
<input type="hidden" name="cache_identifier" value="<?= esc($row['cache_identifier'] ?? '') ?>">
|
|
<input type="text" name="reason" class="form-control form-control-sm" placeholder="Reason (optional)">
|
|
<button type="submit" class="btn btn-sm btn-success" onclick="return confirm('Unblock this IP entry?')">Unblock</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="card">
|
|
<div class="card-body table-responsive">
|
|
<table class="table table-striped table-bordered align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>User Identity</th>
|
|
<th>Block Level</th>
|
|
<th>Identity Hash Key</th>
|
|
<th>Blocked At</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (empty($blockedUsers)): ?>
|
|
<tr><td colspan="5" class="text-center text-muted">No active blocked user records.</td></tr>
|
|
<?php else: ?>
|
|
<?php foreach ($blockedUsers as $row): ?>
|
|
<tr>
|
|
<td><?= esc($row['display_identifier'] ?? '-') ?></td>
|
|
<td><span class="badge bg-danger"><?= esc(strtoupper((string) ($row['block_level'] ?? '-'))) ?></span></td>
|
|
<td><small><?= esc($row['cache_identifier'] ?? '-') ?></small></td>
|
|
<td><?= esc((string) ($row['blocked_at'] ?? '-')) ?></td>
|
|
<td>
|
|
<form method="post" action="<?= base_url('security/rate-limits/unblock-user') ?>" class="d-flex gap-2">
|
|
<input type="hidden" name="display_identifier" value="<?= esc($row['display_identifier'] ?? '') ?>">
|
|
<input type="text" name="reason" class="form-control form-control-sm" placeholder="Reason (optional)">
|
|
<button type="submit" class="btn btn-sm btn-success" onclick="return confirm('Unblock this user entry?')">Unblock</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|