From 52b59a96afcde00f98eecfe0bb7924ec406a02ec Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 30 Aug 2015 22:26:15 +0545 Subject: Update bandwidth_by_ip in bootstrap Somehow an old version of bandwidth_by_ip is still in bootstrap branch. Update it with the current version from master - there are no boostrap-specific changes for this file. --- src/usr/local/www/bandwidth_by_ip.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/bandwidth_by_ip.php b/src/usr/local/www/bandwidth_by_ip.php index 9f8cc6c..39f9a01 100755 --- a/src/usr/local/www/bandwidth_by_ip.php +++ b/src/usr/local/www/bandwidth_by_ip.php @@ -1,8 +1,6 @@ \ No newline at end of file +} +?> -- cgit v1.1 From 6de4dd1dd743e629f6c16c0d1deb0b1c07e92112 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 30 Aug 2015 23:21:16 +0545 Subject: diag_ipsec dodgy=looking things for bootstrap Does ettext() return some extra-terrestrial language translation? :) The floating "if" at line 377 looks like it is missing its code block - I have guessed what it could be by cut/paste/change of the "if" statement above. Note that this would have fallen through to putting the "IPComp" stuff inside this "if" statement. I do not think that is what is intended? I see that we are not putting {} curlies around every code block any more - that is a shame, because this is just the sort of thing that can be prevented/noticed easily if {} are used everywhere. --- src/usr/local/www/diag_ipsec.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/usr') diff --git a/src/usr/local/www/diag_ipsec.php b/src/usr/local/www/diag_ipsec.php index f5a83c8..cd99e51 100644 --- a/src/usr/local/www/diag_ipsec.php +++ b/src/usr/local/www/diag_ipsec.php @@ -225,7 +225,7 @@ if (is_array($status['query']) && is_array($status['query']['ikesalist']) && is_ print('
' . $identity); } else { if (empty($identity)) - print(ettext("Unknown")); + print(gettext("Unknown")); else print($identity); } @@ -375,6 +375,7 @@ if (is_array($status['query']) && is_array($status['query']['ikesalist']) && is_ print(htmlspecialchars($childsa['dhgroup']) . '
'); if (!empty($childsa['esn'])) + print(htmlspecialchars($childsa['esn']) . '
'); print(gettext("IPComp: ") . htmlspecialchars($childsa['ipcomp'])); ?> -- cgit v1.1 From 9ebe17964c012932b03a3f91ac67a2ff3e051e43 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 30 Aug 2015 23:49:13 +0545 Subject: diag_logs_filter bootstrap The tabbing of these lines makes them look like they were intended to be part of other "if" statements. Actually I do not think they were. The code logic seems OK, just the tabbing made it unclear. --- src/usr/local/www/diag_logs_filter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/diag_logs_filter.php b/src/usr/local/www/diag_logs_filter.php index c8e47a2..64bcc01 100644 --- a/src/usr/local/www/diag_logs_filter.php +++ b/src/usr/local/www/diag_logs_filter.php @@ -370,7 +370,7 @@ if (!isset($config['syslog']['rawfilter'])) { else print(count($filterlog). ' ' . gettext('matched log entries.') . ' '); - printf(gettext(" (Maximum %s)"),$nentries) + printf(gettext(" (Maximum %s)"), $nentries); ?> @@ -420,7 +420,7 @@ if (!isset($config['syslog']['rawfilter'])) { -- cgit v1.1 From ad2879b89a96cad751dd161fe01bc78aaabacc79 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Mon, 31 Aug 2015 01:09:10 +0200 Subject: bootstrap, use require_once for classes/Form.class.php --- src/usr/local/www/diag_authentication.php | 2 +- src/usr/local/www/diag_backup.php | 2 +- src/usr/local/www/diag_dns.php | 2 +- src/usr/local/www/diag_dump_states.php | 2 +- src/usr/local/www/diag_dump_states_sources.php | 2 +- src/usr/local/www/diag_logs.php | 2 +- src/usr/local/www/diag_logs_filter.php | 2 +- src/usr/local/www/diag_logs_settings.php | 2 +- src/usr/local/www/diag_nanobsd.php | 2 +- src/usr/local/www/diag_packet_capture.php | 2 +- src/usr/local/www/diag_patterns.php | 2 +- src/usr/local/www/diag_pf_info.php | 2 +- src/usr/local/www/diag_ping.php | 2 +- src/usr/local/www/diag_resetstate.php | 2 +- src/usr/local/www/diag_routes.php | 2 +- src/usr/local/www/diag_smart.php | 2 +- src/usr/local/www/diag_system_pftop.php | 2 +- src/usr/local/www/diag_tables.php | 2 +- src/usr/local/www/diag_testport.php | 2 +- src/usr/local/www/diag_traceroute.php | 2 +- src/usr/local/www/firewall_aliases_edit.php | 2 +- src/usr/local/www/firewall_aliases_import.php | 2 +- src/usr/local/www/firewall_nat_1to1_edit.php | 2 +- src/usr/local/www/firewall_nat_edit.php | 2 +- src/usr/local/www/firewall_nat_npt_edit.php | 2 +- src/usr/local/www/firewall_nat_out.php | 2 +- src/usr/local/www/firewall_nat_out_edit.php | 2 +- src/usr/local/www/firewall_rules_edit.php | 2 +- src/usr/local/www/firewall_schedule_edit.php | 2 +- src/usr/local/www/firewall_shaper.php | 2 +- src/usr/local/www/firewall_shaper_layer7.php | 2 +- src/usr/local/www/firewall_shaper_vinterface.php | 2 +- src/usr/local/www/interfaces.php | 2 +- src/usr/local/www/interfaces_assign.php | 2 +- src/usr/local/www/interfaces_bridge_edit.php | 2 +- src/usr/local/www/interfaces_gif_edit.php | 2 +- src/usr/local/www/interfaces_gre_edit.php | 2 +- src/usr/local/www/interfaces_groups_edit.php | 2 +- src/usr/local/www/interfaces_lagg_edit.php | 2 +- src/usr/local/www/interfaces_ppps_edit.php | 2 +- src/usr/local/www/interfaces_qinq_edit.php | 2 +- src/usr/local/www/interfaces_vlan_edit.php | 2 +- src/usr/local/www/interfaces_wireless_edit.php | 2 +- src/usr/local/www/load_balancer_monitor_edit.php | 2 +- src/usr/local/www/load_balancer_pool_edit.php | 2 +- src/usr/local/www/load_balancer_setting.php | 2 +- src/usr/local/www/pkg_mgr_settings.php | 2 +- src/usr/local/www/services_captiveportal.php | 2 +- src/usr/local/www/services_captiveportal_filemanager.php | 2 +- src/usr/local/www/services_captiveportal_hostname_edit.php | 2 +- src/usr/local/www/services_captiveportal_ip_edit.php | 2 +- src/usr/local/www/services_captiveportal_mac_edit.php | 2 +- src/usr/local/www/services_captiveportal_vouchers.php | 2 +- src/usr/local/www/services_captiveportal_vouchers_edit.php | 2 +- src/usr/local/www/services_captiveportal_zones_edit.php | 2 +- src/usr/local/www/services_dhcp_edit.php | 2 +- src/usr/local/www/services_dhcp_relay.php | 2 +- src/usr/local/www/services_dhcpv6.php | 2 +- src/usr/local/www/services_dhcpv6_edit.php | 2 +- src/usr/local/www/services_dhcpv6_relay.php | 2 +- src/usr/local/www/services_dnsmasq.php | 2 +- src/usr/local/www/services_dnsmasq_domainoverride_edit.php | 2 +- src/usr/local/www/services_dyndns_edit.php | 2 +- src/usr/local/www/services_igmpproxy_edit.php | 2 +- src/usr/local/www/services_ntpd.php | 2 +- src/usr/local/www/services_ntpd_gps.php | 2 +- src/usr/local/www/services_ntpd_pps.php | 2 +- src/usr/local/www/services_rfc2136_edit.php | 2 +- src/usr/local/www/services_snmp.php | 2 +- src/usr/local/www/services_unbound_acls.php | 2 +- src/usr/local/www/services_unbound_advanced.php | 2 +- src/usr/local/www/services_unbound_domainoverride_edit.php | 2 +- src/usr/local/www/services_wol.php | 2 +- src/usr/local/www/services_wol_edit.php | 2 +- src/usr/local/www/status_captiveportal.php | 2 +- src/usr/local/www/status_captiveportal_expire.php | 2 +- src/usr/local/www/status_captiveportal_test.php | 2 +- src/usr/local/www/status_graph.php | 2 +- src/usr/local/www/status_rrd_graph.php | 2 +- src/usr/local/www/status_rrd_graph_settings.php | 2 +- src/usr/local/www/system.php | 2 +- src/usr/local/www/system_advanced_admin.php | 2 +- src/usr/local/www/system_advanced_firewall.php | 2 +- src/usr/local/www/system_advanced_misc.php | 2 +- src/usr/local/www/system_advanced_network.php | 2 +- src/usr/local/www/system_advanced_notifications.php | 2 +- src/usr/local/www/system_advanced_sysctl.php | 2 +- src/usr/local/www/system_authservers.php | 2 +- src/usr/local/www/system_camanager.php | 2 +- src/usr/local/www/system_certmanager.php | 2 +- src/usr/local/www/system_crlmanager.php | 2 +- src/usr/local/www/system_firmware.php | 2 +- src/usr/local/www/system_firmware_settings.php | 2 +- src/usr/local/www/system_gateway_groups_edit.php | 2 +- src/usr/local/www/system_gateways_edit.php | 2 +- src/usr/local/www/system_groupmanager.php | 2 +- src/usr/local/www/system_groupmanager_addprivs.php | 2 +- src/usr/local/www/system_hasync.php | 2 +- src/usr/local/www/system_routes_edit.php | 2 +- src/usr/local/www/system_usermanager.php | 2 +- src/usr/local/www/system_usermanager_addprivs.php | 2 +- src/usr/local/www/system_usermanager_passwordmg.php | 2 +- src/usr/local/www/system_usermanager_settings.php | 2 +- src/usr/local/www/vpn_ipsec_keys_edit.php | 2 +- src/usr/local/www/vpn_ipsec_mobile.php | 2 +- src/usr/local/www/vpn_ipsec_phase1.php | 2 +- src/usr/local/www/vpn_ipsec_phase2.php | 2 +- src/usr/local/www/vpn_ipsec_settings.php | 2 +- src/usr/local/www/vpn_openvpn_client.php | 2 +- src/usr/local/www/vpn_openvpn_csc.php | 2 +- src/usr/local/www/vpn_openvpn_server.php | 2 +- src/usr/local/www/vpn_pppoe_edit.php | 2 +- 112 files changed, 112 insertions(+), 112 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/diag_authentication.php b/src/usr/local/www/diag_authentication.php index 503f5a3..1b3c366 100644 --- a/src/usr/local/www/diag_authentication.php +++ b/src/usr/local/www/diag_authentication.php @@ -110,7 +110,7 @@ if ($input_errors) if ($savemsg) print(''); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Test'); diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index 39bcc70..4451a46 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -632,7 +632,7 @@ $tab_array[] = array(gettext("Config History"), false, "diag_confbak.php"); $tab_array[] = array(gettext("Backup/Restore"), true, "diag_backup.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(false); diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php index a1267e2..4629a4c 100755 --- a/src/usr/local/www/diag_dns.php +++ b/src/usr/local/www/diag_dns.php @@ -213,7 +213,7 @@ else if (!$resolved && $type) if ($createdalias) print(''); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Lookup'); $section = new Form_Section('DNS Lookup'); diff --git a/src/usr/local/www/diag_dump_states.php b/src/usr/local/www/diag_dump_states.php index 9bd63f1..368b4d1 100755 --- a/src/usr/local/www/diag_dump_states.php +++ b/src/usr/local/www/diag_dump_states.php @@ -132,7 +132,7 @@ display_top_tabs($tab_array); // Start of tab content $current_statecount=`pfctl -si | grep "current entries" | awk '{ print $3 }'`; -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(false); diff --git a/src/usr/local/www/diag_dump_states_sources.php b/src/usr/local/www/diag_dump_states_sources.php index 04c8c03..5ad9f2c 100644 --- a/src/usr/local/www/diag_dump_states_sources.php +++ b/src/usr/local/www/diag_dump_states_sources.php @@ -126,7 +126,7 @@ events.push(function(){ addGlobal(new Form_Input( 'getactivity', diff --git a/src/usr/local/www/diag_ping.php b/src/usr/local/www/diag_ping.php index cb4bf2e..d812bc2 100644 --- a/src/usr/local/www/diag_ping.php +++ b/src/usr/local/www/diag_ping.php @@ -162,7 +162,7 @@ include('head.inc'); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Ping'); diff --git a/src/usr/local/www/diag_resetstate.php b/src/usr/local/www/diag_resetstate.php index 7dff11c..93f313b 100644 --- a/src/usr/local/www/diag_resetstate.php +++ b/src/usr/local/www/diag_resetstate.php @@ -122,7 +122,7 @@ if (isset($config['system']['lb_use_sticky'])) $tab_array[] = array(gettext("Reset States"), true, "diag_resetstate.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $resetbtn = new Form_Button( 'Submit', diff --git a/src/usr/local/www/diag_routes.php b/src/usr/local/www/diag_routes.php index 3b8e3ab..156b2cb 100644 --- a/src/usr/local/www/diag_routes.php +++ b/src/usr/local/www/diag_routes.php @@ -105,7 +105,7 @@ $shortcut_section = "routing"; include('head.inc'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Update'); $form->addGlobal(new Form_Input( diff --git a/src/usr/local/www/diag_smart.php b/src/usr/local/www/diag_smart.php index d09a891..22592f5 100644 --- a/src/usr/local/www/diag_smart.php +++ b/src/usr/local/www/diag_smart.php @@ -111,7 +111,7 @@ if (!file_exists('/dev/' . $targetdev)) { return; } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $tab_array = array(); $tab_array[0] = array(gettext("Information/Tests"), ($action != 'config'), $_SERVER['PHP_SELF'] . "?action=default"); diff --git a/src/usr/local/www/diag_system_pftop.php b/src/usr/local/www/diag_system_pftop.php index be2a493..fbd9df6 100644 --- a/src/usr/local/www/diag_system_pftop.php +++ b/src/usr/local/www/diag_system_pftop.php @@ -120,7 +120,7 @@ if ($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], $sorttypes) && if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(false); $form->addGlobal(new Form_Input( 'getactivity', diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php index 762b83e..1da864c 100644 --- a/src/usr/local/www/diag_tables.php +++ b/src/usr/local/www/diag_tables.php @@ -127,7 +127,7 @@ include("head.inc"); if ($savemsg) print_info_box($savemsg); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Show'); $section = new Form_Section('Table to display'); diff --git a/src/usr/local/www/diag_testport.php b/src/usr/local/www/diag_testport.php index 5ff0140..c0bfa30 100644 --- a/src/usr/local/www/diag_testport.php +++ b/src/usr/local/www/diag_testport.php @@ -235,7 +235,7 @@ else { print(''); } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Test'); diff --git a/src/usr/local/www/diag_traceroute.php b/src/usr/local/www/diag_traceroute.php index f82b963..22f6c83 100644 --- a/src/usr/local/www/diag_traceroute.php +++ b/src/usr/local/www/diag_traceroute.php @@ -135,7 +135,7 @@ if (!isset($do_traceroute)) { if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form('Traceroute'); diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index 84d9d96..6d2a886 100755 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -609,7 +609,7 @@ if (empty($tab)) { if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $form->addGlobal(new Form_Input( diff --git a/src/usr/local/www/firewall_aliases_import.php b/src/usr/local/www/firewall_aliases_import.php index 0199426..2d642b2 100755 --- a/src/usr/local/www/firewall_aliases_import.php +++ b/src/usr/local/www/firewall_aliases_import.php @@ -196,7 +196,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $section = new Form_Section('Alias details'); diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php index ba92003..a8efcd9 100644 --- a/src/usr/local/www/firewall_nat_1to1_edit.php +++ b/src/usr/local/www/firewall_nat_1to1_edit.php @@ -383,7 +383,7 @@ function dsttype_selected() { if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index 2b15c80..88c5151 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -636,7 +636,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/firewall_nat_npt_edit.php b/src/usr/local/www/firewall_nat_npt_edit.php index 7e385e5..5471fb2 100644 --- a/src/usr/local/www/firewall_nat_npt_edit.php +++ b/src/usr/local/www/firewall_nat_npt_edit.php @@ -215,7 +215,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php index 8f3d458..ad13e9f 100644 --- a/src/usr/local/www/firewall_nat_out.php +++ b/src/usr/local/www/firewall_nat_out.php @@ -334,7 +334,7 @@ $tab_array[] = array(gettext("Outbound"), true, "firewall_nat_out.php"); $tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index 4d85609..4ad8091 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -439,7 +439,7 @@ function build_target_list() { if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 8b77041..7ad681c 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1000,7 +1000,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $section = new Form_Section('Edit Firewall rule'); diff --git a/src/usr/local/www/firewall_schedule_edit.php b/src/usr/local/www/firewall_schedule_edit.php index bec4029..653a428 100644 --- a/src/usr/local/www/firewall_schedule_edit.php +++ b/src/usr/local/www/firewall_schedule_edit.php @@ -381,7 +381,7 @@ function build_month_list() { if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/firewall_shaper.php b/src/usr/local/www/firewall_shaper.php index 5050f9a..7bc902e 100644 --- a/src/usr/local/www/firewall_shaper.php +++ b/src/usr/local/www/firewall_shaper.php @@ -67,7 +67,7 @@ ##|*MATCH=firewall_shaper.php* ##|-PRIV -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); require("guiconfig.inc"); require_once("functions.inc"); diff --git a/src/usr/local/www/firewall_shaper_layer7.php b/src/usr/local/www/firewall_shaper_layer7.php index db350bd..0946bd7 100644 --- a/src/usr/local/www/firewall_shaper_layer7.php +++ b/src/usr/local/www/firewall_shaper_layer7.php @@ -67,7 +67,7 @@ ##|-PRIV require("guiconfig.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); require_once("functions.inc"); require_once("filter.inc"); require_once("shaper.inc"); diff --git a/src/usr/local/www/firewall_shaper_vinterface.php b/src/usr/local/www/firewall_shaper_vinterface.php index da5ae24..11f3d59 100644 --- a/src/usr/local/www/firewall_shaper_vinterface.php +++ b/src/usr/local/www/firewall_shaper_vinterface.php @@ -67,7 +67,7 @@ ##|*MATCH=firewall_shaper_vinterface.php* ##|-PRIV -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 51c3324..99c3d67 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -1719,7 +1719,7 @@ if ($savemsg) print_info_box($savemsg, 'success'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/interfaces_assign.php b/src/usr/local/www/interfaces_assign.php index 1e38812..88b8df1 100644 --- a/src/usr/local/www/interfaces_assign.php +++ b/src/usr/local/www/interfaces_assign.php @@ -206,7 +206,7 @@ if (is_array($config['openvpn'])) { } } -if (isset($_POST['if_add'])) { +if (isset($_POST['add']) && isset($_POST['if_add'])) { /* Be sure this port is not being used */ $portused = false; foreach ($config['interfaces'] as $ifname => $ifdata) { diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php index c38afb6..4377555 100644 --- a/src/usr/local/www/interfaces_bridge_edit.php +++ b/src/usr/local/www/interfaces_bridge_edit.php @@ -329,7 +329,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/interfaces_gif_edit.php b/src/usr/local/www/interfaces_gif_edit.php index 7600717..fa5e1d2 100644 --- a/src/usr/local/www/interfaces_gif_edit.php +++ b/src/usr/local/www/interfaces_gif_edit.php @@ -148,7 +148,7 @@ function build_parent_list() { $pgtitle = array(gettext("Interfaces"),gettext("GIF"),gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/interfaces_gre_edit.php b/src/usr/local/www/interfaces_gre_edit.php index 8a6497b..b0f06d8 100644 --- a/src/usr/local/www/interfaces_gre_edit.php +++ b/src/usr/local/www/interfaces_gre_edit.php @@ -143,7 +143,7 @@ function build_parent_list() { $pgtitle = array(gettext("Interfaces"),gettext("GRE"),gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php index 8e7b6da..f9fc399 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -206,7 +206,7 @@ $tab_array[9] = array(gettext("Bridges"), false, "interfaces_bridge.php"); $tab_array[10] = array(gettext("LAGG"), false, "interfaces_lagg.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $section = new Form_Section('Interface Group Edit'); diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php index 3a03172..8590f01 100644 --- a/src/usr/local/www/interfaces_lagg_edit.php +++ b/src/usr/local/www/interfaces_lagg_edit.php @@ -217,7 +217,7 @@ function build_member_list() { $pgtitle = array(gettext("Interfaces"),gettext("LAGG"),gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 62363a7..729e9c4 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -582,7 +582,7 @@ $linkparamstr = gettext('Bandwidth is set only for MLLP conncetions and when lin 'MRU will be auto-negotiated by default' . '
' . 'Set only for MLLP conncetions. MRRU will be auto-negotiated by default.'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/interfaces_qinq_edit.php b/src/usr/local/www/interfaces_qinq_edit.php index 9460884..dad4cf1 100644 --- a/src/usr/local/www/interfaces_qinq_edit.php +++ b/src/usr/local/www/interfaces_qinq_edit.php @@ -233,7 +233,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/interfaces_vlan_edit.php b/src/usr/local/www/interfaces_vlan_edit.php index 0bf223a..3be34ca 100644 --- a/src/usr/local/www/interfaces_vlan_edit.php +++ b/src/usr/local/www/interfaces_vlan_edit.php @@ -162,7 +162,7 @@ if ($input_errors) { print_input_errors($input_errors); } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $section = new Form_Section('Interface VLAN Edit'); diff --git a/src/usr/local/www/interfaces_wireless_edit.php b/src/usr/local/www/interfaces_wireless_edit.php index 52d26ff..7919424 100644 --- a/src/usr/local/www/interfaces_wireless_edit.php +++ b/src/usr/local/www/interfaces_wireless_edit.php @@ -179,7 +179,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/load_balancer_monitor_edit.php b/src/usr/local/www/load_balancer_monitor_edit.php index b7134db..6134b37 100644 --- a/src/usr/local/www/load_balancer_monitor_edit.php +++ b/src/usr/local/www/load_balancer_monitor_edit.php @@ -266,7 +266,7 @@ events.push(function(){ if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/load_balancer_pool_edit.php b/src/usr/local/www/load_balancer_pool_edit.php index 876abe5..4d41b3b 100644 --- a/src/usr/local/www/load_balancer_pool_edit.php +++ b/src/usr/local/www/load_balancer_pool_edit.php @@ -292,7 +292,7 @@ events.push(function(){ if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/load_balancer_setting.php b/src/usr/local/www/load_balancer_setting.php index 371c91f..ae18f6f 100644 --- a/src/usr/local/www/load_balancer_setting.php +++ b/src/usr/local/www/load_balancer_setting.php @@ -120,7 +120,7 @@ $tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php"); $tab_array[] = array(gettext("Settings"), true, "load_balancer_setting.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/pkg_mgr_settings.php b/src/usr/local/www/pkg_mgr_settings.php index da3c393..13a6b40 100644 --- a/src/usr/local/www/pkg_mgr_settings.php +++ b/src/usr/local/www/pkg_mgr_settings.php @@ -88,7 +88,7 @@ print_info_box(gettext('This page allows an alternate package repository to be c 'The package server settings should remain at their default values to ensure that verifiable and trusted packages are recevied.' . 'A warning is printed on the Dashboard and in the package manager when an unofficial package server is in use.'), 'default'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php index 04a9e20..9e46749 100644 --- a/src/usr/local/www/services_captiveportal.php +++ b/src/usr/local/www/services_captiveportal.php @@ -539,7 +539,7 @@ $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_voucher $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}"); display_top_tabs($tab_array, true); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_captiveportal_filemanager.php b/src/usr/local/www/services_captiveportal_filemanager.php index afd1610..1984cba 100644 --- a/src/usr/local/www/services_captiveportal_filemanager.php +++ b/src/usr/local/www/services_captiveportal_filemanager.php @@ -151,7 +151,7 @@ $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_voucher $tab_array[] = array(gettext("File Manager"), true, "services_captiveportal_filemanager.php?zone={$cpzone}"); display_top_tabs($tab_array, true); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if ($_GET['act'] == 'add') { diff --git a/src/usr/local/www/services_captiveportal_hostname_edit.php b/src/usr/local/www/services_captiveportal_hostname_edit.php index 2bd49ff..8f8bbd2 100644 --- a/src/usr/local/www/services_captiveportal_hostname_edit.php +++ b/src/usr/local/www/services_captiveportal_hostname_edit.php @@ -180,7 +180,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/services_captiveportal_ip_edit.php b/src/usr/local/www/services_captiveportal_ip_edit.php index 0db6df5..93965fd 100644 --- a/src/usr/local/www/services_captiveportal_ip_edit.php +++ b/src/usr/local/www/services_captiveportal_ip_edit.php @@ -206,7 +206,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_captiveportal_mac_edit.php b/src/usr/local/www/services_captiveportal_mac_edit.php index 4f28531..baa4d9c 100644 --- a/src/usr/local/www/services_captiveportal_mac_edit.php +++ b/src/usr/local/www/services_captiveportal_mac_edit.php @@ -193,7 +193,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_captiveportal_vouchers.php b/src/usr/local/www/services_captiveportal_vouchers.php index b80d3a0..6b3065b 100644 --- a/src/usr/local/www/services_captiveportal_vouchers.php +++ b/src/usr/local/www/services_captiveportal_vouchers.php @@ -469,7 +469,7 @@ if ($pconfig['enable']) : ?> " . gettext("You must apply the changes in order for them to take effect.")); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php index 3bc37fa..c7fdc67 100644 --- a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php +++ b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php @@ -132,7 +132,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index 750cd9b..8e7c1e3 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -232,7 +232,7 @@ if ($input_errors) if ($savemsg) print_info_box($savemsg, 'success'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/services_igmpproxy_edit.php b/src/usr/local/www/services_igmpproxy_edit.php index cbe8307..7f3e6f0 100644 --- a/src/usr/local/www/services_igmpproxy_edit.php +++ b/src/usr/local/www/services_igmpproxy_edit.php @@ -151,7 +151,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); // These two inputs appear inthe original file. Don't know what they are for // but they are here just in case. diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php index 412678b..518b568 100644 --- a/src/usr/local/www/services_ntpd.php +++ b/src/usr/local/www/services_ntpd.php @@ -260,7 +260,7 @@ $tab_array[] = array(gettext("Serial GPS"), false, "services_ntpd_gps.php"); $tab_array[] = array(gettext("PPS"), false, "services_ntpd_pps.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php index 9bf100d..f22a7cf 100644 --- a/src/usr/local/www/services_ntpd_gps.php +++ b/src/usr/local/www/services_ntpd_gps.php @@ -210,7 +210,7 @@ $tab_array[] = array(gettext("Serial GPS"), true, "services_ntpd_gps.php"); $tab_array[] = array(gettext("PPS"), false, "services_ntpd_pps.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/services_ntpd_pps.php b/src/usr/local/www/services_ntpd_pps.php index c8d817b..8cd740d 100644 --- a/src/usr/local/www/services_ntpd_pps.php +++ b/src/usr/local/www/services_ntpd_pps.php @@ -127,7 +127,7 @@ $tab_array[] = array(gettext("Serial GPS"), false, "services_ntpd_gps.php"); $tab_array[] = array(gettext("PPS"), true, "services_ntpd_pps.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/services_rfc2136_edit.php b/src/usr/local/www/services_rfc2136_edit.php index 53445bb..2949632 100644 --- a/src/usr/local/www/services_rfc2136_edit.php +++ b/src/usr/local/www/services_rfc2136_edit.php @@ -132,7 +132,7 @@ if ($_POST) { $pgtitle = array(gettext("Services"), gettext("RFC 2136 client"), gettext("Edit")); include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if ($input_errors) print_input_errors($input_errors); diff --git a/src/usr/local/www/services_snmp.php b/src/usr/local/www/services_snmp.php index ec94af7..3494add 100644 --- a/src/usr/local/www/services_snmp.php +++ b/src/usr/local/www/services_snmp.php @@ -199,7 +199,7 @@ if ($input_errors) if ($savemsg) print_info_box($savemsg); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_unbound_acls.php b/src/usr/local/www/services_unbound_acls.php index 94e0b71..47cafe0 100644 --- a/src/usr/local/www/services_unbound_acls.php +++ b/src/usr/local/www/services_unbound_acls.php @@ -184,7 +184,7 @@ $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_adva $tab_array[] = array(gettext("Access Lists"), true, "/services_unbound_acls.php"); display_top_tabs($tab_array, true); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if($act=="new" || $act=="edit") { diff --git a/src/usr/local/www/services_unbound_advanced.php b/src/usr/local/www/services_unbound_advanced.php index 26a9732..4afca92 100644 --- a/src/usr/local/www/services_unbound_advanced.php +++ b/src/usr/local/www/services_unbound_advanced.php @@ -233,7 +233,7 @@ $tab_array[] = array(gettext("Advanced settings"), true, "services_unbound_advan $tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php"); display_top_tabs($tab_array, true); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_unbound_domainoverride_edit.php b/src/usr/local/www/services_unbound_domainoverride_edit.php index 2f8533c..94793eb 100644 --- a/src/usr/local/www/services_unbound_domainoverride_edit.php +++ b/src/usr/local/www/services_unbound_domainoverride_edit.php @@ -121,7 +121,7 @@ $pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("Edit Dom $shortcut_section = "resolver"; include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php index 40917d9..8e3ed2d 100644 --- a/src/usr/local/www/services_wol.php +++ b/src/usr/local/www/services_wol.php @@ -42,7 +42,7 @@ ##|-PRIV require("guiconfig.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if (!is_array($config['wol']['wolentry'])) { $config['wol']['wolentry'] = array(); diff --git a/src/usr/local/www/services_wol_edit.php b/src/usr/local/www/services_wol_edit.php index 2c750ed..97aff7f 100644 --- a/src/usr/local/www/services_wol_edit.php +++ b/src/usr/local/www/services_wol_edit.php @@ -51,7 +51,7 @@ function wol_sort() { } require("guiconfig.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if (!is_array($config['wol']['wolentry'])) { $config['wol']['wolentry'] = array(); diff --git a/src/usr/local/www/status_captiveportal.php b/src/usr/local/www/status_captiveportal.php index efe6851..4edeb64 100644 --- a/src/usr/local/www/status_captiveportal.php +++ b/src/usr/local/www/status_captiveportal.php @@ -120,7 +120,7 @@ endif; // Load MAC-Manufacturer table $mac_man = load_mac_manufacturer_table(); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if (count($a_cp) > 1) { $form = new Form(); diff --git a/src/usr/local/www/status_captiveportal_expire.php b/src/usr/local/www/status_captiveportal_expire.php index 0e0631f..c9009fb 100644 --- a/src/usr/local/www/status_captiveportal_expire.php +++ b/src/usr/local/www/status_captiveportal_expire.php @@ -71,7 +71,7 @@ $tab_array[] = array(gettext("Test Vouchers"), false, "status_captiveportal_test $tab_array[] = array(gettext("Expire Vouchers"), true, "status_captiveportal_expire.php?zone={$cpzone}"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/status_captiveportal_test.php b/src/usr/local/www/status_captiveportal_test.php index 6a7993e..75e18dd 100644 --- a/src/usr/local/www/status_captiveportal_test.php +++ b/src/usr/local/www/status_captiveportal_test.php @@ -72,7 +72,7 @@ $tab_array[] = array(gettext("Test Vouchers"), true, "status_captiveportal_test. $tab_array[] = array(gettext("Expire Vouchers"), false, "status_captiveportal_expire.php?zone={$cpzone}"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/status_graph.php b/src/usr/local/www/status_graph.php index 5f2dbbb..30fa6ad 100644 --- a/src/usr/local/www/status_graph.php +++ b/src/usr/local/www/status_graph.php @@ -129,7 +129,7 @@ $pgtitle = array(gettext("Status"),gettext("Traffic Graph")); include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(false); $form->addClass('auto-submit'); diff --git a/src/usr/local/www/status_rrd_graph.php b/src/usr/local/www/status_rrd_graph.php index 037f521..c7b7eb1 100644 --- a/src/usr/local/www/status_rrd_graph.php +++ b/src/usr/local/www/status_rrd_graph.php @@ -492,7 +492,7 @@ display_top_tabs(make_tabs()); if ($input_errors && count($input_errors)) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(new Form_Button( 'submit', diff --git a/src/usr/local/www/status_rrd_graph_settings.php b/src/usr/local/www/status_rrd_graph_settings.php index 3ad7e8d..f43c3f5 100644 --- a/src/usr/local/www/status_rrd_graph_settings.php +++ b/src/usr/local/www/status_rrd_graph_settings.php @@ -180,7 +180,7 @@ if ($input_errors) if ($savemsg) print_info_box($savemsg, 'success'); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php index cd028a4..79be7a6 100644 --- a/src/usr/local/www/system.php +++ b/src/usr/local/www/system.php @@ -310,7 +310,7 @@ if ($savemsg)
addInput(new Form_Input( diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php index 4b38b49..0e6ca82 100644 --- a/src/usr/local/www/system_advanced_admin.php +++ b/src/usr/local/www/system_advanced_admin.php @@ -302,7 +302,7 @@ display_top_tabs($tab_array); ?>
setAction('system_authservers.php?act=edit'); $form->addGlobal(new Form_Input( diff --git a/src/usr/local/www/system_camanager.php b/src/usr/local/www/system_camanager.php index 83ace47..30f06c7 100644 --- a/src/usr/local/www/system_camanager.php +++ b/src/usr/local/www/system_camanager.php @@ -439,7 +439,7 @@ foreach ($a_ca as $i => $ca): exit; } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; //$form->setAction('system_camanager.php?act=edit'); if (isset($id) && $a_ca[$id]) diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php index f9f2702..5174826 100644 --- a/src/usr/local/www/system_certmanager.php +++ b/src/usr/local/www/system_certmanager.php @@ -644,7 +644,7 @@ foreach($a_cert as $i => $cert): exit; } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; if ($act == "csr" || (($_POST['save'] == gettext("Update")) && $input_errors)) diff --git a/src/usr/local/www/system_crlmanager.php b/src/usr/local/www/system_crlmanager.php index 128c761..c13d401 100644 --- a/src/usr/local/www/system_crlmanager.php +++ b/src/usr/local/www/system_crlmanager.php @@ -373,7 +373,7 @@ $tab_array[] = array(gettext("Certificates"), false, "system_certmanager.php"); $tab_array[] = array(gettext("Certificate Revocation"), true, "system_crlmanager.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); if ($act == "new" || $act == gettext("Save") || $input_errors) { if (!isset($id)) { diff --git a/src/usr/local/www/system_firmware.php b/src/usr/local/www/system_firmware.php index ccd2ab9..b211a5c 100644 --- a/src/usr/local/www/system_firmware.php +++ b/src/usr/local/www/system_firmware.php @@ -240,7 +240,7 @@ if ($sig_warning && !$input_errors) { } else { // This is where the work gets done so Forms.classes will be used from this point if (!is_subsystem_dirty('firmwarelock')) { - require('classes/Form.class.php'); + require_once('classes/Form.class.php'); if (!is_subsystem_dirty('rebootreq')) { // Provide a button to enable firmware upgrades. Upgrades should be disabled on initial page load diff --git a/src/usr/local/www/system_firmware_settings.php b/src/usr/local/www/system_firmware_settings.php index e43ca1c..aaf9089 100644 --- a/src/usr/local/www/system_firmware_settings.php +++ b/src/usr/local/www/system_firmware_settings.php @@ -113,7 +113,7 @@ if($g['hidedownloadbackup'] == false) display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php index 70d46e8..87461e0 100644 --- a/src/usr/local/www/system_gateway_groups_edit.php +++ b/src/usr/local/www/system_gateway_groups_edit.php @@ -194,7 +194,7 @@ $protocol_array = array_values(array_unique($gateway_protocol)); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php index bed023b..948ebe0 100644 --- a/src/usr/local/www/system_gateways_edit.php +++ b/src/usr/local/www/system_gateways_edit.php @@ -670,7 +670,7 @@ events.push(function(){ setAction('system_groupmanager.php?act=edit'); $form->addGlobal(new Form_Input( diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php index d9134bf..1f45956 100644 --- a/src/usr/local/www/system_groupmanager_addprivs.php +++ b/src/usr/local/www/system_groupmanager_addprivs.php @@ -142,7 +142,7 @@ $tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.ph $tab_array[] = array(gettext("Servers"), false, "system_authservers.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; if (isset($groupid)) { diff --git a/src/usr/local/www/system_hasync.php b/src/usr/local/www/system_hasync.php index 47f6ea6..bbc258f 100755 --- a/src/usr/local/www/system_hasync.php +++ b/src/usr/local/www/system_hasync.php @@ -108,7 +108,7 @@ foreach ($ifaces as $ifname => $iface) { include("head.inc"); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; diff --git a/src/usr/local/www/system_routes_edit.php b/src/usr/local/www/system_routes_edit.php index 1a8974f..9c7b294 100644 --- a/src/usr/local/www/system_routes_edit.php +++ b/src/usr/local/www/system_routes_edit.php @@ -238,7 +238,7 @@ include("head.inc"); if ($input_errors) print_input_errors($input_errors); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; if (isset($id) && $a_routes[$id]) { diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index dc84a7a..23464de 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -485,7 +485,7 @@ foreach($a_user as $i => $userent): exit; } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; if ($act == "new" || $act == "edit" || $input_errors): diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php index 2e05769..ab70655 100644 --- a/src/usr/local/www/system_usermanager_addprivs.php +++ b/src/usr/local/www/system_usermanager_addprivs.php @@ -147,7 +147,7 @@ $tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.ph $tab_array[] = array(gettext("Servers"), false, "system_authservers.php"); display_top_tabs($tab_array); -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/system_usermanager_passwordmg.php b/src/usr/local/www/system_usermanager_passwordmg.php index cb02942..43bd6eb 100644 --- a/src/usr/local/www/system_usermanager_passwordmg.php +++ b/src/usr/local/www/system_usermanager_passwordmg.php @@ -104,7 +104,7 @@ if ($islocal == false) { exit; } -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form(); diff --git a/src/usr/local/www/system_usermanager_settings.php b/src/usr/local/www/system_usermanager_settings.php index a89970e..a844d78 100644 --- a/src/usr/local/www/system_usermanager_settings.php +++ b/src/usr/local/www/system_usermanager_settings.php @@ -118,7 +118,7 @@ display_top_tabs($tab_array); if(!$pconfig['backend']) $pconfig['backend'] = "pfsense"; -require('classes/Form.class.php'); +require_once('classes/Form.class.php'); $form = new Form; $section = new Form_Section('Settings'); diff --git a/src/usr/local/www/vpn_ipsec_keys_edit.php b/src/usr/local/www/vpn_ipsec_keys_edit.php index d4037c4..7f7d733 100644 --- a/src/usr/local/www/vpn_ipsec_keys_edit.php +++ b/src/usr/local/www/vpn_ipsec_keys_edit.php @@ -137,7 +137,7 @@ include("head.inc"); Date: Mon, 31 Aug 2015 22:19:01 +0545 Subject: Duplicated code in exec.php bootstrap I am not sure why these lines had been duplicated, so please explain if it does something that is needed. --- src/usr/local/www/exec.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/exec.php b/src/usr/local/www/exec.php index a7d9cfd..a8dcd99 100644 --- a/src/usr/local/www/exec.php +++ b/src/usr/local/www/exec.php @@ -142,8 +142,6 @@ if (isBlank($_POST['txtRecallBuffer'])) { puts(" );"); } ?> - // Set pointer to end of recall buffer. - var intRecallPtr = arrRecallBuffer.length-1; // Set pointer to end of recall buffer. var intRecallPtr = arrRecallBuffer.length-1; @@ -299,4 +297,4 @@ if (!isBlank($_POST['txtCommand'])):?> include("foot.inc"); if($_POST) - conf_mount_ro(); \ No newline at end of file + conf_mount_ro(); -- cgit v1.1 From e6f34d22cf841af5ee8cfeba9f71a9729dc113d9 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 1 Sep 2015 01:08:25 +0545 Subject: bootstrap usr\local\www\f minor changes --- src/usr/local/www/firewall_aliases.php | 26 +- src/usr/local/www/firewall_aliases_edit.php | 180 +++++----- src/usr/local/www/firewall_aliases_import.php | 2 +- src/usr/local/www/firewall_nat.php | 6 +- src/usr/local/www/firewall_nat_1to1_edit.php | 38 +- src/usr/local/www/firewall_nat_edit.php | 64 ++-- src/usr/local/www/firewall_nat_npt_edit.php | 14 +- src/usr/local/www/firewall_nat_out.php | 60 ++-- src/usr/local/www/firewall_nat_out_edit.php | 32 +- src/usr/local/www/firewall_rules.php | 34 +- src/usr/local/www/firewall_rules_edit.php | 76 ++-- src/usr/local/www/firewall_schedule.php | 18 +- src/usr/local/www/firewall_schedule_edit.php | 422 +++++++++++------------ src/usr/local/www/firewall_shaper.php | 10 +- src/usr/local/www/firewall_shaper_layer7.php | 56 +-- src/usr/local/www/firewall_shaper_queues.php | 2 +- src/usr/local/www/firewall_shaper_vinterface.php | 56 +-- src/usr/local/www/firewall_shaper_wizards.php | 2 +- src/usr/local/www/firewall_virtual_ip.php | 12 +- 19 files changed, 555 insertions(+), 555 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/firewall_aliases.php b/src/usr/local/www/firewall_aliases.php index c7be7d9..aeed7f1 100644 --- a/src/usr/local/www/firewall_aliases.php +++ b/src/usr/local/www/firewall_aliases.php @@ -127,7 +127,7 @@ if ($_GET['act'] == "del") { // Alias in an alias find_alias_reference(array('aliases', 'alias'), array('address'), $alias_name, $is_alias_referenced, $referenced_by); // Load Balancer - find_alias_reference(array('load_balancer', 'lbpool'), array('port'), $alias_name, $is_alias_referenced, $referenced_by); + find_alias_reference(array('load_balancer', 'lbpool'), array('port'), $alias_name, $is_alias_referenced, $referenced_by); find_alias_reference(array('load_balancer', 'virtual_server'), array('port'), $alias_name, $is_alias_referenced, $referenced_by); // Static routes find_alias_reference(array('staticroutes', 'route'), array('network'), $alias_name, $is_alias_referenced, $referenced_by); @@ -194,10 +194,10 @@ if (is_subsystem_dirty('aliases')) print_info_box_np(gettext("The alias list has been changed.") . "
" . gettext("You must apply the changes in order for them to take effect.")); $tab_array = array(); -$tab_array[] = array(gettext("IP"),($tab=="ip" ? true : ($tab=="host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip"); -$tab_array[] = array(gettext("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port"); -$tab_array[] = array(gettext("URLs"), ($tab=="url"? true : false), "/firewall_aliases.php?tab=url"); -$tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all"); +$tab_array[] = array(gettext("IP"), ($tab == "ip" ? true : ($tab == "host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip"); +$tab_array[] = array(gettext("Ports"), ($tab == "port"? true : false), "/firewall_aliases.php?tab=port"); +$tab_array[] = array(gettext("URLs"), ($tab == "url"? true : false), "/firewall_aliases.php?tab=url"); +$tab_array[] = array(gettext("All"), ($tab == "all"? true : false), "/firewall_aliases.php?tab=all"); display_top_tabs($tab_array); ?> @@ -213,24 +213,24 @@ display_top_tabs($tab_array); $alias): + foreach ($a_aliases as $i => $alias): unset ($show_alias); - switch ($tab){ + switch ($tab) { case "all": $show_alias= true; break; case "ip": case "host": case "network": - if (preg_match("/(host|network)/",$alias["type"])) + if (preg_match("/(host|network)/", $alias["type"])) $show_alias= true; break; case "url": - if (preg_match("/(url)/i",$alias["type"])) + if (preg_match("/(url)/i", $alias["type"])) $show_alias= true; break; case "port": - if($alias["type"] == "port") + if ($alias["type"] == "port") $show_alias= true; break; } @@ -245,10 +245,10 @@ display_top_tabs($tab_array); if ($alias["url"]) { echo $alias["url"] . "
"; } else { - if(is_array($alias["aliasurl"])) { + if (is_array($alias["aliasurl"])) { $aliasurls = implode(", ", array_slice($alias["aliasurl"], 0, 10)); echo $aliasurls; - if(count($aliasurls) > 10) { + if (count($aliasurls) > 10) { echo "…
"; } echo "
\n"; @@ -256,7 +256,7 @@ display_top_tabs($tab_array); $tmpaddr = explode(" ", $alias['address']); $addresses = implode(", ", array_slice($tmpaddr, 0, 10)); echo $addresses; - if(count($tmpaddr) > 10) { + if (count($tmpaddr) > 10) { echo '…'; } } diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index 84d9d96..de47a5d 100755 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -110,8 +110,8 @@ if ($_POST) { $adrs = count($_POST['address']); -for($idx=0; $idx<$adrs; $idx++) { - if($_POST['address'][$idx] == "") +for ($idx = 0; $idx < $adrs; $idx++) { + if ($_POST['address'][$idx] == "") unset($_POST['address'][$idx]); } @@ -260,9 +260,9 @@ if ($_POST) { download_file($post_address, $temp_filename . "/aliases", $verify_ssl); /* if the item is tar gzipped then extract */ - if(stristr($post_address, ".tgz")) + if (stristr($post_address, ".tgz")) process_alias_tgz($temp_filename); - else if(stristr($post_address, ".zip")) + else if (stristr($post_address, ".zip")) process_alias_unzip($temp_filename); if (!isset($alias['aliasurl'])) { @@ -312,47 +312,75 @@ if ($_POST) { // Users can paste strings like "10.1.2.0/24 10.3.0.0/16 9.10.11.0/24" into an address box. // They can also put an IP range. // This loop expands out that stuff so it can easily be validated. - foreach ($_POST['address'] as $idx => $post_address) { - if ($post_address != "") { + foreach ($_POST['address'] as $idx => $post_address) { + if ($post_address != "") { - if ((strpos($post_address, "||") === false) && (substr($post_address, 0, 1) != "|") && (substr($post_address, -1, 1) != "|")) { - $detail_text = $post_address; - } else { - /* Remove leading and trailing vertical bars and replace multiple vertical bars with single, */ - /* and put in the output array so the text is at least redisplayed for the user. */ - $detail_text = preg_replace('/\|\|+/', '|', trim($post_address, "|")); - if (!$desc_fmt_err_found) { - $input_errors[] = $vertical_bar_err_text; - $desc_fmt_err_found = true; - } - } + if ((strpos($post_address, "||") === false) && (substr($post_address, 0, 1) != "|") && (substr($post_address, -1, 1) != "|")) { + $detail_text = $post_address; } else { - $detail_text = sprintf(gettext("Entry added %s"), date('r')); + /* Remove leading and trailing vertical bars and replace multiple vertical bars with single, */ + /* and put in the output array so the text is at least redisplayed for the user. */ + $detail_text = preg_replace('/\|\|+/', '|', trim($post_address, "|")); + if (!$desc_fmt_err_found) { + $input_errors[] = $vertical_bar_err_text; + $desc_fmt_err_found = true; + } } - - $address_items = explode(" ", trim($post_address)); - foreach ($address_items as $address_item) { - $iprange_type = is_iprange($address_item); - - if ($iprange_type == 4) { - list($startip, $endip) = explode('-', $address_item); - if ($_POST['type'] == "network") { - // For network type aliases, expand an IPv4 range into an array of subnets. - $rangesubnets = ip_range_to_subnet_array($startip, $endip); - foreach ($rangesubnets as $rangesubnet) { - if ($alias_address_count > $max_alias_addresses) { - break; - } - list($address_part, $subnet_part) = explode("/", $rangesubnet); - $input_addresses[] = $address_part; - $input_address_subnet[] = $subnet_part; + } else { + $detail_text = sprintf(gettext("Entry added %s"), date('r')); + } + + $address_items = explode(" ", trim($post_address)); + foreach ($address_items as $address_item) { + $iprange_type = is_iprange($address_item); + + if ($iprange_type == 4) { + list($startip, $endip) = explode('-', $address_item); + if ($_POST['type'] == "network") { + // For network type aliases, expand an IPv4 range into an array of subnets. + $rangesubnets = ip_range_to_subnet_array($startip, $endip); + foreach ($rangesubnets as $rangesubnet) { + if ($alias_address_count > $max_alias_addresses) { + break; + } + list($address_part, $subnet_part) = explode("/", $rangesubnet); + $input_addresses[] = $address_part; + $input_address_subnet[] = $subnet_part; + $final_address_details[] = $detail_text; + $alias_address_count++; + } + } else { + // For host type aliases, expand an IPv4 range into a list of individual IPv4 addresses. + $rangeaddresses = ip_range_to_address_array($startip, $endip, $max_alias_addresses - $alias_address_count); + if (is_array($rangeaddresses)) { + foreach ($rangeaddresses as $rangeaddress) { + $input_addresses[] = $rangeaddress; + $input_address_subnet[] = ""; $final_address_details[] = $detail_text; $alias_address_count++; } } else { - // For host type aliases, expand an IPv4 range into a list of individual IPv4 addresses. - $rangeaddresses = ip_range_to_address_array($startip, $endip, $max_alias_addresses - $alias_address_count); - if (is_array($rangeaddresses)) { + $input_errors[] = sprintf(gettext('Range is too large to expand into individual host IP addresses (%s)'), $address_item); + $input_errors[] = sprintf(gettext('The maximum number of entries in an alias is %s'), $max_alias_addresses); + // Put the user-entered data in the output anyway, so it will be re-displayed for correction. + $input_addresses[] = $address_item; + $input_address_subnet[] = ""; + $final_address_details[] = $detail_text; + } + } + } else if ($iprange_type == 6) { + $input_errors[] = sprintf(gettext('IPv6 address ranges are not supported (%s)'), $address_item); + // Put the user-entered data in the output anyway, so it will be re-displayed for correction. + $input_addresses[] = $address_item; + $input_address_subnet[] = ""; + $final_address_details[] = $detail_text; + } else { + $subnet_type = is_subnet($address_item); + if (($_POST['type'] == "host") && $subnet_type) { + if ($subnet_type == 4) { + // For host type aliases, if the user enters an IPv4 subnet, expand it into a list of individual IPv4 addresses. + if (subnet_size($address_item) <= ($max_alias_addresses - $alias_address_count)) { + $rangeaddresses = subnetv4_expand($address_item); foreach ($rangeaddresses as $rangeaddress) { $input_addresses[] = $rangeaddress; $input_address_subnet[] = ""; @@ -360,75 +388,47 @@ if ($_POST) { $alias_address_count++; } } else { - $input_errors[] = sprintf(gettext('Range is too large to expand into individual host IP addresses (%s)'), $address_item); + $input_errors[] = sprintf(gettext('Subnet is too large to expand into individual host IP addresses (%s)'), $address_item); $input_errors[] = sprintf(gettext('The maximum number of entries in an alias is %s'), $max_alias_addresses); // Put the user-entered data in the output anyway, so it will be re-displayed for correction. $input_addresses[] = $address_item; $input_address_subnet[] = ""; $final_address_details[] = $detail_text; } + } else { + $input_errors[] = sprintf(gettext('IPv6 subnets are not supported in host aliases (%s)'), $address_item); + // Put the user-entered data in the output anyway, so it will be re-displayed for correction. + $input_addresses[] = $address_item; + $input_address_subnet[] = ""; + $final_address_details[] = $detail_text; } - } else if ($iprange_type == 6) { - $input_errors[] = sprintf(gettext('IPv6 address ranges are not supported (%s)'), $address_item); - // Put the user-entered data in the output anyway, so it will be re-displayed for correction. - $input_addresses[] = $address_item; - $input_address_subnet[] = ""; - $final_address_details[] = $detail_text; } else { - $subnet_type = is_subnet($address_item); - if (($_POST['type'] == "host") && $subnet_type) { - if ($subnet_type == 4) { - // For host type aliases, if the user enters an IPv4 subnet, expand it into a list of individual IPv4 addresses. - if (subnet_size($address_item) <= ($max_alias_addresses - $alias_address_count)) { - $rangeaddresses = subnetv4_expand($address_item); - foreach ($rangeaddresses as $rangeaddress) { - $input_addresses[] = $rangeaddress; - $input_address_subnet[] = ""; - $final_address_details[] = $detail_text; - $alias_address_count++; - } - } else { - $input_errors[] = sprintf(gettext('Subnet is too large to expand into individual host IP addresses (%s)'), $address_item); - $input_errors[] = sprintf(gettext('The maximum number of entries in an alias is %s'), $max_alias_addresses); - // Put the user-entered data in the output anyway, so it will be re-displayed for correction. - $input_addresses[] = $address_item; - $input_address_subnet[] = ""; - $final_address_details[] = $detail_text; - } + list($address_part, $subnet_part) = explode("/", $address_item); + if (!empty($subnet_part)) { + if (is_subnet($address_item)) { + $input_addresses[] = $address_part; + $input_address_subnet[] = $subnet_part; } else { - $input_errors[] = sprintf(gettext('IPv6 subnets are not supported in host aliases (%s)'), $address_item); - // Put the user-entered data in the output anyway, so it will be re-displayed for correction. + // The user typed something like "1.2.3.444/24" or "1.2.3.0/36" or similar rubbish. + // Feed it through without splitting it apart, then it will be caught by the validation loop below. $input_addresses[] = $address_item; $input_address_subnet[] = ""; - $final_address_details[] = $detail_text; } } else { - list($address_part, $subnet_part) = explode("/", $address_item); - if (!empty($subnet_part)) { - if (is_subnet($address_item)) { - $input_addresses[] = $address_part; - $input_address_subnet[] = $subnet_part; - } else { - // The user typed something like "1.2.3.444/24" or "1.2.3.0/36" or similar rubbish. - // Feed it through without splitting it apart, then it will be caught by the validation loop below. - $input_addresses[] = $address_item; - $input_address_subnet[] = ""; - } - } else { - $input_addresses[] = $address_part; - $input_address_subnet[] = $_POST["address_subnet"][$idx]; - } - - $final_address_details[] = $detail_text; - $alias_address_count++; + $input_addresses[] = $address_part; + $input_address_subnet[] = $_POST["address_subnet"][$idx]; } + + $final_address_details[] = $detail_text; + $alias_address_count++; } - if ($alias_address_count > $max_alias_addresses) { - $input_errors[] = sprintf(gettext('The maximum number of entries in an alias has been exceeded (%s)'), $max_alias_addresses); - break; - } + } + if ($alias_address_count > $max_alias_addresses) { + $input_errors[] = sprintf(gettext('The maximum number of entries in an alias has been exceeded (%s)'), $max_alias_addresses); + break; } } + } // Validate the input data expanded above. foreach ($input_addresses as $idx => $input_address) { diff --git a/src/usr/local/www/firewall_aliases_import.php b/src/usr/local/www/firewall_aliases_import.php index 0199426..cb54c29 100755 --- a/src/usr/local/www/firewall_aliases_import.php +++ b/src/usr/local/www/firewall_aliases_import.php @@ -93,7 +93,7 @@ if (!is_array($config['aliases']['alias'])) { } $a_aliases = &$config['aliases']['alias']; -if($_POST['aliasimport'] != "") { +if ($_POST['aliasimport'] != "") { $reqdfields = explode(" ", "name aliasimport"); $reqdfieldsn = array(gettext("Name"), gettext("Aliases")); diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index 651428d..82b5774 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -267,14 +267,14 @@ foreach ($a_nat as $natent): ); /* if user does not have access to edit an interface skip on to the next record */ - if(!have_natpfruleint_access($natent['interface'])) + if (!have_natpfruleint_access($natent['interface'])) continue; ?> "> 0) { +if (count($a_nat) > 0) { ?>
diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php index ba92003..4970ba9 100644 --- a/src/usr/local/www/firewall_nat_1to1_edit.php +++ b/src/usr/local/www/firewall_nat_1to1_edit.php @@ -142,8 +142,8 @@ if ($_POST) { $temp = str_replace(">", "", $value); $newpost = htmlentities($temp); - if($newpost != $temp) - $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."),$temp); + if ($newpost != $temp) + $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."), $temp); } /* input validation */ @@ -282,17 +282,17 @@ function build_srctype_list() { $sel = is_specialnet($pconfig['src']); - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $list['pptp'] = 'PPTP clients'; - if(have_ruleint_access("pppoe")) + if (have_ruleint_access("pppoe")) $list['pppoe'] = 'PPPoE clients'; - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $list['l2tp'] = 'L2TP clients'; foreach ($ifdisp as $ifent => $ifdesc) { - if(have_ruleint_access($ifent)) { + if (have_ruleint_access($ifent)) { $list[$ifent] = $ifdesc . ' net'; $list[$ifent . 'ip'] = $ifdesc . ' address'; } @@ -306,8 +306,8 @@ function srctype_selected() { $sel = is_specialnet($pconfig['src']); - if(!$sel) { - if(($pconfig['srcmask'] == 32) || (!isset($pconfig['srcmask']))) + if (!$sel) { + if (($pconfig['srcmask'] == 32) || (!isset($pconfig['srcmask']))) return('single'); return('network'); @@ -322,17 +322,17 @@ function build_dsttype_list() { $sel = is_specialnet($pconfig['dst']); $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network', '(self)' => 'This Firewall (self)'); - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $list['pptp'] = 'PPTP clients'; - if(have_ruleint_access("pppoe")) + if (have_ruleint_access("pppoe")) $list['pppoe'] = 'PPPoE clients'; - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $list['l2tp'] = 'L2TP clients'; foreach ($ifdisp as $if => $ifdesc) { - if(have_ruleint_access($if)) { + if (have_ruleint_access($if)) { $list[$if] = $ifdesc; $list[$if . 'ip'] = $ifdesc . ' address'; } @@ -367,11 +367,11 @@ function dsttype_selected() { $sel = is_specialnet($pconfig['dst']); - if(empty($pconfig['dst'] || $pconfig['dst'] == "any")) + if (empty($pconfig['dst'] || $pconfig['dst'] == "any")) return('any'); - if(!$sel) { - if($pconfig['dstmask'] == 32) + if (!$sel) { + if ($pconfig['dstmask'] == 32) return('single'); return('network'); @@ -402,15 +402,15 @@ $section->addInput(new Form_Checkbox( $iflist = get_configured_interface_with_descr(false, true); foreach ($iflist as $if => $ifdesc) - if(have_ruleint_access($if)) + if (have_ruleint_access($if)) $interfaces[$if] = $ifdesc; if ($config['l2tp']['mode'] == "server") - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $interfaces['l2tp'] = "L2TP VPN"; if ($config['pptpd']['mode'] == "server") - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $interfaces['pptp'] = "PPTP VPN"; if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) @@ -418,7 +418,7 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if(have_ruleint_access("enc0")) + if (have_ruleint_access("enc0")) $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index 2b15c80..57f64a4 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -157,7 +157,7 @@ unset($input_errors); foreach ($_POST as $key => $value) { $temp = $value; $newpost = htmlentities($temp); - if($newpost != $temp) + if ($newpost != $temp) $input_errors[] = sprintf(gettext("Invalid characters detected %s. Please remove invalid characters and save again."), $temp); } @@ -534,17 +534,17 @@ function build_srctype_list() { $sel = is_specialnet($pconfig['src']); - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $list['pptp'] = 'PPTP clients'; - if(have_ruleint_access("pppoe")) + if (have_ruleint_access("pppoe")) $list['pppoe'] = 'PPPoE clients'; - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $list['l2tp'] = 'L2TP clients'; foreach ($ifdisp as $ifent => $ifdesc) { - if(have_ruleint_access($ifent)) { + if (have_ruleint_access($ifent)) { $list[$ifent] = $ifdesc . ' net'; $list[$ifent . 'ip'] = $ifdesc . ' address'; } @@ -559,17 +559,17 @@ function build_dsttype_list() { $sel = is_specialnet($pconfig['dst']); $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network', '(self)' => 'This Firewall (self)'); - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $list['pptp'] = 'PPTP clients'; - if(have_ruleint_access("pppoe")) + if (have_ruleint_access("pppoe")) $list['pppoe'] = 'PPPoE clients'; - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $list['l2tp'] = 'L2TP clients'; foreach ($ifdisp as $if => $ifdesc) { - if(have_ruleint_access($if)) { + if (have_ruleint_access($if)) { $list[$if] = $ifdesc; $list[$if . 'ip'] = $ifdesc . ' address'; } @@ -604,8 +604,8 @@ function dsttype_selected() { $sel = is_specialnet($pconfig['dst']); - if(!$sel) { - if($pconfig['dstmask'] == 32) + if (!$sel) { + if ($pconfig['dstmask'] == 32) return('single'); return('network'); @@ -619,8 +619,8 @@ function srctype_selected() { $sel = is_specialnet($pconfig['src']); - if(!$sel) { - if($pconfig['srcmask'] == 32) + if (!$sel) { + if ($pconfig['srcmask'] == 32) return('single'); return('network'); @@ -662,15 +662,15 @@ $section->addInput(new Form_Checkbox( $iflist = get_configured_interface_with_descr(false, true); foreach ($iflist as $if => $ifdesc) - if(have_ruleint_access($if)) + if (have_ruleint_access($if)) $interfaces[$if] = $ifdesc; if ($config['l2tp']['mode'] == "server") - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $interfaces['l2tp'] = "L2TP VPN"; if ($config['pptpd']['mode'] == "server") - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $interfaces['pptp'] = "PPTP VPN"; if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) @@ -678,11 +678,11 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if(have_ruleint_access("enc0")) + if (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( @@ -894,7 +894,7 @@ if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET[' if (isset($filter_rule['associated-rule-id'])) { $rulelist[$filter_rule['associated-rule-id']] = 'Rule ' . $filter_rule['descr']; - if ($filter_rule['associated-rule-id']==$pconfig['associated-rule-id']) { + if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) { $hlpstr = '' . gettext("View the filter rule") . '
'; } } @@ -902,7 +902,7 @@ if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET[' } if (isset($pconfig['associated-rule-id'])) - $rulelist['new'] = 'Create new associated filter rule'; + $rulelist['new'] = 'Create new associated filter rule'; $section->addInput(new Form_Select( 'associated-rule-id', @@ -932,14 +932,14 @@ $has_updated_time = (isset($a_nat[$id]['updated']) && is_array($a_nat[$id]['upda if ($has_created_time || $has_updated_time) { $section = new Form_Section('Rule Information'); - if($has_created_time) { + if ($has_created_time) { $section->addInput(new Form_StaticText( 'Created', date(gettext("n/j/y H:i:s"), $a_nat[$id]['created']['time']) . gettext("by") . $a_nat[$id]['created']['username'] )); } - if($has_updated_time) { + if ($has_updated_time) { $section->addInput(new Form_StaticText( 'Updated', date(gettext("n/j/y H:i:s"), $a_nat[$id]['updated']['time']) . gettext("by") . $a_nat[$id]['updated']['username'] @@ -979,7 +979,7 @@ events.push(function(){ // ---------- "Library" functions --------------------------------------------------------------------------------- // Hides the
in which the specified input element lives so that the input, its label and help text are hidden function hideInput(id, hide) { - if(hide) + if (hide) $('#' + id).parent().parent('div').addClass('hidden'); else $('#' + id).parent().parent('div').removeClass('hidden'); @@ -992,7 +992,7 @@ events.push(function(){ // Hides all elements of the specified class. This will usually be a section function hideClass(s_class, hide) { - if(hide) + if (hide) $('.' + s_class).hide(); else $('.' + s_class).show(); @@ -1046,7 +1046,7 @@ events.push(function(){ disableInput('srcbeginport', false); disableInput('srcendport', false); disableInput('localbeginport_cust', false); - if( dstenabled ) { + if ( dstenabled ) { disableInput('dstbeginport', false); disableInput('dstendport', false); } @@ -1054,7 +1054,7 @@ events.push(function(){ } function nordr_change() { - if( $('#nordr').prop('checked') ) { + if ( $('#nordr').prop('checked') ) { hideInput('localip', true); hideClass('lclportrange', true); hideInput('associated-rule-id', true); @@ -1071,8 +1071,8 @@ events.push(function(){ // if External port range is an alias, then disallow // entry of Local port // - for(i=0; i $ifdesc) { - if(have_ruleint_access($if)) + if (have_ruleint_access($if)) $interfaces[$if] = $ifdesc; } if ($config['l2tp']['mode'] == "server") - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $interfaces['l2tp'] = "L2TP VPN"; if ($config['pptpd']['mode'] == "server") - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $interfaces['pptp'] = "PPTP VPN"; if ($config['pppoe']['mode'] == "server") - if(have_ruleint_access("pppoe")) + if (have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])) { - if(have_ruleint_access("enc0")) + if (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"; return($interfaces); } -$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("NPt"),gettext("Edit")); +$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"), gettext("Edit")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php index 8f3d458..0412348 100644 --- a/src/usr/local/www/firewall_nat_out.php +++ b/src/usr/local/www/firewall_nat_out.php @@ -152,10 +152,10 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $found = false; foreach ($a_out as $rule) { if ($rule['interface'] == $natent['interface'] && - $rule['source']['network'] == $natent['source']['network'] && - $rule['dstport'] == $natent['dstport'] && - $rule['target'] == $natent['target'] && - $rule['descr'] == $natent['descr']) { + $rule['source']['network'] == $natent['source']['network'] && + $rule['dstport'] == $natent['dstport'] && + $rule['target'] == $natent['target'] && + $rule['descr'] == $natent['descr']) { $found = true; break; } @@ -269,16 +269,16 @@ if (isset($_POST['del_x'])) { } } -function rule_popup($src,$srcport,$dst,$dstport){ - global $config,$g; +function rule_popup($src, $srcport, $dst, $dstport) { + global $config, $g; $aliases_array = array(); if ($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) { $descriptions = array (); - foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){ + foreach ($config['aliases']['alias'] as $alias_id => $alias_name) { $loading_image="\'loader\' " .gettext("loading...").""; - switch ($alias_name['type']){ + switch ($alias_name['type']) { case "port": $width="250"; break; @@ -303,7 +303,7 @@ function rule_popup($src,$srcport,$dst,$dstport){ $descriptions['srcport_end'] = $span_end; } - if ($alias_name['name'] == $dst ) { + if ($alias_name['name'] == $dst) { $descriptions['dst'] = $span_begin; $descriptions['dst_end'] = $span_end; } @@ -318,7 +318,7 @@ function rule_popup($src,$srcport,$dst,$dstport){ } } -$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound")); +$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Outbound")); include("head.inc"); if ($savemsg) @@ -411,11 +411,11 @@ print($form); $alias = rule_columns_with_alias( - $natent['source']['address'], - pprint_port($natent['source']['port']), - $natent['destination']['address'], - pprint_port($natent['destination']['port']) - ); + $natent['source']['address'], + pprint_port($natent['source']['port']), + $natent['destination']['address'], + pprint_port($natent['destination']['port']) + ); ?> @@ -464,9 +464,9 @@ print($form); @@ -487,9 +487,9 @@ print($form); @@ -560,7 +560,7 @@ print($form); @@ -687,7 +687,7 @@ if ($mode == "automatic" || $mode == "hybrid"): ' . + print_info_box(gettext('If automatic outbound NAT is selected, a mapping is automatically generated for each interface\'s subnet (except WAN-type connections) and the rules ' . + 'on the "Mappings" section of this page are ignored.' . '
' . 'If manual outbound NAT is selected, outbound NAT rules will not be automatically generated and only the mappings you specify on this page ' . 'will be used.' . '
' . 'If hybrid outbound NAT is selected, mappings you specify on this page will be used, followed by the automatically generated ones.' . '
' . diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index 4d85609..6ecf2ac 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -465,15 +465,15 @@ $section->addInput(new Form_Checkbox( $iflist = get_configured_interface_with_descr(false, true); foreach ($iflist as $if => $ifdesc) - if(have_ruleint_access($if)) + if (have_ruleint_access($if)) $interfaces[$if] = $ifdesc; if ($config['l2tp']['mode'] == "server") - if(have_ruleint_access("l2tp")) + if (have_ruleint_access("l2tp")) $interfaces['l2tp'] = "L2TP VPN"; if ($config['pptpd']['mode'] == "server") - if(have_ruleint_access("pptp")) + if (have_ruleint_access("pptp")) $interfaces['pptp'] = "PPTP VPN"; if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) @@ -481,11 +481,11 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if(have_ruleint_access("enc0")) + if (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( @@ -669,14 +669,14 @@ $has_updated_time = (isset($a_out[$id]['updated']) && is_array($a_out[$id]['upda if ($has_created_time || $has_updated_time) { $section = new Form_Section('Rule Information'); - if($has_created_time) { + if ($has_created_time) { $section->addInput(new Form_StaticText( 'Created', date(gettext("n/j/y H:i:s"), $a_out[$id]['created']['time']) . gettext("by") . $a_out[$id]['created']['username'] )); } - if($has_updated_time) { + if ($has_updated_time) { $section->addInput(new Form_StaticText( 'Updated', date(gettext("n/j/y H:i:s"), $a_out[$id]['updated']['time']) . gettext("by") . $a_out[$id]['updated']['username'] @@ -697,7 +697,7 @@ events.push(function(){ // Hides the
in which the specified input element lives so that the input, its label and help text are hidden function hideInput(id, hide) { - if(hide) + if (hide) $('#' + id).parent().parent('div').addClass('hidden'); else $('#' + id).parent().parent('div').removeClass('hidden'); @@ -706,7 +706,7 @@ events.push(function(){ // Hides the
in which the specified group input element lives so that the input, // its label and help text are hidden function hideGroupInput(id, hide) { - if(hide) + if (hide) $('#' + id).parent('div').addClass('hidden'); else $('#' + id).parent('div').removeClass('hidden'); @@ -714,7 +714,7 @@ events.push(function(){ // Hides the
in which the specified checkbox lives so that the checkbox, its label and help text are hidden function hideCheckbox(id, hide) { - if(hide) + if (hide) $('#' + id).parent().parent().parent('div').addClass('hidden'); else $('#' + id).parent().parent().parent('div').removeClass('hidden'); @@ -727,7 +727,7 @@ events.push(function(){ // Hides all elements of the specified class. This will usually be a section function hideClass(s_class, hide) { - if(hide) + if (hide) $('.' + s_class).hide(); else $('.' + s_class).show(); @@ -735,14 +735,14 @@ events.push(function(){ // Hides all elements of the specified class assigned to a group. This will usually be a group function hideGroupClass(s_class, hide) { - if(hide) + if (hide) $('.' + s_class).parent().parent().parent().hide(); else $('.' + s_class).parent().parent().parent().show(); } function staticportchange() { - if($('#staticnatport').prop('checked')) { + if ($('#staticnatport').prop('checked')) { $('#natport').val(""); disableInput('natport' , true); } else { @@ -751,7 +751,7 @@ events.push(function(){ } function sourcesel_change() { - if($('#source_type').find(":selected").val() == "network") { + if ($('#source_type').find(":selected").val() == "network") { disableInput('source', false); disableInput('source_subnet', false); } @@ -764,7 +764,7 @@ events.push(function(){ } function typesel_change() { - if($('#destination_type').find(":selected").val() == "network") { + if ($('#destination_type').find(":selected").val() == "network") { disableInput('destination', false); disableInput('destination_subnet', false); } @@ -781,7 +781,7 @@ events.push(function(){ } function proto_change() { - if( ($('#protocol').find(":selected").index() > 0) && ($('#protocol').find(":selected").index() <= 3) ) { + if (($('#protocol').find(":selected").index() > 0) && ($('#protocol').find(":selected").index() <= 3)) { hideGroupInput('sourceport', false); hideGroupInput('dstport', false); hideClass('natportgrp', false); diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index cf5497b..f3b4b00 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -173,7 +173,7 @@ if ($_POST) { clear_subsystem_dirty('filter'); - $savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background.
You can also %s monitor %s the reload progress"),"
",""); + $savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background.
You can also %s monitor %s the reload progress"), "", ""); } } @@ -268,8 +268,8 @@ display_top_tabs($tab_array); 1, or WAN with an if count of 1. if (!isset($config['system']['webgui']['noantilockout']) && - (((count($config['interfaces']) > 1) && ($if == 'lan')) - || ((count($config['interfaces']) == 1) && ($if == 'wan')))): + (((count($config['interfaces']) > 1) && ($if == 'lan')) || + ((count($config['interfaces']) == 1) && ($if == 'wan')))): $alports = implode('
', filter_get_antilockout_ports(true)); ?> @@ -374,19 +374,19 @@ display_top_tabs($tab_array); $sched_caption_escaped = ""; $sched_content = ""; $schedstatus = false; - $dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun')); - $monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December')); + $dayArray = array (gettext('Mon'), gettext('Tues'), gettext('Wed'), gettext('Thur'), gettext('Fri'), gettext('Sat'), gettext('Sun')); + $monthArray = array (gettext('January'), gettext('February'), gettext('March'), gettext('April'), gettext('May'), gettext('June'), gettext('July'), gettext('August'), gettext('September'), gettext('October'), gettext('November'), gettext('December')); if ($config['schedules']['schedule'] != "" && is_array($config['schedules']['schedule'])) { foreach ($a_schedules as $schedule) { - if ($schedule['name'] == $filterent['sched'] ){ + if ($schedule['name'] == $filterent['sched']) { $schedstatus = filter_get_time_based_rule_status($schedule); - foreach($schedule['timerange'] as $timerange) { + foreach ($schedule['timerange'] as $timerange) { $tempFriendlyTime = ""; $tempID = ""; $firstprint = false; - if ($timerange){ + if ($timerange) { $dayFriendly = ""; $tempFriendlyTime = ""; @@ -397,13 +397,13 @@ display_top_tabs($tab_array); $starttime = substr ($temptimerange, 0, $temptimeseparator); $stoptime = substr ($temptimerange, $temptimeseparator+1); - if ($timerange['month']){ + if ($timerange['month']) { $tempmontharray = explode(",", $timerange['month']); - $tempdayarray = explode(",",$timerange['day']); + $tempdayarray = explode(",", $timerange['day']); $arraycounter = 0; $firstDayFound = false; $firstPrint = false; - foreach ($tempmontharray as $monthtmp){ + foreach ($tempmontharray as $monthtmp) { $month = $tempmontharray[$arraycounter]; $day = $tempdayarray[$arraycounter]; @@ -417,7 +417,7 @@ display_top_tabs($tab_array); $currentDay = $day; $nextDay = $tempdayarray[$arraycounter+1]; $currentDay++; - if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){ + if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])) { if ($firstPrint) $dayFriendly .= ", "; $currentDay--; @@ -440,8 +440,8 @@ display_top_tabs($tab_array); $firstDay = ""; $nextDay = ""; $counter = 0; - foreach ($tempFriendlyDayArray as $day){ - if ($day != ""){ + foreach ($tempFriendlyDayArray as $day) { + if ($day != "") { if (!$firstDayFound) { $firstDay = $tempFriendlyDayArray[$counter]; @@ -451,7 +451,7 @@ display_top_tabs($tab_array); //get next day $nextDay = $tempFriendlyDayArray[$counter+1]; $currentDay++; - if ($currentDay != $nextDay){ + if ($currentDay != $nextDay) { if ($firstprint) $dayFriendly .= ", "; $currentDay--; @@ -504,7 +504,7 @@ display_top_tabs($tab_array); '; echo $filterent['icmptype']; echo ''; diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 8b77041..1162dea 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -86,16 +86,16 @@ function is_aoadv_used($rule_config) { // Note that the user could set "tag" or "tagged" to the string "0", which is valid but empty(). // And if the user enters "0" in other fields, we want to present an error message, and keep the Advanced Options section open. if ((isset($rule_config['allowopts'])) || - (isset($rule_config['disablereplyto'])) || - ($rule_config['tag'] != "") || - ($rule_config['tagged'] != "") || - ($rule_config['max'] != "") || - ($rule_config['max-src-nodes'] != "") || - ($rule_config['max-src-conn'] != "") || - ($rule_config['max-src-states'] != "") || - ($rule_config['max-src-conn-rate'] != "") || - ($rule_config['max-src-conn-rates'] != "") || - ($rule_config['statetimeout'] != "")) { + (isset($rule_config['disablereplyto'])) || + ($rule_config['tag'] != "") || + ($rule_config['tagged'] != "") || + ($rule_config['max'] != "") || + ($rule_config['max-src-nodes'] != "") || + ($rule_config['max-src-conn'] != "") || + ($rule_config['max-src-states'] != "") || + ($rule_config['max-src-conn-rate'] != "") || + ($rule_config['max-src-conn-rates'] != "") || + ($rule_config['statetimeout'] != "")) { return true; } return false; @@ -450,12 +450,12 @@ if ($_POST) { } if (isset($a_filter[$id]['associated-rule-id']) === false && - (!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single")))) { + (!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single")))) { $reqdfields[] = "srcmask"; $reqdfieldsn[] = "Source bit count"; } if (isset($a_filter[$id]['associated-rule-id']) === false && - (!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single")))) { + (!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single")))) { $reqdfields[] = "dstmask"; $reqdfieldsn[] = gettext("Destination bit count"); } @@ -493,7 +493,7 @@ if ($_POST) { $input_errors[] = 'The same port alias must be used in Source port range from: and to: fields'; } if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust'] != '')) || - ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust'] != '') && is_alias($_POST['srcendport_cust']))) { + ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust'] != '') && is_alias($_POST['srcendport_cust']))) { $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field'; } } @@ -507,7 +507,7 @@ if ($_POST) { $input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields'; } if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust'] != '')) || - ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust'] != '') && is_alias($_POST['dstendport_cust']))) { + ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust'] != '') && is_alias($_POST['dstendport_cust']))) { $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field'; } } @@ -702,7 +702,7 @@ if ($_POST) { } if ((($_POST['max-src-conn-rate'] <> "" and $_POST['max-src-conn-rates'] == "")) || - (($_POST['max-src-conn-rate'] == "" and $_POST['max-src-conn-rates'] <> ""))) { + (($_POST['max-src-conn-rate'] == "" and $_POST['max-src-conn-rates'] <> ""))) { $input_errors[] = gettext("Both maximum new connections per host and the interval (per second(s)) must be specified"); } @@ -1085,9 +1085,9 @@ $edit_disabled = isset($pconfig['associated-rule-id']); if ($edit_disabled) { $extra = ''; - foreach( $config['nat']['rule'] as $index => $nat_rule ) + foreach ($config['nat']['rule'] as $index => $nat_rule) { - if ($nat_rule['associated-rule-id'] === $pconfig['associated-rule-id'] ) + if ($nat_rule['associated-rule-id'] === $pconfig['associated-rule-id']) $extra = '
'. gettext('View the NAT rule') .''; } @@ -1143,7 +1143,7 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl $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($input = new Form_Select( @@ -1211,7 +1211,7 @@ $section->addInput(new Form_Select( 'carp' => 'CARP', 'pfsync' => 'PFSYNC', ) -))->setHelp('Choose which IP protocol this rule should match. In most cases, you should specify TCP here.'); +))->setHelp('Choose which IP protocol this rule should match. In most cases, you should specify TCP here.'); $section->addInput(new Form_Select( 'icmptype', @@ -1245,8 +1245,8 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { if (is_specialnet($pconfig[$type])) $ruleType = 'network'; elseif ((is_ipaddrv6($pconfig[$type]) && $pconfig[$type.'mask'] == 128) || - (is_ipaddrv4($pconfig[$type]) && $pconfig[$type.'mask'] == 32) || - (is_alias($pconfig[$type]))) + (is_ipaddrv4($pconfig[$type]) && $pconfig[$type.'mask'] == 32) || + (is_alias($pconfig[$type]))) $ruleType = 'single'; $ruleValues = array( @@ -1287,7 +1287,7 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { $section->add($group); - if($type == 'src') { + if ($type == 'src') { $section->addInput(new Form_Button( 'btnsrcadv', 'Show advanced' @@ -1336,14 +1336,14 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { if ($type == 'src') $group->setHelp('Specify the source port or port range for this rule. This is '. 'usually random and almost never equal to the destination port range (and '. - 'should usually be any. You can leave the "To" field '. + 'should usually be any). You can leave the "To" field '. 'empty if you only want to filter a single port.'); else $group->setHelp('Specify the destination port or port range for this rule. ' . 'You can leave the "To" field empty if you only want to filter a '. 'single port.'); - $group->addClass( ($type == 'src') ? 'srcprtr':'dstprtr'); + $group->addClass(($type == 'src') ? 'srcprtr':'dstprtr'); $section->add($group); $form->add($section); } @@ -1669,7 +1669,7 @@ events.push(function(){ // Hides the
in which the specified input element lives so that the input, its label and help text are hidden function hideInput(id, hide) { - if(hide) + if (hide) $('#' + id).parent().parent('div').addClass('hidden'); else $('#' + id).parent().parent('div').removeClass('hidden'); @@ -1678,7 +1678,7 @@ events.push(function(){ // Hides the
in which the specified group input element lives so that the input, // its label and help text are hidden function hideGroupInput(id, hide) { - if(hide) + if (hide) $('#' + id).parent('div').addClass('hidden'); else $('#' + id).parent('div').removeClass('hidden'); @@ -1686,7 +1686,7 @@ events.push(function(){ // Hides the
in which the specified checkbox lives so that the checkbox, its label and help text are hidden function hideCheckbox(id, hide) { - if(hide) + if (hide) $('#' + id).parent().parent().parent('div').addClass('hidden'); else $('#' + id).parent().parent().parent('div').removeClass('hidden'); @@ -1699,7 +1699,7 @@ events.push(function(){ // Hides all elements of the specified class. This will usually be a section function hideClass(s_class, hide) { - if(hide) + if (hide) $('.' + s_class).hide(); else $('.' + s_class).show(); @@ -1707,7 +1707,7 @@ events.push(function(){ // Hides all elements of the specified class assigned to a group. This will usually be a group function hideGroupClass(s_class, hide) { - if(hide) + if (hide) $('.' + s_class).parent().parent().parent().hide(); else $('.' + s_class).parent().parent().parent().show(); @@ -1760,7 +1760,7 @@ events.push(function(){ disableInput('dstbeginport', true); disableInput('dstendport', true); } else { - if( editenabled ) { + if (editenabled) { disableInput('srcbeginport', false); disableInput('srcendport', false); disableInput('dstbeginport', false); @@ -1776,7 +1776,7 @@ events.push(function(){ } function typesel_change() { - if( editenabled ) { + if (editenabled) { switch ($('#srctype').find(":selected").index()) { case 1: // single disableInput('src', false); @@ -1840,11 +1840,11 @@ events.push(function(){ ext_change(); - if($('#proto').find(":selected").index() == 3 || $('#proto').find(":selected").index() == 4) { - if($('#ipprotocol').find(":selected").index() == 0) { // IPv4 + if ($('#proto').find(":selected").index() == 3 || $('#proto').find(":selected").index() == 4) { + if ($('#ipprotocol').find(":selected").index() == 0) { // IPv4 hideInput('icmptype', false); hideInput('icmp6type', true); - } else if($('#ipprotocol').find(":selected").index() == 1) { // IPv6 + } else if ($('#ipprotocol').find(":selected").index() == 1) { // IPv6 hideInput('icmptype', true); hideInput('icmp6type', false); } else { // IPv4 + IPv6 @@ -1856,7 +1856,7 @@ events.push(function(){ hideInput('icmp6type', true); } - if($('#proto').find(":selected").index() >= 0 && $('#proto').find(":selected").index() <= 2) { + if ($('#proto').find(":selected").index() >= 0 && $('#proto').find(":selected").index() <= 2) { hideClass('dstprtr', false); hideClass('srcprtr', false); } else { @@ -1932,12 +1932,12 @@ events.push(function(){ $('#toggle-advanced').click(function() { optionsvisible = 1; hideClass('advanced-options', false); - if($('#tcpflags_any').prop('checked')) + if ($('#tcpflags_any').prop('checked')) $('.table-flags').addClass('hidden'); }); $('#tcpflags_any').click(function () { - if(this.checked) + if (this.checked) $('.table-flags').addClass('hidden'); else $('.table-flags').removeClass('hidden'); @@ -1951,7 +1951,7 @@ events.push(function(){ function setOptText(target, val) { var dispstr = ''; - if(val == 'keep state') + if (val == 'keep state') dispstr += 'Keep: works with all IP protocols'; else if (val == 'sloppy state') dispstr += 'Sloppy: works with all IP protocols'; diff --git a/src/usr/local/www/firewall_schedule.php b/src/usr/local/www/firewall_schedule.php index f3e2062..d52884f 100644 --- a/src/usr/local/www/firewall_schedule.php +++ b/src/usr/local/www/firewall_schedule.php @@ -101,7 +101,7 @@ if ($_GET['act'] == "del") { } if ($is_schedule_referenced == true) { - $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"), $referenced_by); + $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"), $referenced_by); } else { unset($a_schedules[$_GET['id']]); write_config(); @@ -146,7 +146,7 @@ foreach ($a_schedules as $schedule): "; @@ -208,8 +208,8 @@ foreach ($a_schedules as $schedule): $nextDay = ""; $counter = 0; - foreach ($tempFriendlyDayArray as $day){ - if ($day != ""){ + foreach ($tempFriendlyDayArray as $day) { + if ($day != "") { if (!$firstDayFound) { $firstDay = $tempFriendlyDayArray[$counter]; @@ -221,7 +221,7 @@ foreach ($a_schedules as $schedule): $nextDay = $tempFriendlyDayArray[$counter+1]; $currentDay++; - if ($currentDay != $nextDay){ + if ($currentDay != $nextDay) { if ($firstprint) $dayFriendly .= "
"; @@ -269,7 +269,7 @@ endforeach;
- 0) ? gettext(CLOCK . ' Indicates that the scedule is currently active.'):''?> + 0) ? gettext(CLOCK . ' Indicates that the schedule is currently active.'):''?>