mirror of
https://github.com/SubleXBle/Fail2Ban-Report.git
synced 2026-04-26 01:09:01 -05:00
Create action_ban-ip.php
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// includes/actions/action_ban-ip.php
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
http_response_code(405); // Method Not Allowed
|
||||
echo "Fehler: Nur POST erlaubt.";
|
||||
exit;
|
||||
}
|
||||
|
||||
$ip = $_POST['ip'] ?? null;
|
||||
|
||||
if (!$ip || !filter_var($ip, FILTER_VALIDATE_IP)) {
|
||||
http_response_code(400); // Bad Request
|
||||
echo "Ungültige oder fehlende IP.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Dummy-Antwort
|
||||
echo "[BAN] IP $ip wurde erfolgreich verarbeitet.";
|
||||
Reference in New Issue
Block a user