Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Interfaces column to Floating Rules. Issue #4629 #4286

Merged
merged 1 commit into from Apr 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 54 additions & 1 deletion src/usr/local/www/firewall_rules.php
Expand Up @@ -358,6 +358,13 @@ function delete_nat_association($id) {
<th><input type="checkbox" id="selectAll" name="selectAll" /></th>
<th><!-- status icons --></th>
<th><?=gettext("States")?></th>
<?php
if ('FloatingRules' == $if) {
?>
<th><?=gettext("Interfaces")?></th>
<?php
}
?>
<th><?=gettext("Protocol")?></th>
<th><?=gettext("Source")?></th>
<th><?=gettext("Port")?></th>
Expand Down Expand Up @@ -645,7 +652,53 @@ function delete_nat_association($id) {
}
?>
<td><?php print_states(intval($filterent['tracker'])); ?></td>
<td>
<?php
if ($if == 'FloatingRules') {
?>
<td onclick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
<?php
if (isset($filterent['interface'])) {
$selected_interfaces = explode(',', $filterent['interface']);
unset($selected_descs);
foreach ($selected_interfaces as $interface) {
if (isset($ifdescs[$interface])) {
$selected_descs[] = $ifdescs[$interface];
} else {
switch ($interface) {
case 'l2tp':
if ($config['l2tp']['mode'] == 'server')
$selected_descs[] = 'L2TP VPN';
break;
case 'pptp':
if ($config['pptpd']['mode'] == 'server')
$selected_descs[] = 'PPTP VPN';
break;
case 'pppoe':
if (is_pppoe_server_enabled())
$selected_descs[] = 'PPPoE Server';
break;
case 'enc0':
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
$selected_descs[] = 'IPsec';
break;
case 'openvpn':
if ($config['openvpn']['openvpn-server'] || $config['openvpn']['openvpn-client'])
$selected_descs[] = 'OpenVPN';
break;
default:
$selected_descs[] = $interface;
break;
}
}
}
echo implode('<br/>', $selected_descs);
}
?>
</td>
<?php
}
?>
<td>
<?php
if (isset($filterent['ipprotocol'])) {
switch ($filterent['ipprotocol']) {
Expand Down