diff options
author | Phil Davis <phil.davis@inf.org> | 2015-12-10 17:01:11 +0545 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-10 10:09:30 -0500 |
commit | 4e322e2c189e18133324c933ad35f0735fab510f (patch) | |
tree | 91cb8c627c8efbe69ceb7e7dc41635d6a144e12e | |
parent | b3b10d30794a60ed9a781cc3c8e0d29b774bf86e (diff) | |
download | pfsense-4e322e2c189e18133324c933ad35f0735fab510f.zip pfsense-4e322e2c189e18133324c933ad35f0735fab510f.tar.gz |
Code style and white space in etc
29 files changed, 131 insertions, 100 deletions
diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index 92b9705..fffe84f 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -165,7 +165,7 @@ if (function_exists("display_error_form") && !isset($config['system']['webgui'][ $referrer_host = str_replace(array("[", "]"), "", $referrer_host); if ($referrer_host) { if (strcasecmp($referrer_host, $config['system']['hostname'] . "." . $config['system']['domain']) == 0 || - strcasecmp($referrer_host, $config['system']['hostname']) == 0) { + strcasecmp($referrer_host, $config['system']['hostname']) == 0) { $found_host = true; } @@ -1126,11 +1126,11 @@ function ldap_get_groups($username, $authcfg) { $gresults = isset($authcfg['ldap_rfc2307']) ? $info : $info[0][$ldapgroupattribute]; - if(is_array($gresults)) { + if (is_array($gresults)) { /* Iterate through the groups and throw them into an array */ foreach ($gresults as $grp) { - if (((isset($authcfg['ldap_rfc2307'])) && (stristr($grp["dn"], "CN=") !== false)) - || ((!isset($authcfg['ldap_rfc2307'])) && (stristr($grp, "CN=") !== false))) { + if (((isset($authcfg['ldap_rfc2307'])) && (stristr($grp["dn"], "CN=") !== false)) || + ((!isset($authcfg['ldap_rfc2307'])) && (stristr($grp, "CN=") !== false))) { $grpsplit = isset($authcfg['ldap_rfc2307']) ? explode(",", $grp["dn"]) : explode(",", $grp); $memberof[] = preg_replace("/CN=/i", "", $grpsplit[0]); } diff --git a/src/etc/inc/authgui.inc b/src/etc/inc/authgui.inc index a60712d..97e0a57 100644 --- a/src/etc/inc/authgui.inc +++ b/src/etc/inc/authgui.inc @@ -130,7 +130,7 @@ function display_error_form($http_code, $desc) { $cssfile = "/bootstrap/css/pfSense.css"; if (isset($config['system']['webgui']['webguicss'])) { - if(file_exists("bootstrap/css/" . $config['system']['webgui']['webguicss'])) { + if (file_exists("bootstrap/css/" . $config['system']['webgui']['webguicss'])) { $cssfile = "/bootstrap/css/" . $config['system']['webgui']['webguicss']; } } @@ -233,7 +233,7 @@ if ($local_ip == false) { $cssfile = "/bootstrap/css/pfSense.css"; if (isset($config['system']['webgui']['webguicss'])) { - if(file_exists("bootstrap/css/" . $config['system']['webgui']['webguicss'])) { + if (file_exists("bootstrap/css/" . $config['system']['webgui']['webguicss'])) { $cssfile = "/bootstrap/css/" . $config['system']['webgui']['webguicss']; } } diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index 7bfaf44..0f1d166 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -545,8 +545,9 @@ EOD; $rulenum++; $cprules .= "add {$rulenum} pass ip from table(100) to any out\n"; $rulenum++; - foreach ($cpips as $cpip) + foreach ($cpips as $cpip) { $cprules .= "table 100 add {$cpip}\n"; + } $cprules .= "add {$rulenum} pass ip from any to 255.255.255.255 in\n"; $rulenum++; $cprules .= "add {$rulenum} pass ip from 255.255.255.255 to any out\n"; diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index a241485..1d1641b 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -300,7 +300,7 @@ $ch = curl_init(); if ($this->_useIPv6 == false) { - curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53 ') { @@ -691,7 +691,7 @@ case 'cloudflare': $needsIP = TRUE; $dnsServer ='api.cloudflare.com'; - $dnsHost = str_replace(' ','', $this->_dnsHost); + $dnsHost = str_replace(' ', '', $this->_dnsHost); $host_names = explode(".", $dnsHost); $bottom_host_name = $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1]; @@ -707,12 +707,12 @@ curl_setopt($ch, CURLOPT_URL, $getZoneId); $output = json_decode(curl_exec($ch)); $zone = $output->result[0]->id; - if ($zone){ // If zone ID was found get host ID + if ($zone) { // If zone ID was found get host ID $getHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records?name={$this->_dnsHost}"; curl_setopt($ch, CURLOPT_URL, $getHostId); $output = json_decode(curl_exec($ch)); $host = $output->result[0]->id; - if ($host){ // If host ID was found update host + if ($host) { // If host ID was found update host $hostData = array( "content" => "{$this->_dnsIP}", "type" => "A", @@ -724,7 +724,7 @@ $updateHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records/{$host}"; curl_setopt($ch, CURLOPT_URL, $updateHostId); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); - curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json); } } break; @@ -831,15 +831,18 @@ case 'spdns': case 'spdns-v6': $needsIP = FALSE; - if ($this->_dnsVerboseLog) + if ($this->_dnsVerboseLog) { log_error("SPDNS: ({$this->_dnsHost}) DNS update() starting."); + } curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); $server = "https://update.spdns.de/nic/update"; $port = ""; - if($this->_dnsServer) + if ($this->_dnsServer) { $server = $this->_dnsServer; - if($this->_dnsPort) + } + if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; + } curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; default: @@ -1300,17 +1303,14 @@ break; case 'cloudflare': $output = json_decode($data); - if ($output->result->content === $this->_dnsIP){ + if ($output->result->content === $this->_dnsIP) { $status = "DynDNS: (Success) {$this->_dnsHost} updated to {$this->_dnsIP}"; $successful_update = true; - } - elseif ($output->errors[0]->code === 9103){ + } elseif ($output->errors[0]->code === 9103) { $status = "DynDNS ({$this->_dnsHost}): ERROR - Invalid Credentials! Don't forget to use API Key for password field with CloudFlare."; - } - elseif (($output->success) && (!$output->result[0]->id)) { + } elseif (($output->success) && (!$output->result[0]->id)) { $status = "DynDNS ({$this->_dnsHost}): ERROR - Zone or Host ID was not found, check your hostname."; - } - else { + } else { $status = "DynDNS ({$this->_dnsHost}): UNKNOWN ERROR - {$output->errors[0]->message}"; log_error("DynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); } diff --git a/src/etc/inc/easyrule.inc b/src/etc/inc/easyrule.inc index 199e7d0..727fd4b 100644 --- a/src/etc/inc/easyrule.inc +++ b/src/etc/inc/easyrule.inc @@ -53,8 +53,9 @@ function easyrule_find_rule_interface($int) { } /* add ipsec interfaces */ - if (ipsec_enabled()) + if (ipsec_enabled()) { $iflist["enc0"] = "IPSEC"; + } if (isset($iflist[$int])) { return $int; diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 5085160..2d4c6a5 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -430,7 +430,7 @@ function filter_configure_sync($delete_states_if_needed = true) { * then output the contents of the error to the caller */ if ($rules_loading <> 0) { - foreach($rules_error as $errorline) { + foreach ($rules_error as $errorline) { $saved_line_error = $errorline; $line_error = explode(":", $errorline); $line_number = $line_error[1]; @@ -2872,7 +2872,7 @@ function filter_generate_user_rule($rule) { (isset($rule['max-src-conn-rate']) and $rule['max-src-conn-rate'] <> "") or (isset($rule['max-src-conn-rates']) and $rule['max-src-conn-rates'] <> ""))) or (isset($rule['sloppy'])) or - (isset($rule['nopfsync'])) ) { + (isset($rule['nopfsync']))) { $aline['flags'] .= "( "; if (isset($rule['sloppy'])) { $aline['flags'] .= "sloppy "; @@ -3324,7 +3324,7 @@ EOD; } /* allow access to DHCP relay on interfaces */ - if(isset($config['dhcrelay']['enable'])) { + if (isset($config['dhcrelay']['enable'])) { $dhcifaces = explode(",", $dhcrelaycfg['interface']); foreach ($dhcifaces as $dhcrelayif) { if ($dhcrelayif == $on) { diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc index a010471..4a478ce 100644 --- a/src/etc/inc/filter_log.inc +++ b/src/etc/inc/filter_log.inc @@ -230,8 +230,9 @@ function parse_unknown_log_line($line) { $pattern = "/^" . $date_pattern . "\ +" . $log_message_pattern . "$/"; - if (!preg_match($pattern, $line, $log_split)) + if (!preg_match($pattern, $line, $log_split)) { return ""; + } list($all, $flent['time'], $flent['message']) = $log_split; @@ -241,10 +242,10 @@ function parse_unknown_log_line($line) { } /* If there is time, and message, fields, then the line should be usable/good */ - if (!( (trim($flent['time']) == "") && (trim($flent['message']) == "") )) { + if (!((trim($flent['time']) == "") && (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."), $errline)); } return ""; @@ -269,8 +270,9 @@ function parse_system_log_line($line) { $pattern = "/^" . $date_pattern . "\ +" . $process_pattern . "\ +" . $pid_pattern . "\ +" . $log_message_pattern . "$/"; - if (!preg_match($pattern, $line, $log_split)) + if (!preg_match($pattern, $line, $log_split)) { return ""; + } list($all, $flent['time'], $flent['host'], $flent['process'], $flent['pid'], $flent['message']) = $log_split; @@ -280,10 +282,10 @@ function parse_system_log_line($line) { } /* If there is time, process, and message, fields, then the line should be usable/good */ - if (!( (trim($flent['time']) == "") && (trim($flent['process']) == "") && (trim($flent['message']) == "") )) { + if (!((trim($flent['time']) == "") && (trim($flent['process']) == "") && (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."), $errline)); } return ""; @@ -552,7 +554,7 @@ function find_action_image($action) { function handle_ajax($nentries, $tail = 50) { global $config; if ($_GET['lastsawtime'] or $_POST['lastsawtime']) { - global $filter_logfile,$filterent; + global $filter_logfile, $filterent; if ($_GET['lastsawtime']) { $lastsawtime = $_GET['lastsawtime']; } diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 8767615..984913b 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -824,7 +824,7 @@ function interface_gre_configure(&$gre, $grekey = "") { /* Do not change the order here for more see gre(4) NOTES section. */ if (is_ipaddrv6($gre['remote-addr'])) { mwexec("/sbin/ifconfig {$greif} inet6 tunnel {$realifip6} " . escapeshellarg($gre['remote-addr'])); - }else{ + } else { mwexec("/sbin/ifconfig {$greif} tunnel {$realifip} " . escapeshellarg($gre['remote-addr'])); } if ((is_ipaddrv6($gre['tunnel-local-addr'])) || (is_ipaddrv6($gre['tunnel-remote-addr']))) { @@ -945,7 +945,7 @@ function interface_gif_configure(&$gif, $gifkey = "") { if (is_ipaddrv6($gif['remote-addr'])) { mwexec("/sbin/ifconfig {$gifif} inet6 tunnel {$realifip} " . escapeshellarg($gif['remote-addr'])); } else { - mwexec("/sbin/ifconfig {$gifif} tunnel {$realifip} " . escapeshellarg($gif['remote-addr'])); + mwexec("/sbin/ifconfig {$gifif} tunnel {$realifip} " . escapeshellarg($gif['remote-addr'])); } if ((is_ipaddrv6($gif['tunnel-local-addr'])) || (is_ipaddrv6($gif['tunnel-remote-addr']))) { /* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */ @@ -5241,17 +5241,19 @@ function get_possible_listen_ips($include_ipv6_link_local=false) { /* XXX: Maybe use array_merge below? */ $carplist = get_configured_carp_interface_list(); foreach ($carplist as $cif => $carpip) { - if (get_vip_descr($carpip)) + if (get_vip_descr($carpip)) { $interfaces[$cif] = $carpip . ' (' . get_vip_descr($carpip) . ')'; - else + } else { $interfaces[$cif] = $carpip; + } } $aliaslist = get_configured_ip_aliases_list(); foreach ($aliaslist as $aliasip => $aliasif) { - if (get_vip_descr($aliasip)) + if (get_vip_descr($aliasip)) { $interfaces[$aliasip] = $aliasip . ' (' . get_vip_descr($aliasip) . ')'; - else + } else { $interfaces[$aliasip] = $aliasip; + } } $interfaces['lo0'] = 'Localhost'; diff --git a/src/etc/inc/ipsec.inc b/src/etc/inc/ipsec.inc index de9ee00..e766ae1 100644 --- a/src/etc/inc/ipsec.inc +++ b/src/etc/inc/ipsec.inc @@ -205,8 +205,9 @@ $p2_pfskeygroups = array( function ipsec_enabled() { global $config; - if (!isset($config['ipsec']) || !is_array($config['ipsec'])) + if (!isset($config['ipsec']) || !is_array($config['ipsec'])) { return false; + } /* Check if we have at least one phase 1 entry. */ if (!isset($config['ipsec']['phase1']) || @@ -216,8 +217,9 @@ function ipsec_enabled() { } /* Check if at least one phase 1 entry is enabled. */ foreach ($config['ipsec']['phase1'] as $phase1) { - if (!isset($phase1['disabled'])) + if (!isset($phase1['disabled'])) { return true; + } } return false; @@ -477,8 +479,9 @@ function ipsec_phase2_status(&$ipsec_status, &$phase2) { */ function ipsec_list_sa() { - if (ipsec_enabled()) + if (ipsec_enabled()) { return pfSense_ipsec_list_sa(); + } return array(); } diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc index 202d6bd..7c50d72 100644 --- a/src/etc/inc/openvpn.inc +++ b/src/etc/inc/openvpn.inc @@ -131,8 +131,9 @@ function openvpn_build_mode_list() { $list = array(); - foreach ($openvpn_server_modes as $name => $desc) + foreach ($openvpn_server_modes as $name => $desc) { $list[$name] = $desc; + } return($list); } @@ -143,24 +144,28 @@ function openvpn_build_if_list() { $interfaces = get_configured_interface_with_descr(); $carplist = get_configured_carp_interface_list(); - foreach ($carplist as $cif => $carpip) + foreach ($carplist as $cif => $carpip) { $interfaces[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")"; + } $aliaslist = get_configured_ip_aliases_list(); - foreach ($aliaslist as $aliasip => $aliasif) + foreach ($aliaslist as $aliasip => $aliasif) { $interfaces[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; + } $grouplist = return_gateway_groups_array(); foreach ($grouplist as $name => $group) { - if($group['ipprotocol'] != inet) + if ($group['ipprotocol'] != inet) { continue; + } - if($group[0]['vip'] != "") + if ($group[0]['vip'] != "") { $vipif = $group[0]['vip']; - else + } else { $vipif = $group[0]['int']; + } $interfaces[$name] = "GW Group {$name}"; } @@ -168,8 +173,9 @@ function openvpn_build_if_list() { $interfaces['lo0'] = "Localhost"; $interfaces['any'] = "any"; - foreach ($interfaces as $iface => $ifacename) + foreach ($interfaces as $iface => $ifacename) { $list[$iface] = $ifacename; + } return($list); } @@ -183,8 +189,9 @@ function openvpn_build_crl_list() { $caname = ""; $ca = lookup_ca($crl['caref']); - if ($ca) + if ($ca) { $caname = " (CA: {$ca['descr']})"; + } $list[$crl['refid']] = $crl['descr'] . $caname; } @@ -257,16 +264,19 @@ function openvpn_build_bridge_list() { $serverbridge_interface = array_merge($serverbridge_interface, get_configured_interface_with_descr()); $carplist = get_configured_carp_interface_list(); - foreach ($carplist as $cif => $carpip) + foreach ($carplist as $cif => $carpip) { $serverbridge_interface[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")"; + } $aliaslist = get_configured_ip_aliases_list(); - foreach ($aliaslist as $aliasip => $aliasif) + foreach ($aliaslist as $aliasip => $aliasif) { $serverbridge_interface[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; + } - foreach ($serverbridge_interface as $iface => $ifacename) + foreach ($serverbridge_interface as $iface => $ifacename) { $list[$iface] = htmlspecialchars($ifacename); + } return($list); } diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index f9049fa..6d6fa54 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -408,11 +408,13 @@ function get_carp_interface_status($carpinterface) { global $config; foreach ($config['virtualip']['vip'] as $carp) { - if ($carp['mode'] != "carp") + if ($carp['mode'] != "carp") { continue; + } $carpif = "_vip{$carp['uniqid']}"; - if ($carpinterface !== $carpif) + if ($carpinterface !== $carpif) { continue; + } $interface = get_real_interface($carp['interface']); $vhid = $carp['vhid']; diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 81f5b02..0303092 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -192,7 +192,7 @@ function pkg_call($params, $mute = false) { $now = time(); - if(($now - $started) >= $maxwaittime) { + if (($now - $started) >= $maxwaittime) { $rc = -1; proc_terminate($process); break; @@ -204,7 +204,7 @@ function pkg_call($params, $mute = false) { fclose($pipes[2]); proc_close($process); - if(!isset($rc)) { + if (!isset($rc)) { $rc = $status['exitcode']; } @@ -353,7 +353,7 @@ function get_package_id($package_name) { foreach ($config['installedpackages']['package'] as $idx => $pkg) { if ($pkg['name'] == $package_name || - get_package_internal_name($pkg) == $package_name) { + get_package_internal_name($pkg) == $package_name) { return $idx; } } diff --git a/src/etc/inc/rrd.inc b/src/etc/inc/rrd.inc index 1459c93..0aa7152 100644 --- a/src/etc/inc/rrd.inc +++ b/src/etc/inc/rrd.inc @@ -278,7 +278,7 @@ function enable_rrd_graphing() { $captiveportalvalid = $rrdcaptiveportalinterval * 2; $ntpdvalid = $rrdntpdinterval * 2; $dhcpdvalid = $rrddhcpdinterval * 2; - + /* Assume 2*10GigE for now */ $downstream = 2500000000; $upstream = 2500000000; @@ -915,11 +915,11 @@ function enable_rrd_graphing() { } /* End NTP statistics */ - + /* Start dhcpd statistics */ if (is_array($config['dhcpd'])) { foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { - if (isset($config['dhcpd'][$dhcpif]['statsgraph'])) { + if (isset($config['dhcpd'][$dhcpif]['statsgraph'])) { if (!file_exists("$rrddbpath$dhcpif$dhcpd")) { $rrdcreate = "$rrdtool create $rrddbpath$dhcpif$dhcpd --step $rrddhcpdinterval "; $rrdcreate .= "DS:leases:GAUGE:$dhcpdvalid:0:100000 "; @@ -950,7 +950,7 @@ function enable_rrd_graphing() { $rrdupdatesh .= "# polling leases for dhcp \n"; $rrdupdatesh .= "DHCP=`${php} -q ${dhcpd_gather} '${dhcpif}'`\n"; $rrdupdatesh .= "$rrdtool update $rrddbpath$dhcpif$dhcpd \${DHCP}\n"; - + } } } diff --git a/src/etc/inc/shaper.inc b/src/etc/inc/shaper.inc index 6fcafc1..160e49c 100644 --- a/src/etc/inc/shaper.inc +++ b/src/etc/inc/shaper.inc @@ -3761,8 +3761,9 @@ EOD; $form .= "<tbody>"; // If there are no bandwidths defined, make a blank one for convenience - if(empty($bandwidth)) + if (empty($bandwidth)) { $bandwidth = array(0 => array('bw' => '', 'bwscale' => 'Kb', 'bwsched' => 'none')); + } if (is_array($bandwidth)) { foreach ($bandwidth as $bwidx => $bw) { @@ -4190,11 +4191,12 @@ class dnqueue_class extends dummynet_class { $bandwidth = $this->GetBandwidth(); // Delete a row - if(isset($_GET['delbwrow']) && (count($bandwidth) > 0)) + if (isset($_GET['delbwrow']) && (count($bandwidth) > 0)) { unset($bandwidth[$_GET['delbwrow']]); + } // Add a row - if($_GET['newbwrow']) { + if ($_GET['newbwrow']) { array_push($bandwidth, array(count($bandwidth) => array('bw' => '', 'burst' => '', 'bwscale' => 'Kb', 'bwsched' => 'none') )); } @@ -4203,7 +4205,7 @@ class dnqueue_class extends dummynet_class { $row = 0; $numrows = count($bandwidth) - 1; - if($numrows >= 0) { + if ($numrows >= 0) { foreach ($bandwidth as $bwidx => $bw) { $group = new Form_Group($row == 0 ? 'Bandwidth':null); @@ -4234,8 +4236,9 @@ class dnqueue_class extends dummynet_class { 'firewall_shaper_vinterface.php?pipe=' . $pipe . '&queue=' . $qname . '&action=' . $action . '&delbwrow=' . $bwidx ))->removeClass('btn-primary')->addClass('btn-danger btn-sm'); - if($row == $numrows) + if ($row == $numrows) { $group->setHelp('Bandwidth is the rate (e.g. Mbit/s) to which traffic in this limiter will be restricted.'); + } $section->add($group); $row++; diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 645f48d..196f810 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -587,7 +587,7 @@ function system_routing_configure($interface = "") { } $gateways_arr = return_gateways_array(false, true); - foreach($gateways_arr as $gateway) { + foreach ($gateways_arr as $gateway) { // setup static interface routes for nonlocal gateways if (isset($gateway["nonlocalgateway"])) { $srgatewayip = $gateway['gateway']; diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index a5ed9d1..ccf1a1b 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4033,7 +4033,7 @@ function upgrade_125_to_126() { /* subtract 2 from ipsec log levels. the value stored in the config.xml * will now match the strongswan level exactly. */ - foreach(array_keys($ipsec_log_cats) as $cat) { + foreach (array_keys($ipsec_log_cats) as $cat) { if (!isset($config['ipsec']["ipsec_{$cat}"])) { $new_level = $def_loglevel; } else { @@ -4121,8 +4121,9 @@ function upgrade_128_to_129() { } /* IPSEC is always on in 2.3. */ - if (isset($config['ipsec']['enable'])) + if (isset($config['ipsec']['enable'])) { unset($config['ipsec']['enable']); + } } function upgrade_129_to_130() { diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index 8bf41da..d372be7 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -1041,21 +1041,24 @@ function get_configured_carp_interface_list($carpinterface = '', $family = 'inet $iflist = array(); - if (!is_array($config['virtualip']['vip']) || empty($config['virtualip']['vip'])) + if (!is_array($config['virtualip']['vip']) || empty($config['virtualip']['vip'])) { return $iflist; + } $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { - if ($vip['mode'] != "carp") + if ($vip['mode'] != "carp") { continue; + } if (empty($carpinterface)) { $iflist["_vip{$vip['uniqid']}"] = $vip['subnet']; continue; } - if ($carpinterface != "_vip{$vip['uniqid']}") + if ($carpinterface != "_vip{$vip['uniqid']}") { continue; + } switch ($what) { case 'subnet': @@ -1478,8 +1481,9 @@ function mwexec($command, $nologentry = false, $clearsigmask = false, $backgroun // run in foreground, and (optionally) log if nonzero return $outputarray = array(); exec("$command 2>&1", $outputarray, $retval); - if (($retval <> 0) && (!$nologentry || isset($config['system']['developerspew']))) + if (($retval <> 0) && (!$nologentry || isset($config['system']['developerspew']))) { log_error(sprintf(gettext("The command '%1\$s' returned exit code '%2\$d', the output was '%3\$s' "), $command, $retval, implode(" ", $outputarray))); + } } if ($clearsigmask) { @@ -1495,7 +1499,7 @@ function mwexec_bg($command, $clearsigmask = false) { } /* unlink a file, or pattern-match of a file, if it exists - if the file/path contains glob() compatible wildcards, all matching files will be unlinked + if the file/path contains glob() compatible wildcards, all matching files will be unlinked if no matches, no error occurs */ function unlink_if_exists($fn) { $to_do = glob($fn); diff --git a/src/etc/inc/voucher.inc b/src/etc/inc/voucher.inc index 2e0f5f5..97b2403 100644 --- a/src/etc/inc/voucher.inc +++ b/src/etc/inc/voucher.inc @@ -588,8 +588,9 @@ function voucher_configure_zone($sync = false) { $roll = $rollent['number']; $len = ($rollent['count'] >> 3) + 1; - if (strlen(base64_decode($rollent['used'])) != $len) + if (strlen(base64_decode($rollent['used'])) != $len) { $rollent['used'] = base64_encode(str_repeat("\000", $len)); + } voucher_write_used_db($roll, $rollent['used']); $minutes = $rollent['minutes']; $active_vouchers = array(); diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc index 0e3d1a2..8769ca1 100644 --- a/src/etc/inc/vpn.inc +++ b/src/etc/inc/vpn.inc @@ -1223,7 +1223,8 @@ EOD; $tunneltype = "type = transport"; if ((($ph1ent['authentication_method'] == "xauth_psk_server") || - ($ph1ent['authentication_method'] == "pre_shared_key")) && isset($ph1ent['mobile'])) { + ($ph1ent['authentication_method'] == "pre_shared_key")) && + isset($ph1ent['mobile'])) { $left_spec = "%any"; } else { $tmpsubnet = ipsec_get_phase1_src($ph1ent); diff --git a/src/etc/login.conf b/src/etc/login.conf index 1e61a9f..98324e2 100644 --- a/src/etc/login.conf +++ b/src/etc/login.conf @@ -35,7 +35,7 @@ default:\ :maxproc=unlimited:\ :sbsize=unlimited:\ :vmemoryuse=unlimited:\ - :idletime=unlimited:\ + :idletime=unlimited:\ :priority=0:\ :ignoretime@:\ :umask=022: @@ -81,7 +81,7 @@ russian|Russian Users Accounts:\ ###################################################################### ## ## Example entries -## +## ###################################################################### ###################################################################### diff --git a/src/etc/phpshellsessions/gitsync b/src/etc/phpshellsessions/gitsync index dceeaa9..3aa072f 100644 --- a/src/etc/phpshellsessions/gitsync +++ b/src/etc/phpshellsessions/gitsync @@ -48,7 +48,7 @@ while (!empty($temp_args)) { switch ($arg) { case "--help": echo "Usage: playback gitsync [options] [[repository] <branch>]\nOptions:\n"; - foreach($valid_args as $arg_name => $arg_desc) { + foreach ($valid_args as $arg_name => $arg_desc) { echo $arg_name . "\n" . $arg_desc; } exit; diff --git a/src/etc/rc.carpbackup b/src/etc/rc.carpbackup index 32cb319..e74ea3c 100755 --- a/src/etc/rc.carpbackup +++ b/src/etc/rc.carpbackup @@ -50,7 +50,7 @@ $friendly_descr = convert_friendly_interface_to_friendly_descr($friendly); $vips = link_interface_to_vips($friendly, '', $vhid); $carp_iface = "{$friendly}_vip{$vhid}"; -if(is_array($vips)) { +if (is_array($vips)) { foreach ($vips as $vip) { $notificationmsg = sprintf('Carp cluster member "(%1$s): (%2$s)" has resumed the state "BACKUP" for vhid %3$s', $argument, $friendly_descr, $vhid); diff --git a/src/etc/rc.initial.password b/src/etc/rc.initial.password index 0e13f7c..969745b 100755 --- a/src/etc/rc.initial.password +++ b/src/etc/rc.initial.password @@ -40,14 +40,14 @@ echo "\n" . gettext(' The webConfigurator admin password and privileges will be reset to the default (which is "' . strtolower($g['product_name']) . '").') . "\n" . - gettext('Do you want to proceed [y|n]?'); + gettext('Do you want to proceed [y|n]?') . " "; if (strcasecmp(chop(fgets($fp)), "y") == 0) { if (isset($config['system']['webgui']['authmode']) && - $config['system']['webgui']['authmode'] != "Local Database") { + $config['system']['webgui']['authmode'] != "Local Database") { echo "\n" . gettext(' The User manager authentication server is set to "' . $config['system']['webgui']['authmode'] . '".') . "\n" . - gettext('Do you want to set it back to Local Database [y|n]?'); + gettext('Do you want to set it back to Local Database [y|n]?') . " "; if (strcasecmp(chop(fgets($fp)), "y") == 0) { $config['system']['webgui']['authmode'] = "Local Database"; } @@ -76,7 +76,7 @@ The User manager authentication server is set to "' . $config['system']['webgui' write_config(gettext("password changed from console menu")); echo "\n" . gettext(' -The password for the webConfigurator has been reset and +The password for the webConfigurator has been reset and the default username has been set to "admin".') . "\n" . gettext(' Remember to set the password to something else than diff --git a/src/etc/rc.newwanip b/src/etc/rc.newwanip index ea44b81..45cef96 100755 --- a/src/etc/rc.newwanip +++ b/src/etc/rc.newwanip @@ -216,8 +216,8 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface /* * Some services (e.g. dyndns, see ticket #4066) depend on * filter_configure() to be called before, otherwise pass out - * route-to rules have the old ip set in 'from' and connection - * do not go through correct link + * route-to rules have the old ip set in 'from' and connections + * do not go through the correct link */ filter_configure_sync(); diff --git a/src/etc/rc.openvpn b/src/etc/rc.openvpn index cda8067..790f9c8 100755 --- a/src/etc/rc.openvpn +++ b/src/etc/rc.openvpn @@ -76,7 +76,7 @@ if (isset($_GET['interface'])) { } if ((is_array($config['openvpn']['openvpn-server']) && count($config['openvpn']['openvpn-server'])) || - (is_array($config['openvpn']['openvpn-client']) && count($config['openvpn']['openvpn-client']))) { + (is_array($config['openvpn']['openvpn-client']) && count($config['openvpn']['openvpn-client']))) { if (empty($argument) || $argument == "all") { $argument = "all"; $log_text = "all"; diff --git a/src/etc/rc.packages b/src/etc/rc.packages index 643ee85..f4ec045 100755 --- a/src/etc/rc.packages +++ b/src/etc/rc.packages @@ -73,15 +73,15 @@ if ($pkg == '' || $when == '') { pkg_remove_prefix($pkg); switch ($when) { -case "post-install": - install_package_xml($pkg); - break; -case "deinstall": -case "post-deinstall": - delete_package_xml($pkg, $when); - break; -default: - usage(); + case "post-install": + install_package_xml($pkg); + break; + case "deinstall": + case "post-deinstall": + delete_package_xml($pkg, $when); + break; + default: + usage(); } ?> diff --git a/src/etc/services b/src/etc/services index 1f85da0..6687559 100644 --- a/src/etc/services +++ b/src/etc/services @@ -134,7 +134,7 @@ bootpc 68/tcp dhcpc #Bootstrap Protocol Client bootpc 68/udp dhcpc #Bootstrap Protocol Client tftp 69/tcp #Trivial File Transfer tftp 69/udp #Trivial File Transfer -tftp-proxy 6969/udp +tftp-proxy 6969/udp gopher 70/tcp gopher 70/udp netrjs-1 71/tcp #Remote Job Service diff --git a/src/etc/sshd b/src/etc/sshd index 05ddb63..2e59824 100755 --- a/src/etc/sshd +++ b/src/etc/sshd @@ -163,7 +163,7 @@ $generate_keys = array(); foreach ($keys as $key) { if (!file_exists("{$sshConfigDir}/ssh_host_{$key['suffix']}key") || - !file_exists("{$sshConfigDir}/ssh_host_{$key['suffix']}key.pub")) { + !file_exists("{$sshConfigDir}/ssh_host_{$key['suffix']}key.pub")) { $generate_keys[] = $key; } } diff --git a/src/etc/ssl/openssl.cnf b/src/etc/ssl/openssl.cnf index 41664e6..3ea2df5 100644 --- a/src/etc/ssl/openssl.cnf +++ b/src/etc/ssl/openssl.cnf @@ -275,7 +275,7 @@ authorityKeyIdentifier=keyid:always,issuer:always # So we do this instead. basicConstraints = CA:true -# Key usage: this is typical for a CA certificate. +# Key usage: this is typical for a CA certificate. keyUsage = cRLSign, keyCertSign # Some might want this also |