Services: Captive Portal - fix display issue for pass rule when client not in zone

inverse rules unfortunately contain some mappings, which means we need to map them differently for legacy and mvc code.
This commit is contained in:
Ad Schellevis 2025-04-14 17:09:39 +02:00
parent 5ad41a236c
commit d0f745a70e
2 changed files with 10 additions and 2 deletions

View File

@ -352,7 +352,7 @@ class FilterRule extends Rule
}
public function isUIFromNot()
{
return isset($this->rule['source']) && isset($this->rule['source']['not']);
return (isset($this->rule['source']) && isset($this->rule['source']['not'])) || !empty($this->rule['from_not']);
}
public function getUIFromPort()
{
@ -378,7 +378,7 @@ class FilterRule extends Rule
}
public function isUIToNot()
{
return isset($this->rule['destination']) && isset($this->rule['destination']['not']);
return isset($this->rule['destination']) && isset($this->rule['destination']['not']) || !empty($this->rule['to_not']);
}
public function getUIToPort()
{

View File

@ -76,6 +76,14 @@ foreach ($fw->iterateFilterRules() as $prio => $item) {
}
$rule['action'] = $rule['action'] ?? 'pass';
$rule['ipprotocol'] = $rule['ipprotocol'] ?? 'inet';
if (!empty($rule['from_not'])) {
unset($rule['from_not']);
$rule['source_not'] = true;
}
if (!empty($rule['to_not'])) {
unset($rule['destination_not']);
$rule['destination_not'] = true;
}
/**
* Evaluation order consists of a priority group and a sequence within the set,