diff options
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/firewall_nat.php | 49 | ||||
-rw-r--r-- | src/usr/local/www/guiconfig.inc | 8 |
2 files changed, 46 insertions, 11 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index e7f370e..6158c02 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -264,11 +264,22 @@ foreach ($a_nat as $natent): display_separator($separators, $nnats, $columns_in_table); } + $localport = $natent['local-port']; + + list($dstbeginport, $dstendport) = explode("-", $natent['destination']['port']); + + if ($dstendport) { + $localendport = $natent['local-port'] + $dstendport - $dstbeginport; + $localport .= '-' . $localendport; + } + $alias = rule_columns_with_alias( $natent['source']['address'], pprint_port($natent['source']['port']), $natent['destination']['address'], - pprint_port($natent['destination']['port']) + pprint_port($natent['destination']['port']), + $natent['target'], + $localport ); /* if user does not have access to edit an interface skip on to the next record */ @@ -397,22 +408,40 @@ foreach ($a_nat as $natent): endif; ?> </td> + <td> +<?php + if (isset($alias['target'])): +?> + <a href="/firewall_aliases_edit.php?id=<?=$alias['target']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['target'])?>" data-html="true"> +<?php + endif; +?> - <td > <?=str_replace('_', ' ', htmlspecialchars($natent['target']))?> +<?php + if (isset($alias['target'])): +?> + </a> +<?php + endif; +?> </td> <td> <?php - $localport = $natent['local-port']; - - list($dstbeginport, $dstendport) = explode("-", $natent['destination']['port']); - - if ($dstendport) { - $localendport = $natent['local-port'] + $dstendport - $dstbeginport; - $localport .= '-' . $localendport; - } + if (isset($alias['targetport'])): +?> + <a href="/firewall_aliases_edit.php?id=<?=$alias['targetport']?>" data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Alias details')?>" data-content="<?=alias_info_popup($alias['targetport'])?>" data-html="true"> +<?php + endif; ?> <?=str_replace('_', ' ', htmlspecialchars(pprint_port($localport)))?> +<?php + if (isset($alias['targetport'])): +?> + </a> +<?php + endif; +?> </td> <td> diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 7e1645a..6fe86c0 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -1129,7 +1129,7 @@ function alias_info_popup($alias_id) { return $content; } -function rule_columns_with_alias($src, $srcport, $dst, $dstport) { +function rule_columns_with_alias($src, $srcport, $dst, $dstport, $target, $targetport) { global $config; if ($config['aliases']['alias'] == "" || !is_array($config['aliases']['alias'])) { @@ -1150,6 +1150,12 @@ function rule_columns_with_alias($src, $srcport, $dst, $dstport) { if ($alias_name['name'] == $dstport) { $columns['dstport'] = $alias_id; } + if ($alias_name['name'] == $target) { + $columns['target'] = $alias_id; + } + if ($alias_name['name'] == $targetport) { + $columns['targetport'] = $alias_id; + } } return $columns; |