<?php
// api/coraza-rules-host-list.php — returns host exceptions for one rule (JSON).
require_once('/docker/whp/web/libs/permission_checker.php');
require_once('/docker/whp/web/libs/coraza_rule_manager.php');
header('Content-Type: application/json');
if (!is_root_user()) { http_response_code(403); echo '[]'; return; }
$rid = (int)($_GET['rule_id'] ?? 0);
if ($rid < 1) { echo '[]'; return; }
$m = new coraza_rule_manager();
echo json_encode($m->list_host_exceptions($rid));
