From 67c2baf157c50ae1b545f36bcf6afee6cdf6f67c Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 14 Dec 2015 23:18:15 +0545 Subject: Coe style firewall * --- src/usr/local/www/firewall_nat_out_edit.php | 41 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'src/usr/local/www/firewall_nat_out_edit.php') diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index bf00c99..0f10140 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -71,8 +71,9 @@ require_once("ipsec.inc"); require_once("filter.inc"); require("shaper.inc"); -if (!is_array($config['nat']['outbound'])) +if (!is_array($config['nat']['outbound'])) { $config['nat']['outbound'] = array(); +} if (!is_array($config['nat']['outbound']['rule'])) { $config['nat']['outbound']['rule'] = array(); @@ -404,8 +405,9 @@ function build_target_list() { if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $sn) { - if (isset($sn['noexpand'])) + if (isset($sn['noexpand'])) { continue; + } if ($sn['mode'] == "proxyarp" && $sn['type'] == "network") { $start = ip2long32(gen_subnet($sn['subnet'], $sn['subnet_bits'])); @@ -425,8 +427,9 @@ function build_target_list() { } foreach ($a_aliases as $alias) { - if ($alias['type'] != "host") + if ($alias['type'] != "host") { continue; + } $list[$alias['name']] = 'Host Alias: ' . $alias['name'] . ' (' . $alias['descr'] . ')'; } @@ -436,8 +439,9 @@ function build_target_list() { return($list); } -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(new Form_Button( 'Submit', @@ -462,24 +466,31 @@ $section->addInput(new Form_Checkbox( $iflist = get_configured_interface_with_descr(false, true); -foreach ($iflist as $if => $ifdesc) - if (have_ruleint_access($if)) +foreach ($iflist as $if => $ifdesc) { + if (have_ruleint_access($if)) { $interfaces[$if] = $ifdesc; + } +} -if ($config['l2tp']['mode'] == "server") - if (have_ruleint_access("l2tp")) +if ($config['l2tp']['mode'] == "server") { + if (have_ruleint_access("l2tp")) { $interfaces['l2tp'] = "L2TP VPN"; + } +} -if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) +if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) { $interfaces['pppoe'] = "PPPoE Server"; +} /* add ipsec interfaces */ -if (ipsec_enabled() && have_ruleint_access("enc0")) +if (ipsec_enabled() && have_ruleint_access("enc0")) { $interfaces["enc0"] = "IPsec"; +} /* add openvpn/tun interfaces */ -if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) +if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) { $interfaces["openvpn"] = "OpenVPN"; +} $section->addInput(new Form_Select( 'interface', @@ -683,7 +694,7 @@ print($form);