Update block-ip.php

This commit is contained in:
SubleXBle
2025-08-17 15:17:40 +02:00
committed by GitHub
parent fa9938e67f
commit 4853e4eb29
+27
View File
@@ -10,9 +10,36 @@
* @return array Result array or array of results with 'success', 'message' and 'type'.
*/
// auth
/*
require_once __DIR__ . '/auth.php';
header('Content-Type: application/json');
if (!is_admin()) {
echo json_encode([
'success' => false,
'error' => 'Unauthorized: Only admin can perform this action.'
]);
exit;
}
*/
// end auth
require_once __DIR__ . "/paths.php";
function blockIp($ips, $jail = 'unknown', $source = 'manual') {
// Admin-Check
if (!is_admin()) {
return [
'success' => false,
'message' => 'Unauthorized: Only admin can block IPs.',
'type' => 'error'
];
}
$results = [];
if (!is_array($ips)) {