2603.9 frequesnt IPs added
This commit is contained in:
28
settings.php
28
settings.php
@@ -34,10 +34,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
set_setting('retention_days', (string)$days);
|
||||
$success = 'Retention period saved.';
|
||||
}
|
||||
|
||||
} elseif ($action === 'frequent_ip_threshold') {
|
||||
$threshold = (int)($_POST['frequent_ip_threshold'] ?? 0);
|
||||
if ($threshold < 1) {
|
||||
$errors[] = 'Threshold must be at least 1.';
|
||||
} else {
|
||||
set_setting('frequent_ip_threshold', (string)$threshold);
|
||||
$success = 'Frequent IP threshold saved.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$retention_days = (int)get_setting('retention_days', '7');
|
||||
$retention_days = (int)get_setting('retention_days', '7');
|
||||
$frequent_ip_threshold = (int)get_setting('frequent_ip_threshold', '5');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -106,6 +116,22 @@ $retention_days = (int)get_setting('retention_days', '7');
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Frequent IP threshold</h2>
|
||||
<p class="muted" style="margin-bottom:1rem;font-size:.85rem">
|
||||
Minimum number of connections for an IP to appear in
|
||||
<code>api/frequent_ips.php</code>.
|
||||
</p>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="frequent_ip_threshold">
|
||||
<label>Minimum connections
|
||||
<input type="number" name="frequent_ip_threshold" min="1" max="99999"
|
||||
value="<?= $frequent_ip_threshold ?>" style="width:120px">
|
||||
</label>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user