diff options
author | Phil Davis <phil.davis@inf.org> | 2016-08-16 14:15:56 +0930 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-08-16 14:15:56 +0930 |
commit | 9d3e8723171c727cf43338bd8e95ab2bb7e6a66c (patch) | |
tree | 0c6bfba9d9404fc5d0adeb954268090ab82f56bc /src | |
parent | 0ed3b15981b4451efb11839d6ee7b9acf1ed1d84 (diff) | |
download | pfsense-9d3e8723171c727cf43338bd8e95ab2bb7e6a66c.zip pfsense-9d3e8723171c727cf43338bd8e95ab2bb7e6a66c.tar.gz |
Code style and comments
No functional change - just making style consistent
Diffstat (limited to 'src')
38 files changed, 133 insertions, 132 deletions
diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc index 8690ee0..bd91d6e 100644 --- a/src/etc/inc/filter_log.inc +++ b/src/etc/inc/filter_log.inc @@ -223,7 +223,7 @@ function parse_vpn_login_log_line($line) { if (!( (trim($flent['time']) == "") && (trim($flent['action']) == "") && (trim($flent['user']) == "") && (trim($flent['ip_address']) == "") )) { return $flent; } else { - if($g['debug']) { + if ($g['debug']) { log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; @@ -245,7 +245,7 @@ function parse_vpn_service_log_line($line) { if (!( (trim($flent['time']) == "") && (trim($flent['type']) == "") && (trim($flent['message']) == "") )) { return $flent; } else { - if($g['debug']) { + if ($g['debug']) { log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 81ce48f..9087ff7 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -707,7 +707,7 @@ function get_filename_from_url($url) { function get_dir($dir) { $dir_array = array(); $d = dir($dir); - if(!is_object($d)) { + if (!is_object($d)) { return array(); } while (false !== ($entry = $d->read())) { diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index b64e290..ffb21af 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4437,7 +4437,7 @@ function upgrade_142_to_143() { if (is_array($config['filter']['separator'])) { foreach ($config['filter']['separator'] as $interface => $separators) { - if(is_array($separators)) { + if (is_array($separators)) { foreach ($separators as $sepn => $separator) { $seprow = substr($separator['row']['0'], 2); diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index c1c9a4f..cef65ab 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -872,7 +872,7 @@ function check_subnetsv4_overlap($subnet1, $bits1, $subnet2, $bits2) { $subnetv4_start1 = gen_subnetv4($subnet1, $largest_sn); $subnetv4_start2 = gen_subnetv4($subnet2, $largest_sn); - if($subnetv4_start1 == '' || $subnetv4_start2 == '') { + if ($subnetv4_start1 == '' || $subnetv4_start2 == '') { // One or both args is not a valid IPv4 subnet //FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed return false; @@ -887,7 +887,7 @@ function check_subnetsv6_overlap($subnet1, $bits1, $subnet2, $bits2) { $subnetv6_start1 = gen_subnetv6($subnet1, $largest_sn); $subnetv6_start2 = gen_subnetv6($subnet2, $largest_sn); - if($subnetv6_start1 == '' || $subnetv6_start2 == '') { + if ($subnetv6_start1 == '' || $subnetv6_start2 == '') { // One or both args is not a valid IPv6 subnet //FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed return false; diff --git a/src/usr/local/www/classes/Form/Button.class.php b/src/usr/local/www/classes/Form/Button.class.php index cf8c0d3..54e619c 100644 --- a/src/usr/local/www/classes/Form/Button.class.php +++ b/src/usr/local/www/classes/Form/Button.class.php @@ -39,11 +39,11 @@ class Form_Button extends Form_Input $this->_tagName = 'a'; $this->addClass('btn-default'); unset($this->_attributes['type']); - if(isset($icon)) { + if (isset($icon)) { $this->_attributes['icon'] = $icon; } } - else if(isset($icon)) + else if (isset($icon)) { $this->_tagSelfClosing = false; $this->_tagName = 'button'; diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php index 80dd248..b4c8e69 100644 --- a/src/usr/local/www/classes/Form/Group.class.php +++ b/src/usr/local/www/classes/Form/Group.class.php @@ -64,7 +64,7 @@ class Form_Group extends Form_Element public function enableDuplication($max = null, $horiz = false) { - if($horiz) + if ($horiz) $this->addClass('user-duplication-horiz'); // added buttons are 2 cols wide with no offset else $this->addClass('user-duplication'); // added buttons 10 cols wide with 2 col offset diff --git a/src/usr/local/www/classes/Form/Input.class.php b/src/usr/local/www/classes/Form/Input.class.php index 1b7da0e..43ec643 100644 --- a/src/usr/local/www/classes/Form/Input.class.php +++ b/src/usr/local/www/classes/Form/Input.class.php @@ -209,7 +209,7 @@ class Form_Input extends Form_Element // These methods required by pkg_edit and the wizards that map xml element definitions to Form elements public function setOnclick($text) { - if($text) + if ($text) $this->_attributes['onclick'] = $text; return $this; @@ -217,7 +217,7 @@ class Form_Input extends Form_Element public function setOnchange($text) { - if($text) + if ($text) $this->_attributes['onchange'] = $text; return $this; diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php index 51ab06a..99e9767 100644 --- a/src/usr/local/www/classes/Form/Section.class.php +++ b/src/usr/local/www/classes/Form/Section.class.php @@ -62,12 +62,12 @@ class Form_Section extends Form_Element } // Shortcut, adds a group with a password and a confirm password field. - // The confirm password element is created by apprnding "_confirm" to the name supplied + // The confirm password element is created by appending "_confirm" to the name supplied // The value is overwritten with a default pattern (So the user cannot see it) public function addPassword(Form_Input $input) { $group = new Form_Group($input->getTitle()); - if($input->getValue() != "") { + if ($input->getValue() != "") { $input->setValue(DMYPWD); } diff --git a/src/usr/local/www/classes/Form/Select.class.php b/src/usr/local/www/classes/Form/Select.class.php index 8f5aa97..649166d 100644 --- a/src/usr/local/www/classes/Form/Select.class.php +++ b/src/usr/local/www/classes/Form/Select.class.php @@ -47,15 +47,15 @@ class Form_Select extends Form_Input $options = ''; foreach ($this->_values as $value => $name) { - // Things can get wierd if we have mixed types + // Things can get weird if we have mixed types $sval = $this->_value; - if( (gettype($value) == "integer") && (gettype($sval) == "string") ) + if ((gettype($value) == "integer") && (gettype($sval) == "string")) $value = strval($value); - if (isset($this->_attributes['multiple'])) + if (isset($this->_attributes['multiple'])) { $selected = in_array($value, (array)$sval); - else { + } else { $selected = ($sval == $value); } diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php index 32a99ec..26c45c9 100644 --- a/src/usr/local/www/diag_dns.php +++ b/src/usr/local/www/diag_dns.php @@ -55,7 +55,7 @@ function resolve_host_addresses($host) { $resolved = array(); $errreporting = error_reporting(); error_reporting($errreporting & ~E_WARNING);// dns_get_record throws a warning if nothing is resolved.. - foreach($recordtypes as $recordtype) { + foreach ($recordtypes as $recordtype) { $tmp = dns_get_record($host, $recordtype); if (is_array($tmp)) { $dnsresult = array_merge($dnsresult, $tmp); @@ -63,7 +63,7 @@ function resolve_host_addresses($host) { } error_reporting($errreporting);// restore original php warning/error settings. - foreach($dnsresult as $item) { + foreach ($dnsresult as $item) { $newitem = array(); $newitem['type'] = $item['type']; switch ($item['type']) { diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php index ca1c9a8..1655a0c 100644 --- a/src/usr/local/www/diag_edit.php +++ b/src/usr/local/www/diag_edit.php @@ -156,8 +156,8 @@ print_callout(gettext("The capabilities offered here can be dangerous. No suppor // calculate start/end var startPos = 0, endPos = tarea.value.length; - for(var x = 0; x < lines.length; x++) { - if(x == lineNum) { + for (var x = 0; x < lines.length; x++) { + if (x == lineNum) { break; } startPos += (lines[x].length+1); @@ -169,7 +169,7 @@ print_callout(gettext("The capabilities offered here can be dangerous. No suppor // do selection // Chrome / Firefox - if(typeof(tarea.selectionStart) != "undefined") { + if (typeof(tarea.selectionStart) != "undefined") { tarea.focus(); tarea.selectionStart = startPos; tarea.selectionEnd = endPos; diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php index ac20455..8bd2d89 100644 --- a/src/usr/local/www/firewall_virtual_ip_edit.php +++ b/src/usr/local/www/firewall_virtual_ip_edit.php @@ -433,7 +433,7 @@ $section->addInput(new Form_Input( $pconfig['descr'] ))->setHelp('A description may be entered here for administrative reference (not parsed).'); -if (isset($id) && $a_vip[$id]){ +if (isset($id) && $a_vip[$id]) { $section->addInput(new Form_Input( 'id', null, diff --git a/src/usr/local/www/js/pfSense.js b/src/usr/local/www/js/pfSense.js index 05b9b54..2098dbe 100644 --- a/src/usr/local/www/js/pfSense.js +++ b/src/usr/local/www/js/pfSense.js @@ -143,10 +143,10 @@ $(function() { // Use element title in the confirmation message, or if not available // the element value $('.btn-danger, .fa-trash').on('click', function(e){ - if(!($(this).hasClass('no-confirm'))) { + if (!($(this).hasClass('no-confirm'))) { var msg = $.trim(this.textContent); - if(!msg) + if (!msg) var msg = $.trim(this.value).toLowerCase(); var q = 'Are you sure you wish to '+ msg +'?'; @@ -201,7 +201,7 @@ $(function() { originalLeave.call(this, obj); - if(self.$tip && self.$tip.length) { + if (self.$tip && self.$tip.length) { container = self.$tip; timeout = self.timeout; container.one('mouseenter', function(){ diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js index c2b8aed..25a7e62 100644 --- a/src/usr/local/www/js/pfSenseHelpers.js +++ b/src/usr/local/www/js/pfSenseHelpers.js @@ -109,7 +109,7 @@ function hideLabel(text, hide) { // Hides the '/' and the subnet mask of an Ip_Address/subnet_mask group function hideMask(name, hide) { - if(hide) { + if (hide) { $('[id^=' + name + ']').hide(); $('[id^=' + name + ']').prev('span').hide(); $('[id^=' + name + ']').parent('div').removeClass('input-group'); diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php index 3d5ec32..e1b55b5 100644 --- a/src/usr/local/www/pkg_mgr_install.php +++ b/src/usr/local/www/pkg_mgr_install.php @@ -568,7 +568,7 @@ function get_firmware_versions() json = jQuery.parseJSON(response); - if(json) { + if (json) { $('#installed_version').text(json.installed_version); $('#version').text(json.version); diff --git a/src/usr/local/www/services_dhcpv6_edit.php b/src/usr/local/www/services_dhcpv6_edit.php index 3c46f53..8dde1f9 100644 --- a/src/usr/local/www/services_dhcpv6_edit.php +++ b/src/usr/local/www/services_dhcpv6_edit.php @@ -243,7 +243,7 @@ $section->addInput(new Form_Input( $pconfig['descr'] ))->setHelp('A description may be entered here for administrative reference (not parsed).'); -if($netboot_enabled) { +if ($netboot_enabled) { $section->addInput(new Form_Input( 'filename', 'Netboot filename', diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php index 410f8b1..e2df3e4 100644 --- a/src/usr/local/www/services_router_advertisements.php +++ b/src/usr/local/www/services_router_advertisements.php @@ -316,8 +316,8 @@ $carplist = get_configured_vip_list("inet6", VIP_CARP); $carplistif = array(); -if(count($carplist) > 0) { - foreach($carplist as $ifname => $vip) { +if (count($carplist) > 0) { + foreach ($carplist as $ifname => $vip) { if (get_configured_vip_interface($ifname) == $if) { $carplistif[$ifname] = $vip; } @@ -328,7 +328,7 @@ if (count($carplistif) > 0) { $iflist = array(); $iflist['interface'] = strtoupper($if); - foreach($carplistif as $ifname => $vip) { + foreach ($carplistif as $ifname => $vip) { $iflist[$ifname] = get_vip_descr($vip) . " - " . $vip; } diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php index 2d46a7e..21d7074 100644 --- a/src/usr/local/www/status_logs_filter_dynamic.php +++ b/src/usr/local/www/status_logs_filter_dynamic.php @@ -294,7 +294,7 @@ function update_table_rows(data) { move = 0; } - if (($("#count").text() == 0) && (data.length < nentries)){ + if (($("#count").text() == 0) && (data.length < nentries)) { move += rows.length; } @@ -445,7 +445,7 @@ function toggleListDescriptions() { <td><?=htmlspecialchars($filterent['proto'])?></td> </tr> <?php - } // e-o-foreach() + } // e-o-foreach () if (count($filterlog) == 0) { print '<tr class="text-nowrap"><td colspan=6>'; diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php index 12087d0..cb58a02 100644 --- a/src/usr/local/www/system_advanced_misc.php +++ b/src/usr/local/www/system_advanced_misc.php @@ -115,7 +115,7 @@ if ($_POST) { $input_errors[] = gettext("The proxy username contains invalid characters."); } - if($_POST['proxypass'] != $_POST['proxypass_confirm']) { + if ($_POST['proxypass'] != $_POST['proxypass_confirm']) { $input_errors[] = gettext("Proxy password and confirmation must match."); } diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index b1f64e8..171b3cc 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -394,7 +394,7 @@ if ($_POST) { } // On error, restore the form contents so the user doesn't have to re-enter too much -if($_POST && $input_errors) { +if ($_POST && $input_errors) { $pconfig = $_POST; $pconfig['ldap_authcn'] = $_POST['ldapauthcontainers']; $pconfig['ldap_template'] = $_POST['ldap_tmpltype']; @@ -439,7 +439,7 @@ if (!($act == "new" || $act == "edit" || $input_errors)) { </tr> </thead> <tbody> - <?php foreach($a_server as $i => $server): ?> + <?php foreach ($a_server as $i => $server): ?> <tr> <td><?=htmlspecialchars($server['name'])?></td> <td><?=htmlspecialchars($auth_server_types[$server['type']])?></td> @@ -651,7 +651,7 @@ $section->add($group); if (!isset($id)) { $template_list = array(); - foreach($ldap_templates as $option => $template) { + foreach ($ldap_templates as $option => $template) { $template_list[$option] = $template['desc']; } @@ -880,7 +880,7 @@ events.push(function() { } function set_ldap_port() { - if($('#ldap_urltype').find(":selected").index() == 0) + if ($('#ldap_urltype').find(":selected").index() == 0) $('#ldap_port').val('389'); else $('#ldap_port').val('636'); @@ -888,7 +888,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(); @@ -921,18 +921,18 @@ events.push(function() { hideClass('ldapanon', $('#ldap_anon').prop('checked')); hideClass('extended', !$('#ldap_extended_enabled').prop('checked')); - if($('#ldap_port').val() == "") + if ($('#ldap_port').val() == "") set_ldap_port(); <?php - if($act == 'edit') { + if ($act == 'edit') { ?> $('#type option:not(:selected)').each(function(){ $(this).attr('disabled', 'disabled'); }); <?php - if(!$input_errors) { + if (!$input_errors) { ?> $('#name').prop("readonly", true); <?php diff --git a/src/usr/local/www/system_crlmanager.php b/src/usr/local/www/system_crlmanager.php index 7000705..efb79f5 100644 --- a/src/usr/local/www/system_crlmanager.php +++ b/src/usr/local/www/system_crlmanager.php @@ -315,7 +315,7 @@ function build_cacert_list() { $list = array(); - foreach($ca_certs as $cert) { + foreach ($ca_certs as $cert) { $list[$cert['refid']] = $cert['descr']; } diff --git a/src/usr/local/www/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php index 8a0c9b8..858205b 100644 --- a/src/usr/local/www/system_gateway_groups_edit.php +++ b/src/usr/local/www/system_gateway_groups_edit.php @@ -339,7 +339,7 @@ $section->addInput(new Form_Input( $pconfig['descr'] ))->setHelp('A description may be entered here for administrative reference (not parsed).'); -if (isset($id) && $a_gateway_groups[$id]){ +if (isset($id) && $a_gateway_groups[$id]) { $section->addInput(new Form_Input( 'id', null, diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php index 74f781b..072a5d1 100644 --- a/src/usr/local/www/system_groupmanager.php +++ b/src/usr/local/www/system_groupmanager.php @@ -160,7 +160,7 @@ if (isset($_POST['save'])) { } /* Check the POSTed members to ensure they are valid and exist */ - if(is_array($_POST['members'])) { + if (is_array($_POST['members'])) { foreach ($_POST['members'] as $newmember) { if (!is_numeric($newmember) || empty(getUserEntryByUID($newmember))) { $input_errors[] = gettext("One or more invalid group members was submitted."); @@ -353,7 +353,7 @@ $form->addGlobal(new Form_Input( $id )); -if (isset($id) && $a_group[$id]){ +if (isset($id) && $a_group[$id]) { $form->addGlobal(new Form_Input( 'id', null, diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php index 925e283..07faab5 100644 --- a/src/usr/local/www/system_groupmanager_addprivs.php +++ b/src/usr/local/www/system_groupmanager_addprivs.php @@ -268,7 +268,7 @@ events.push(function() { }); $('#filtertxt').keypress(function(e) { - if(e.which == 13) { + if (e.which == 13) { e.preventDefault(); $('#btnfilter').trigger('click'); } diff --git a/src/usr/local/www/system_update_settings.php b/src/usr/local/www/system_update_settings.php index 91237f0..85ba61e 100644 --- a/src/usr/local/www/system_update_settings.php +++ b/src/usr/local/www/system_update_settings.php @@ -154,6 +154,7 @@ if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) { 'synconupgrade', 'Auto sync on update', 'Enable repository/branch sync before reboot', + 'Enable repository/branch sync before reboot', isset($gitcfg['synconupgrade']) ))->setHelp('After updating, sync with the following repository/branch before reboot.'); @@ -195,7 +196,7 @@ if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) { '<br />Note: Sync will not be performed if a branch is not specified.', [$lastbranch]); $form->add($section); -} // e-o-if(file_exista() +} // e-o-if (file_exists()) print($form); diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index 1b8fc33..80265b1 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -215,7 +215,7 @@ if ($_POST['save']) { } /* Check the POSTed groups to ensure they are valid and exist */ - if(is_array($_POST['groups'])) { + if (is_array($_POST['groups'])) { foreach ($_POST['groups'] as $newgroup) { if (empty(getGroupEntry($newgroup))) { $input_errors[] = gettext("One or more invalid groups was submitted."); @@ -852,7 +852,7 @@ if ($act == "new" || $act == "edit" || $input_errors): $section->addClass('cert-options'); $nonPrvCas = array(); - foreach($config['ca'] as $ca) { + foreach ($config['ca'] as $ca) { if (!$ca['prv']) { continue; } diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php index a98ca94..fe29e5f 100644 --- a/src/usr/local/www/system_usermanager_addprivs.php +++ b/src/usr/local/www/system_usermanager_addprivs.php @@ -272,7 +272,7 @@ events.push(function() { }); $('#filtertxt').keypress(function(e) { - if(e.which == 13) { + if (e.which == 13) { e.preventDefault(); $('#btnfilter').trigger('click'); } diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php index 4f0653b..94f8011 100644 --- a/src/usr/local/www/vpn_openvpn_server.php +++ b/src/usr/local/www/vpn_openvpn_server.php @@ -1227,7 +1227,7 @@ endif; events.push(function() { function advanced_change(hide, mode) { - if(!hide) { + if (!hide) { hideClass('advanced', false); hideClass("clientadv", false); } else if (mode == "p2p_tls") { diff --git a/src/usr/local/www/widgets/javascript/thermal_sensors.js b/src/usr/local/www/widgets/javascript/thermal_sensors.js index 83aac7d..bbb7e9a 100644 --- a/src/usr/local/www/widgets/javascript/thermal_sensors.js +++ b/src/usr/local/www/widgets/javascript/thermal_sensors.js @@ -24,7 +24,7 @@ ajaxBusy = false; //should be called from "thermal_sensors.widget.php" function showThermalSensorsData() { - if(!ajaxBusy) { + if (!ajaxBusy) { ajaxBusy = true; //get data from thermal_sensors.widget.php url = "/widgets/widgets/thermal_sensors.widget.php?getThermalSensorsData=1" @@ -54,7 +54,7 @@ function buildThermalSensorsData(thermalSensorsData) { if (thermal_sensors_widget_showRawOutput) { buildThermalSensorsDataRaw(thermalSensorsData); } else { - if(warningTemp == 9999) { + if (warningTemp == 9999) { buildThermalSensorsDataGraph(thermalSensorsData); } @@ -192,11 +192,11 @@ function getThermalSensorValue(stringValue) { function setTempProgress(bar, percent) { var barTempL, barTempM, barTempH; - if(percent <= warningTemp) { + if (percent <= warningTemp) { barTempL = percent; barTempM = 0; barTempH = 0; - } else if(percent <= criticalTemp) { + } else if (percent <= criticalTemp) { barTempL = warningTemp; barTempM = percent - warningTemp; barTempH = 0; diff --git a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php index 2eed5c4..6c3380b 100644 --- a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php +++ b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php @@ -35,7 +35,7 @@ require_once("gmirror.inc"); <script type="text/javascript"> //<![CDATA[ -function gmirrorStatusUpdateFromServer(){ +function gmirrorStatusUpdateFromServer() { $.ajax({ type: 'get', url: '/widgets/widgets/gmirror_status.widget.php', diff --git a/src/usr/local/www/widgets/widgets/log.widget.php b/src/usr/local/www/widgets/widgets/log.widget.php index 7312f08..fab878f 100644 --- a/src/usr/local/www/widgets/widgets/log.widget.php +++ b/src/usr/local/www/widgets/widgets/log.widget.php @@ -175,7 +175,7 @@ if (isset($_GET['lastsawtime'])) { <script type="text/javascript"> //<![CDATA[ -function logWidgetUpdateFromServer(){ +function logWidgetUpdateFromServer() { $.ajax({ type: 'get', url: '/widgets/widgets/log.widget.php', diff --git a/src/usr/local/www/widgets/widgets/ntp_status.widget.php b/src/usr/local/www/widgets/widgets/ntp_status.widget.php index 7f283bc..c0d8384 100644 --- a/src/usr/local/www/widgets/widgets/ntp_status.widget.php +++ b/src/usr/local/www/widgets/widgets/ntp_status.widget.php @@ -191,7 +191,7 @@ if ($_REQUEST['updateme']) { ?> <script type="text/javascript"> //<![CDATA[ -function ntpWidgetUpdateFromServer(){ +function ntpWidgetUpdateFromServer() { $.ajax({ type: 'get', url: '/widgets/widgets/ntp_status.widget.php', @@ -207,7 +207,7 @@ function ntpWidgetUpdateFromServer(){ }); } -function ntpWidgetUpdateDisplay(){ +function ntpWidgetUpdateDisplay() { // Javascript handles overflowing ntpServerTime.setSeconds(ntpServerTime.getSeconds()+1); diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php index 15ed36b..1512e85 100644 --- a/src/usr/local/www/widgets/widgets/system_information.widget.php +++ b/src/usr/local/www/widgets/widgets/system_information.widget.php @@ -166,7 +166,7 @@ $filesystems = get_mounted_filesystems(); <ul style="margin-bottom:0px"> <?php $dns_servers = get_dns_servers(); - foreach($dns_servers as $dns) { + foreach ($dns_servers as $dns) { echo "<li>{$dns}</li>"; } ?> @@ -338,7 +338,7 @@ function setTimer() { function stats(x) { var values = x.split("|"); - if ($.each(values,function(key,value){ + if ($.each(values,function(key,value) { if (value == 'undefined' || value == null) return true; else @@ -470,7 +470,7 @@ function updateInterfaces(x) { } else { ipv4_details = details[2] + '<br />'; } - switch(details[1]) { + switch (details[1]) { case "up": $('#' + details[0] + '-up').css("display","inline"); $('#' + details[0] + '-down').css("display","none"); diff --git a/src/usr/local/www/wizard.php b/src/usr/local/www/wizard.php index e4a4561..4f4a969 100644 --- a/src/usr/local/www/wizard.php +++ b/src/usr/local/www/wizard.php @@ -851,8 +851,8 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") { break; } // e-o-switch - } // e-o-foreach(package) -} // e-o- if(we have fields) + } // e-o-foreach (package) +} // e-o-if (we have fields) $form->add($section); print($form); diff --git a/src/usr/local/www/wizards/openvpn_wizard.inc b/src/usr/local/www/wizards/openvpn_wizard.inc index fcd84be..d9d9235 100644 --- a/src/usr/local/www/wizards/openvpn_wizard.inc +++ b/src/usr/local/www/wizards/openvpn_wizard.inc @@ -184,7 +184,7 @@ function step7_submitphpaction() { $canames = array(); $cacns = array(); if (is_array($config['ca'])) { - foreach($config['ca'] as $ca) { + foreach ($config['ca'] as $ca) { $canames[] = $ca['descr']; $cainfo = cert_get_subject_hash($ca['crt']); $cacns[] = $cainfo["CN"]; @@ -287,7 +287,7 @@ function step9_submitphpaction() { $certnames = array(); $certcns = array(); if (is_array($config['cert'])) { - foreach($config['cert'] as $cert) { + foreach ($config['cert'] as $cert) { $certnames[] = $cert['descr']; $certinfo = cert_get_subject_hash($cert['crt']); $certcns[] = $certinfo["CN"]; diff --git a/src/usr/local/www/wizards/setup_wizard.xml b/src/usr/local/www/wizards/setup_wizard.xml index cec7fc2..9380d07 100644 --- a/src/usr/local/www/wizards/setup_wizard.xml +++ b/src/usr/local/www/wizards/setup_wizard.xml @@ -116,28 +116,28 @@ </stepbeforeformdisplay> <stepsubmitphpaction> <![CDATA[ - if(empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) { + if (empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) { include("head.inc"); $input_errors[] = "Hostname is invalid. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(empty($_POST['domain']) || !is_domain($_POST['domain'])) { + if (empty($_POST['domain']) || !is_domain($_POST['domain'])) { include("head.inc"); $input_errors[] = "Domain is invalid. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) { + if (!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) { include("head.inc"); $input_errors[] = "Primary DNS server is invalid. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) { + if (!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) { include("head.inc"); $input_errors[] = "Second DNS server is invalid. Please press back in the browser window and correct."; print_input_errors($input_errors); @@ -188,16 +188,16 @@ <description>On this screen the Wide Area Network information will be configured.</description> <javascriptafterformdisplay> var selectedItem = 0; - if(document.forms[0].ipaddress.value == 'dhcp') { + if (document.forms[0].ipaddress.value == 'dhcp') { selectedItem = 1; document.forms[0].ipaddress.value = ''; - } else if(document.forms[0].ipaddress.value == 'pppoe') { + } else if (document.forms[0].ipaddress.value == 'pppoe') { selectedItem = 2; document.forms[0].ipaddress.value = ''; - } else if(document.forms[0].ipaddress.value == 'pptp') { + } else if (document.forms[0].ipaddress.value == 'pptp') { selectedItem = 3; document.forms[0].ipaddress.value = ''; - } else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') { + } else if (document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') { document.forms[0].ipaddress.value = ''; } else { selectedItem = 0; @@ -207,7 +207,7 @@ events.push(function(){ $('#showpppoepassword').click(function(event) { - if(this.checked) { + if (this.checked) { $('#pppoepassword').attr('type', 'text'); } else { $('#pppoepassword').attr('type', 'password'); @@ -215,7 +215,7 @@ }); $('#showpptppassword').click(function(event) { - if(this.checked) { + if (this.checked) { $('#pptppassword').attr('type', 'text'); } else { $('#pptppassword').attr('type', 'password'); @@ -456,21 +456,21 @@ </stepbeforeformdisplay> <stepsubmitphpaction> <![CDATA[ - if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) { + if (!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) { include("head.inc"); $input_errors[] = "MTU Must be at least 576 (Per RFC 791). Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) { + if (!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) { include("head.inc"); $input_errors[] = "Invalid MAC Address. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) { + if (!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) { if (!is_ipaddr($_POST['ipaddress'])) { include("head.inc"); $input_errors[] = "Invalid WAN IP Address. Please press back in the browser window and correct."; @@ -488,21 +488,21 @@ die; } } - if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) { + if (!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) { include("head.inc"); $input_errors[] = "Invalid DHCP Hostname. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) { + if (!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) { include("head.inc"); $input_errors[] = "Invalid PPTP Local IP Address. Please press back in the browser window and correct."; print_input_errors($input_errors); include("foot.inc"); die; } - if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) { + if (!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) { include("head.inc"); $input_errors[] = "Invalid PPTP Remote IP Address. Please press back in the browser window and correct."; print_input_errors($input_errors); @@ -552,14 +552,14 @@ </stepsubmitphpaction> <stepsubmitbeforesave> <![CDATA[ - if($_POST['selectedtype'] == "Static") { + if ($_POST['selectedtype'] == "Static") { } else { $_POST['ipaddress'] = $_POST['selectedtype']; $config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype']; write_config(); } - if(!$config['interfaces']['lan']) { + if (!$config['interfaces']['lan']) { header("Location: /wizard.php?xml=setup_wizard.xml&stepid=6&next=Next"); } ]]> @@ -590,7 +590,7 @@ </fields> <stepsubmitphpaction> <![CDATA[ - if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) { + if (empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) { print_info_box("Invalid LAN IP address. Please press back in the browser window and correct."); die; } @@ -672,8 +672,8 @@ </fields> <stepsubmitphpaction> <![CDATA[ - if($_POST['adminpassword'] != "") { - if($_POST['adminpassword'] == $_POST['adminpasswordagain']) { + if ($_POST['adminpassword'] != "") { + if ($_POST['adminpassword'] == $_POST['adminpasswordagain']) { $admin_user =& getUserEntryByUID(0); local_user_set_password($admin_user, $_POST['adminpassword']); local_user_set($admin_user); @@ -751,7 +751,7 @@ <title>Wizard completed.</title> <stepbeforeformdisplay> <![CDATA[ - if($g['product_name'] <> 'pfSense') { + if ($g['product_name'] <> 'pfSense') { header("Location: " . fixup_string("\$myurl")); exit; } diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc index 0e228d0..40ec18a 100644 --- a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc +++ b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc @@ -475,8 +475,8 @@ function step3_stepsubmitphpaction() { if (!$_POST['enable']) return; - if($_POST['upstream_sip_server']) { - if(!is_ipaddroralias($_POST['upstream_sip_server'])) { + if ($_POST['upstream_sip_server']) { + if (!is_ipaddroralias($_POST['upstream_sip_server'])) { /* item is not an ip or alias. error out */ $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); $stepid--; @@ -558,12 +558,12 @@ function step4_stepsubmitphpaction() { global $stepid, $savemsg; if ( $_POST['enable'] ) { - if(!$_POST['bandwidth']) { + if (!$_POST['bandwidth']) { $savemsg="A value for bandwidth must be specified."; $stepid--; return; } - if(!is_numeric($_POST['bandwidth'])) { + if (!is_numeric($_POST['bandwidth'])) { $savemsg="The posted value is not a valid bandwidth."; $stepid--; return; @@ -575,12 +575,12 @@ function step4_stepsubmitphpaction() { return; } $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { + if ($bw > 15 || $bw < 2) { $savemsg="Values should be between 2% and 15%!"; $stepid--; return; } - if($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) { + if ($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) { /* item is not an ip or alias. error out */ $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); $stepid--; @@ -593,7 +593,7 @@ function step5_stepsubmitphpaction() { if ( $_POST['enable'] ) { if ($_POST['p2pcatchall']) { - if(!is_numeric($_POST['bandwidth'])) { + if (!is_numeric($_POST['bandwidth'])) { $savemsg="Posted value is not a valid bandwidth."; $stepid--; return; @@ -604,7 +604,7 @@ function step5_stepsubmitphpaction() { return; } $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { + if ($bw > 15 || $bw < 2) { $savemsg="Values should be between 2% and 15%!"; $stepid--; return; @@ -645,10 +645,10 @@ function apply_all_chosen_items() { * Doing it here makes sense since we can wipe the previous config only after * the user decides to do so, finishing the wizard. */ - if(isset($config['shaper']['queue'])) + if (isset($config['shaper']['queue'])) unset($config['shaper']['queue']); /* XXX: This is redundant, because this should be handled by converter at startup. */ - if(isset($config['shaper']['rule'])) + if (isset($config['shaper']['rule'])) unset($config['shaper']['rule']); foreach ($config['filter']['rule'] as $key => $rule) if ($rule['wizard'] == "yes") @@ -1438,7 +1438,7 @@ function apply_all_chosen_items() { /* Rules */ if ($penalty) { - if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { + if ( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { $rule = array(); $rule['type'] = "match"; $rule['interface'] = $interfacelist; @@ -1456,7 +1456,7 @@ function apply_all_chosen_items() { /* If user specifies an IP, we don't bother with providers */ if ($voip) { - if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { + if (is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { /* create VOIP rules */ $rule = array(); $rule['type'] = "match"; @@ -1486,7 +1486,7 @@ function apply_all_chosen_items() { $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; - } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) { + } elseif ( $config['ezshaper']['step3']['provider'] == "Generic" ) { /* create VOIP rules */ $rule = array(); $rule['type'] = "match"; @@ -1517,7 +1517,7 @@ function apply_all_chosen_items() { $rule['wizard'] = "yes"; $rule['enabled'] = "on"; $rule['destination']['port'] = $voip[2]."-".$voip[3]; - if($voip[1] != '') + if ($voip[1] != '') $rule['protocol'] = $voip[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; @@ -1527,7 +1527,7 @@ function apply_all_chosen_items() { /* loop through p2plist[] */ if ($p2p) { - foreach($config['ezshaper']['step5'] as $key => $val) { + foreach ($config['ezshaper']['step5'] as $key => $val) { if (!is_array($p2plist[$key])) continue; foreach ($p2plist[$key] as $p2pclient) { @@ -1541,7 +1541,7 @@ function apply_all_chosen_items() { $rule['floating'] = "yes"; $rule['wizard'] = "yes"; $rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3]; - if($p2pclient[1] != '') + if ($p2pclient[1] != '') $rule['protocol'] = $p2pclient[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; @@ -1551,7 +1551,7 @@ function apply_all_chosen_items() { /* loop through gamesplist[] */ if ($games) { - foreach($config['ezshaper']['step6'] as $key => $val) { + foreach ($config['ezshaper']['step6'] as $key => $val) { if (!is_array($gamesplist[$key])) continue; foreach ($gamesplist[$key] as $Gameclient) { @@ -1568,7 +1568,7 @@ function apply_all_chosen_items() { $rule['enabled'] = "on"; $rule['descr'] = "m_Game {$Gameclient[0]} outbound"; $rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3]; - if($Gameclient[1] != '') + if ($Gameclient[1] != '') $rule['protocol'] = $Gameclient[1]; $config['filter']['rule'][] = $rule; } @@ -1577,7 +1577,7 @@ function apply_all_chosen_items() { /* loop through othersplist[] */ if ($otherpriority) { - foreach($config['ezshaper']['step7'] as $key => $val) { + foreach ($config['ezshaper']['step7'] as $key => $val) { if (!is_array($othersplist[$key])) continue; foreach ($othersplist[$key] as $otherclient) { @@ -1617,10 +1617,10 @@ function apply_all_chosen_items() { $rule['enabled'] = "on"; $rule['descr'] = "m_Other {$otherclient[0]} outbound"; - if($otherclient[2] or $otherclient[3]) { + if ($otherclient[2] or $otherclient[3]) { $rule['destination']['port'] = $otherclient[2]."-".$otherclient[3]; } - if($otherclient[1] != '') + if ($otherclient[1] != '') $rule['protocol'] = $otherclient[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index 55ee31a..99a014b 100644 --- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -529,8 +529,8 @@ function step3_stepsubmitphpaction() { if (!$_POST['enable']) return; - if($_POST['upstream_sip_server']) { - if(!is_ipaddroralias($_POST['upstream_sip_server'])) { + if ($_POST['upstream_sip_server']) { + if (!is_ipaddroralias($_POST['upstream_sip_server'])) { /* item is not an ip or alias. error out */ $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); $stepid--; @@ -626,13 +626,13 @@ function step4_stepsubmitphpaction() { global $stepid, $savemsg; if ( $_POST['enable'] ) { - if(!$_POST['bandwidth']) { + if (!$_POST['bandwidth']) { $savemsg="A value for bandwidth must be specified."; $stepid--; return; } - if(!is_numeric($_POST['bandwidth'])) { + if (!is_numeric($_POST['bandwidth'])) { $savemsg="The posted value is not a valid bandwidth."; $stepid--; return; @@ -643,12 +643,12 @@ function step4_stepsubmitphpaction() { return; } $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { + if ($bw > 15 || $bw < 2) { $savemsg="Values should be between 2% and 15%!"; $stepid--; return; } - if($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) { + if ($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) { /* item is not an ip or alias. error out */ $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); $stepid--; @@ -660,7 +660,7 @@ function step5_stepsubmitphpaction() { global $stepid, $savemsg; if ( $_POST['enable'] ) { if ($_POST['p2pcatchall']) { - if(!is_numeric($_POST['bandwidth'])) { + if (!is_numeric($_POST['bandwidth'])) { $savemsg="Posted value is not a valid bandwidth."; $stepid--; } @@ -670,7 +670,7 @@ function step5_stepsubmitphpaction() { return; } $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { + if ($bw > 15 || $bw < 2) { $savemsg="Values should be between 2% and 15%!"; $stepid--; return; @@ -711,10 +711,10 @@ function apply_all_chosen_items() { * Doing it here makes sense since we can wipe the previous config only after * the user decides to do so, finishing the wizard. */ - if(isset($config['shaper']['queue'])) + if (isset($config['shaper']['queue'])) unset($config['shaper']['queue']); /* XXX: This is redundant, because this should be handled by converter at startup. */ - if(isset($config['shaper']['rule'])) + if (isset($config['shaper']['rule'])) unset($config['shaper']['rule']); foreach ($config['filter']['rule'] as $key => $rule) if ($rule['wizard'] == "yes") @@ -1526,7 +1526,7 @@ function apply_all_chosen_items() { /* Rules */ if ($penalty) { - if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { + if (is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { $rule = array(); $rule['type'] = "match"; $rule['interface'] = $interfacelist; @@ -1545,7 +1545,7 @@ function apply_all_chosen_items() { /* If user specifies an IP, we don't bother with providers */ if ($voip) { - if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { + if (is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { /* create VOIP rules */ $rule = array(); $rule['type'] = "match"; @@ -1575,7 +1575,7 @@ function apply_all_chosen_items() { $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; - } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) { + } elseif ($config['ezshaper']['step3']['provider'] == "Generic") { /* create VOIP rules */ $rule = array(); $rule['type'] = "match"; @@ -1606,7 +1606,7 @@ function apply_all_chosen_items() { $rule['wizard'] = "yes"; $rule['enabled'] = "on"; $rule['destination']['port'] = $voip[2]."-".$voip[3]; - if($voip[1] != '') + if ($voip[1] != '') $rule['protocol'] = $voip[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; @@ -1616,7 +1616,7 @@ function apply_all_chosen_items() { /* loop through p2plist[] */ if ($p2p) { - foreach($config['ezshaper']['step5'] as $key => $val) { + foreach ($config['ezshaper']['step5'] as $key => $val) { if (!is_array($p2plist[$key])) continue; foreach ($p2plist[$key] as $p2pclient) { @@ -1630,7 +1630,7 @@ function apply_all_chosen_items() { $rule['floating'] = "yes"; $rule['wizard'] = "yes"; $rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3]; - if($p2pclient[1] != '') + if ($p2pclient[1] != '') $rule['protocol'] = $p2pclient[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; @@ -1640,7 +1640,7 @@ function apply_all_chosen_items() { /* loop through gamesplist[] */ if ($games) { - foreach($config['ezshaper']['step6'] as $key => $val) { + foreach ($config['ezshaper']['step6'] as $key => $val) { if (!is_array($gamesplist[$key])) continue; foreach ($gamesplist[$key] as $Gameclient) { @@ -1657,7 +1657,7 @@ function apply_all_chosen_items() { $rule['enabled'] = "on"; $rule['descr'] = "m_Game {$Gameclient[0]} outbound"; $rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3]; - if($Gameclient[1] != '') + if ($Gameclient[1] != '') $rule['protocol'] = $Gameclient[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; @@ -1667,7 +1667,7 @@ function apply_all_chosen_items() { /* loop through othersplist[] */ if ($otherpriority) { - foreach($config['ezshaper']['step7'] as $key => $val) { + foreach ($config['ezshaper']['step7'] as $key => $val) { if (!is_array($othersplist[$key])) continue; foreach ($othersplist[$key] as $otherclient) { @@ -1707,10 +1707,10 @@ function apply_all_chosen_items() { $rule['enabled'] = "on"; $rule['descr'] = "m_Other {$otherclient[0]} outbound"; - if($otherclient[2] or $otherclient[3]) { + if ($otherclient[2] or $otherclient[3]) { $rule['destination']['port'] = $otherclient[2]."-".$otherclient[3]; } - if($otherclient[1] != '') + if ($otherclient[1] != '') $rule['protocol'] = $otherclient[1]; $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); $config['filter']['rule'][] = $rule; |