From 6c07db487164262f9191ad02805523bd153e0ba6 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 15 Jun 2015 14:19:11 +0545 Subject: Code spacing and other random stuff I noticed. I think this finishes messing with code style. The codebase should match the developer style guide closely enough that 99.9% of changes will not feel the need to also massage the formatting. --- usr/local/captiveportal/index.php | 45 +- usr/local/captiveportal/radius_accounting.inc | 8 +- usr/local/pkg/miniupnpd.inc | 24 +- usr/local/www/bandwidth_by_ip.php | 2 +- usr/local/www/carp_status.php | 2 +- usr/local/www/crash_reporter.php | 6 +- usr/local/www/diag_backup.php | 4 +- usr/local/www/diag_dns.php | 6 +- usr/local/www/diag_dump_states.php | 4 +- usr/local/www/diag_ipsec.php | 2 +- usr/local/www/diag_limiter_info.php | 2 +- usr/local/www/diag_logs_filter.php | 4 +- usr/local/www/diag_logs_filter_summary.php | 8 +- usr/local/www/diag_logs_ipsec.php | 4 +- usr/local/www/diag_logs_settings.php | 2 +- usr/local/www/diag_packet_capture.php | 2 +- usr/local/www/diag_pf_info.php | 2 +- usr/local/www/diag_states_summary.php | 2 +- usr/local/www/diag_system_activity.php | 2 +- usr/local/www/diag_system_pftop.php | 2 +- usr/local/www/edit.php | 8 +- usr/local/www/exec.php | 36 +- usr/local/www/fbegin.inc | 32 +- usr/local/www/firewall_aliases.php | 22 +- usr/local/www/firewall_aliases_edit.php | 10 +- usr/local/www/firewall_aliases_import.php | 6 +- usr/local/www/firewall_nat.php | 6 +- usr/local/www/firewall_nat_1to1.php | 2 +- usr/local/www/firewall_nat_1to1_edit.php | 10 +- usr/local/www/firewall_nat_edit.php | 40 +- usr/local/www/firewall_nat_npt.php | 2 +- usr/local/www/firewall_nat_npt_edit.php | 2 +- usr/local/www/firewall_nat_out.php | 4 +- usr/local/www/firewall_nat_out_edit.php | 38 +- usr/local/www/firewall_rules.php | 22 +- usr/local/www/firewall_rules_edit.php | 62 +-- usr/local/www/firewall_schedule.php | 12 +- usr/local/www/firewall_schedule_edit.php | 78 ++-- usr/local/www/firewall_shaper.php | 11 +- usr/local/www/firewall_shaper_layer7.php | 30 +- usr/local/www/firewall_shaper_vinterface.php | 6 +- usr/local/www/firewall_shaper_wizards.php | 6 +- usr/local/www/firewall_virtual_ip.php | 14 +- usr/local/www/firewall_virtual_ip_edit.php | 20 +- usr/local/www/getserviceproviders.php | 18 +- usr/local/www/getstats.php | 6 +- usr/local/www/graph.php | 481 +++++++++++---------- usr/local/www/graph_cpu.php | 210 ++++----- usr/local/www/guiconfig.inc | 70 +-- usr/local/www/halt.php | 4 +- usr/local/www/head.inc | 2 +- usr/local/www/headjs.php | 4 +- usr/local/www/ifstats.php | 6 +- usr/local/www/index.php | 60 +-- usr/local/www/interfaces.php | 120 ++--- usr/local/www/interfaces_assign.php | 10 +- usr/local/www/interfaces_bridge.php | 2 +- usr/local/www/interfaces_bridge_edit.php | 14 +- usr/local/www/interfaces_gif.php | 4 +- usr/local/www/interfaces_gif_edit.php | 6 +- usr/local/www/interfaces_gre.php | 4 +- usr/local/www/interfaces_gre_edit.php | 6 +- usr/local/www/interfaces_groups.php | 4 +- usr/local/www/interfaces_groups_edit.php | 7 +- usr/local/www/interfaces_lagg.php | 4 +- usr/local/www/interfaces_lagg_edit.php | 2 +- usr/local/www/interfaces_ppps.php | 2 +- usr/local/www/interfaces_ppps_edit.php | 68 +-- usr/local/www/interfaces_qinq.php | 4 +- usr/local/www/interfaces_qinq_edit.php | 6 +- usr/local/www/interfaces_vlan.php | 4 +- usr/local/www/interfaces_vlan_edit.php | 6 +- usr/local/www/interfaces_wireless.php | 2 +- usr/local/www/interfaces_wireless_edit.php | 4 +- usr/local/www/license.php | 2 +- usr/local/www/load_balancer_monitor.php | 8 +- usr/local/www/load_balancer_monitor_edit.php | 22 +- usr/local/www/load_balancer_pool.php | 14 +- usr/local/www/load_balancer_pool_edit.php | 12 +- usr/local/www/load_balancer_setting.php | 4 +- usr/local/www/load_balancer_virtual_server.php | 16 +- .../www/load_balancer_virtual_server_edit.php | 8 +- usr/local/www/pkg.php | 40 +- usr/local/www/pkg_edit.php | 67 +-- usr/local/www/pkg_mgr.php | 28 +- usr/local/www/pkg_mgr_install.php | 2 +- usr/local/www/pkg_mgr_installed.php | 42 +- usr/local/www/pkg_mgr_settings.php | 4 +- usr/local/www/reboot.php | 4 +- usr/local/www/services_captiveportal.php | 6 +- usr/local/www/services_captiveportal_mac.php | 4 +- usr/local/www/services_captiveportal_vouchers.php | 14 +- .../www/services_captiveportal_vouchers_edit.php | 4 +- usr/local/www/services_dhcp.php | 2 +- usr/local/www/services_dhcpv6.php | 2 +- usr/local/www/services_dhcpv6_edit.php | 2 +- usr/local/www/services_dnsmasq.php | 6 +- usr/local/www/services_dyndns_edit.php | 2 +- usr/local/www/services_igmpproxy_edit.php | 14 +- usr/local/www/services_rfc2136_edit.php | 2 +- usr/local/www/services_unbound_acls.php | 2 +- usr/local/www/services_wol_edit.php | 2 +- usr/local/www/shortcuts.inc | 4 +- usr/local/www/status.php | 88 ++-- usr/local/www/status_captiveportal.php | 2 +- usr/local/www/status_captiveportal_expire.php | 2 +- usr/local/www/status_captiveportal_test.php | 3 +- .../www/status_captiveportal_voucher_rolls.php | 4 +- usr/local/www/status_captiveportal_vouchers.php | 4 +- usr/local/www/status_dhcp_leases.php | 23 +- usr/local/www/status_dhcpv6_leases.php | 24 +- usr/local/www/status_filter_reload.php | 10 +- usr/local/www/status_gateway_groups.php | 2 +- usr/local/www/status_gateways.php | 2 +- usr/local/www/status_graph.php | 8 +- usr/local/www/status_interfaces.php | 6 +- usr/local/www/status_lb_pool.php | 18 +- usr/local/www/status_lb_vs.php | 2 +- usr/local/www/status_ntpd.php | 12 +- usr/local/www/status_openvpn.php | 12 +- usr/local/www/status_queues.php | 13 +- usr/local/www/status_rrd_graph.php | 27 +- usr/local/www/status_rrd_graph_img.php | 34 +- usr/local/www/status_rrd_graph_settings.php | 2 +- usr/local/www/status_services.php | 2 +- usr/local/www/status_upnp.php | 2 +- usr/local/www/status_wireless.php | 6 +- usr/local/www/system_advanced_admin.php | 6 +- usr/local/www/system_advanced_notifications.php | 4 +- usr/local/www/system_certmanager.php | 2 +- usr/local/www/system_crlmanager.php | 11 +- usr/local/www/system_firmware.php | 4 +- usr/local/www/system_firmware_check.php | 10 +- .../www/system_firmware_restorefullbackup.php | 10 +- usr/local/www/system_gateways_edit.php | 6 +- usr/local/www/system_groupmanager_addprivs.php | 2 +- usr/local/www/system_hasync.php | 8 +- usr/local/www/system_usermanager_addprivs.php | 2 +- usr/local/www/vpn_ipsec.php | 10 +- usr/local/www/vpn_ipsec_mobile.php | 6 +- usr/local/www/vpn_ipsec_phase2.php | 8 +- usr/local/www/vpn_ipsec_settings.php | 7 +- usr/local/www/vpn_l2tp.php | 28 +- usr/local/www/vpn_l2tp_users.php | 2 +- usr/local/www/vpn_l2tp_users_edit.php | 12 +- usr/local/www/vpn_openvpn_client.php | 2 +- usr/local/www/vpn_openvpn_csc.php | 2 +- usr/local/www/vpn_openvpn_server.php | 6 +- usr/local/www/vpn_pppoe.php | 2 +- usr/local/www/vpn_pppoe_edit.php | 13 +- usr/local/www/wizard.php | 14 +- usr/local/www/xmlrpc.php | 10 +- 152 files changed, 1307 insertions(+), 1279 deletions(-) (limited to 'usr') diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 2d256b2..d450233 100644 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -98,7 +98,7 @@ if ($macfilter || $passthrumac) { $tmpres = pfSense_ip_to_mac($clientip); if (!is_array($tmpres)) { /* unable to find MAC address - shouldn't happen! - bail out */ - captiveportal_logportalauth("unauthenticated","noclientmac",$clientip,"ERROR"); + captiveportal_logportalauth("unauthenticated", "noclientmac", $clientip, "ERROR"); echo "An error occurred. Please check the system logs for more information."; log_error("Zone: {$cpzone} - Captive portal could not determine client's MAC address. Disable MAC address filtering in captive portal if you do not need this functionality."); ob_flush(); @@ -142,19 +142,19 @@ EOD; captiveportal_disconnect_client($_POST['logout_id']); } else if ($macfilter && $clientmac && captiveportal_blocked_mac($clientmac)) { - captiveportal_logportalauth($clientmac,$clientmac,$clientip,"Blocked MAC address"); + captiveportal_logportalauth($clientmac, $clientmac, $clientip, "Blocked MAC address"); if (!empty($cpcfg['blockedmacsurl'])) { portal_reply_page($cpcfg['blockedmacsurl'], "redir"); } else { portal_reply_page($redirurl, "error", "This MAC address has been blocked"); } -} else if ($clientmac && $radmac_enable && portal_mac_radius($clientmac,$clientip, $radiusctx)) { +} else if ($clientmac && $radmac_enable && portal_mac_radius($clientmac, $clientip, $radiusctx)) { /* radius functions handle everything so we exit here since we're done */ } else if (portal_consume_passthrough_credit($clientmac)) { /* allow the client through if it had a pass-through credit for its MAC */ - captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT"); + captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT"); portal_allow($clientip, $clientmac, "unauthenticated"); } else if (isset($config['voucher'][$cpzone]['enable']) && $_POST['accept'] && $_POST['auth_voucher']) { @@ -163,22 +163,23 @@ EOD; // $timecredit contains either a credit in minutes or an error message if ($timecredit > 0) { // voucher is valid. Remaining minutes returned // if multiple vouchers given, use the first as username - $a_vouchers = preg_split("/[\t\n\r ]+/s",$voucher); + $a_vouchers = preg_split("/[\t\n\r ]+/s", $voucher); $voucher = $a_vouchers[0]; - $attr = array( 'voucher' => 1, - 'session_timeout' => $timecredit*60, - 'session_terminate_time' => 0); - if (portal_allow($clientip, $clientmac,$voucher,null,$attr)) { + $attr = array( + 'voucher' => 1, + 'session_timeout' => $timecredit*60, + 'session_terminate_time' => 0); + if (portal_allow($clientip, $clientmac, $voucher, null, $attr)) { // YES: user is good for $timecredit minutes. - captiveportal_logportalauth($voucher,$clientmac,$clientip,"Voucher login good for $timecredit min."); + captiveportal_logportalauth($voucher, $clientmac, $clientip, "Voucher login good for $timecredit min."); } else { portal_reply_page($redirurl, "error", $config['voucher'][$cpzone]['descrmsgexpired'] ? $config['voucher'][$cpzone]['descrmsgexpired']: $errormsg); } } else if (-1 == $timecredit) { // valid but expired - captiveportal_logportalauth($voucher,$clientmac,$clientip,"FAILURE","voucher expired"); + captiveportal_logportalauth($voucher, $clientmac, $clientip, "FAILURE", "voucher expired"); portal_reply_page($redirurl, "error", $config['voucher'][$cpzone]['descrmsgexpired'] ? $config['voucher'][$cpzone]['descrmsgexpired']: $errormsg); } else { - captiveportal_logportalauth($voucher,$clientmac,$clientip,"FAILURE"); + captiveportal_logportalauth($voucher, $clientmac, $clientip, "FAILURE"); portal_reply_page($redirurl, "error", $config['voucher'][$cpzone]['descrmsgnoaccess'] ? $config['voucher'][$cpzone]['descrmsgnoaccess'] : $errormsg); } @@ -191,7 +192,7 @@ EOD; $user = $_POST['auth_user2']; $paswd = $_POST['auth_pass2']; } - $auth_list = radius($user,$paswd,$clientip,$clientmac,"USER LOGIN", $radiusctx); + $auth_list = radius($user, $paswd, $clientip, $clientmac, "USER LOGIN", $radiusctx); $type = "error"; if (!empty($auth_list['url_redirection'])) { $redirurl = $auth_list['url_redirection']; @@ -199,10 +200,10 @@ EOD; } if ($auth_list['auth_val'] == 1) { - captiveportal_logportalauth($user,$clientmac,$clientip,"ERROR",$auth_list['error']); + captiveportal_logportalauth($user, $clientmac, $clientip, "ERROR", $auth_list['error']); portal_reply_page($redirurl, $type, $auth_list['error'] ? $auth_list['error'] : $errormsg); } else if ($auth_list['auth_val'] == 3) { - captiveportal_logportalauth($user,$clientmac,$clientip,"FAILURE",$auth_list['reply_message']); + captiveportal_logportalauth($user, $clientmac, $clientip, "FAILURE", $auth_list['reply_message']); portal_reply_page($redirurl, $type, $auth_list['reply_message'] ? $auth_list['reply_message'] : $errormsg); } } else { @@ -213,7 +214,7 @@ EOD; } else { $user = 'unknown'; } - captiveportal_logportalauth($user ,$clientmac,$clientip,"ERROR"); + captiveportal_logportalauth($user, $clientmac, $clientip, "ERROR"); portal_reply_page($redirurl, "error", $errormsg); } @@ -226,11 +227,11 @@ EOD; $loginok = userHasPrivilege(getUserEntry($_POST['auth_user']), "user-services-captiveportal-login"); } - if ($loginok){ - captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN"); - portal_allow($clientip, $clientmac,$_POST['auth_user']); + if ($loginok) { + captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, "LOGIN"); + portal_allow($clientip, $clientmac, $_POST['auth_user']); } else { - captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE"); + captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, "FAILURE"); portal_reply_page($redirurl, "error", $errormsg); } } else { @@ -238,12 +239,12 @@ EOD; } } else if ($_POST['accept'] && $clientip && $cpcfg['auth_method'] == "none") { - captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT"); + captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT"); portal_allow($clientip, $clientmac, "unauthenticated"); } else { /* display captive portal page */ - portal_reply_page($redirurl, "login",null,$clientmac,$clientip); + portal_reply_page($redirurl, "login", null, $clientmac, $clientip); } ob_flush(); diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc index 174d455..2d9c97e 100644 --- a/usr/local/captiveportal/radius_accounting.inc +++ b/usr/local/captiveportal/radius_accounting.inc @@ -61,12 +61,12 @@ function RADIUS_ACCOUNTING_START($ruleno, $username, $sessionid, $radiusservers, $nas_port = intval($ruleno); $radiusvendor = $config['captiveportal'][$cpzone]['radiusvendor'] ? $config['captiveportal'][$cpzone]['radiusvendor'] : null; - switch($radiusvendor) { + switch ($radiusvendor) { case 'cisco': - $calledstationid = $clientmac; - $callingstationid = $clientip; - break; + $calledstationid = $clientmac; + $callingstationid = $clientip; + break; default: if (!function_exists('getNasIP')) diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 0c816a1..a545744 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -37,7 +37,7 @@ /* md5 hash of wan mac */ $uuid = md5(get_interface_mac(get_real_interface("wan"))); /* put uuid in correct format 8-4-4-4-12 */ - return substr($uuid,0,8).'-'.substr($uuid,9,4).'-'.substr($uuid,13,4).'-'.substr($uuid,17,4).'-'.substr($uuid,21,12); + return substr($uuid, 0, 8) . '-' . substr($uuid, 9, 4) . '-' . substr($uuid, 13, 4) . '-' . substr($uuid, 17, 4) . '-' . substr($uuid, 21, 12); } function upnp_validate_queue($qname) { @@ -102,7 +102,7 @@ } } } - if ($post['overridewanip'] && !upnp_validate_ip($post['overridewanip'],false)) { + if ($post['overridewanip'] && !upnp_validate_ip($post['overridewanip'], false)) { $input_errors[] = 'You must specify a valid ip address in the \'Override WAN address\' field'; } if (($post['download'] && !$post['upload']) || ($post['upload'] && !$post['download'])) { @@ -120,9 +120,9 @@ /* user permissions validation */ $j = substr_count(implode(array_keys($post)), "permuser"); - for ($i=0; $i<$j; $i++){ + for ($i = 0; $i < $j; $i++) { if ($post["permuser{$i}"]) { - $perm = explode(' ',$post["permuser{$i}"]); + $perm = explode(' ', $post["permuser{$i}"]); /* should explode to 4 args */ if (count($perm) != 4) { $input_errors[] = "You must follow the specified format in the 'User specified permissions {$i}' field"; @@ -136,7 +136,7 @@ $input_errors[] = "You must specify a port or port range between 0 and 65535 in the 'User specified permissions {$i}' field"; } /* verify ip address */ - if (!upnp_validate_ip($perm[2],true)) { + if (!upnp_validate_ip($perm[2], true)) { $input_errors[] = "You must specify a valid ip address in the 'User specified permissions {$i}' field"; } } @@ -179,7 +179,7 @@ } $if = convert_friendly_interface_to_real_interface_name($iface); /* above function returns iface if fail */ - if ($if!=$iface) { + if ($if != $iface) { $addr = find_interface_ip($if); $bits = find_interface_subnet($if); /* check that the interface has an ip address before adding parameters */ @@ -235,14 +235,14 @@ /* set uuid and serial */ $config_text .= "uuid=".upnp_uuid()."\n"; - $config_text .= "serial=".strtoupper(substr(upnp_uuid(),0,8))."\n"; + $config_text .= "serial=".strtoupper(substr(upnp_uuid(), 0, 8))."\n"; /* set model number */ $config_text .= "model_number=".file_get_contents("/etc/version")."\n"; /* upnp access restrictions */ - foreach($upnp_config['row'] as $row){ - if($row['permuser']) { + foreach ($upnp_config['row'] as $row) { + if ($row['permuser']) { $config_text .= "{$row["permuser"]}\n"; } } @@ -257,13 +257,13 @@ } /* Add shaper queue */ - if($upnp_config['upnpqueue']) { + if ($upnp_config['upnpqueue']) { $config_text .= "queue={$upnp_config['upnpqueue']}\n"; } /* Allow UPnP or NAT-PMP as requested */ - $config_text .= "enable_upnp=" . ( $upnp_config['enable_upnp'] ? "yes\n" : "no\n" ); - $config_text .= "enable_natpmp=" . ( $upnp_config['enable_natpmp'] ? "yes\n" : "no\n" ); + $config_text .= "enable_upnp=" . ($upnp_config['enable_upnp'] ? "yes\n" : "no\n"); + $config_text .= "enable_natpmp=" . ($upnp_config['enable_natpmp'] ? "yes\n" : "no\n"); /* write out the configuration */ upnp_write_config($config_file, $config_text); diff --git a/usr/local/www/bandwidth_by_ip.php b/usr/local/www/bandwidth_by_ip.php index c9e8e93..423fcf9 100755 --- a/usr/local/www/bandwidth_by_ip.php +++ b/usr/local/www/bandwidth_by_ip.php @@ -84,7 +84,7 @@ for ($x=2; $x<12; $x++) { // echo $bandwidthinfo; $emptyinfocounter = 1; if ($bandwidthinfo != "") { - $infoarray = explode (":",$bandwidthinfo); + $infoarray = explode (":", $bandwidthinfo); if (($filter == "all") || (($filter == "local") && (ip_in_subnet($infoarray[0], $intsubnet))) || (($filter == "remote") && (!ip_in_subnet($infoarray[0], $intsubnet)))) { diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index a00d781..5f863e2 100644 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -122,7 +122,7 @@ if (!empty($_POST['resetdemotion'])) { $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); } -$pgtitle = array(gettext("Status"),gettext("CARP")); +$pgtitle = array(gettext("Status"), gettext("CARP")); $shortcut_section = "carp"; include("head.inc"); diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index fe4c7ca..24cb36f 100644 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -71,12 +71,12 @@ function output_crash_reporter_html($crash_reports) { echo "

" . gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.") . "

"; echo "

" . gettext("Contents of crash reports") . ":
"; echo "

"; - echo "

" . gettext(" - Submit this to the developers for inspection") . "

"; - echo "

" . gettext(" - Just delete the crash report and take me back to the Dashboard") . "

"; + echo "

" . gettext(" - Submit this to the developers for inspection") . "

"; + echo "

" . gettext(" - Just delete the crash report and take me back to the Dashboard") . "

"; echo ""; } -$pgtitle = array(gettext("Diagnostics"),gettext("Crash reporter")); +$pgtitle = array(gettext("Diagnostics"), gettext("Crash reporter")); include('head.inc'); $crash_report_header = "Crash report begins. Anonymous machine information:\n\n"; diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index bede178..6e454a4 100644 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -207,7 +207,7 @@ function spit_out_select_items($name, $showall) { "wol" => gettext("Wake on LAN") ); - $select = ""; $select .= ""; if ($showall == true) { @@ -457,7 +457,7 @@ if ($_POST) { if (is_alias($config['interfaces'][$iface]['descr'])) { // Firewall rules $origname = $config['interfaces'][$iface]['descr']; - $newname = $config['interfaces'][$iface]['descr'] . "Alias"; + $newname = $config['interfaces'][$iface]['descr'] . "Alias"; update_alias_names_upon_change(array('filter', 'rule'), array('source', 'address'), $newname, $origname); update_alias_names_upon_change(array('filter', 'rule'), array('destination', 'address'), $newname, $origname); // NAT Rules diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index c234bea..4c57223 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -47,11 +47,11 @@ $a_aliases = &$config['aliases']['alias']; $aliasname = str_replace(array(".", "-"), "_", $host); $alias_exists = false; -$counter=0; +$counter = 0; foreach ($a_aliases as $a) { if ($a['name'] == $aliasname) { $alias_exists = true; - $id=$counter; + $id = $counter; } $counter++; } @@ -289,7 +289,7 @@ include("head.inc"); ?> if (!$input_errors && $ipaddr) { ?> - +
diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php index 1a2f435..1f947fd 100755 --- a/usr/local/www/diag_dump_states.php +++ b/usr/local/www/diag_dump_states.php @@ -187,10 +187,10 @@ while ($line = chop(fgets($fd))) { $line_split = preg_split("/\s+/", $line); - $iface = array_shift($line_split); + $iface = array_shift($line_split); $proto = array_shift($line_split); $state = array_pop($line_split); - $info = implode(" ", $line_split); + $info = implode(" ", $line_split); // We may want to make this optional, with a large state table, this could get to be expensive. $iface = convert_real_interface_to_friendly_descr($iface); diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 7f259c3..96c6835 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -301,7 +301,7 @@ $status = ipsec_smp_dump_status();
- - Show child SA entries + - Show child SA entries
diff --git a/usr/local/www/diag_limiter_info.php b/usr/local/www/diag_limiter_info.php index 98d2663..d4e5b06 100644 --- a/usr/local/www/diag_limiter_info.php +++ b/usr/local/www/diag_limiter_info.php @@ -79,7 +79,7 @@ include("head.inc"); }); } function activitycallback(transport) { - jQuery('#limiteractivitydiv').html('
' + transport.responseText  + '<\/pre><\/font>');
+		jQuery('#limiteractivitydiv').html('
' + transport.responseText + '<\/pre><\/font>');
 		setTimeout('getlimiteractivity()', 2000);
 	}
 	setTimeout('getlimiteractivity()', 5000);
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index df24cd4..b583035 100644
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -181,8 +181,8 @@ include("head.inc");
 									
"; + $savebutton .= ""; } $nifty_redbox = "#990000"; $nifty_blackbox = "#000000"; @@ -380,7 +380,7 @@ EOFnp; } -function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) { +function print_info_box_np_undo($msg, $name = "apply", $value = "Apply changes", $undo) { global $g; if (stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { @@ -678,11 +678,11 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert echo "\n"; if ($withorig) { if (isset($config['system']['usefifolog'])) { - $entry_date_time = htmlspecialchars(date("F j, Y, g:i a","" . $logent[1] . "")); + $entry_date_time = htmlspecialchars(date("F j, Y, g:i a", "" . $logent[1] . "")); $entry_text = htmlspecialchars($logent[5]); } else { $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3))); - $entry_text = ($logent[3] == $config['system']['hostname']) ? "" : $logent[3] . " "; + $entry_text = ($logent[3] == $config['system']['hostname']) ? "" : $logent[3] . " "; $entry_text .= htmlspecialchars($logent[4] . " " . $logent[5]); } echo "\n"; @@ -779,7 +779,7 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp } } -function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $pendport=0) { +function pconfig_to_address(&$adr, $padr, $pmask, $pnot = false, $pbeginport = 0, $pendport = 0) { $adr = array(); if ($padr == "any") { @@ -836,9 +836,9 @@ function display_widget_tabs(& $tab_array) { echo "
"; $tabscounter = 0; foreach ($tab_array as $ta) { - $dashpos = strpos($ta[2],'-'); + $dashpos = strpos($ta[2], '-'); $tabname = $ta[2] . "-tab"; - $tabclass = substr($ta[2],0,$dashpos); + $tabclass = substr($ta[2], 0, $dashpos); $tabclass = $tabclass . "-class"; if ($ta[1] == true) { $tabActive = "table-cell"; @@ -978,7 +978,7 @@ function print_rfc2616_select($tag, $current) { } // Useful debugging function, much cleaner than print_r -function echo_array($array,$return_me=false) { +function echo_array($array, $return_me = false) { if (is_array($array) == false) { $return = "The provided variable is not an array."; } else { @@ -986,7 +986,7 @@ function echo_array($array,$return_me=false) { if (is_array($value)) { $return .= ""; $return .= "['$name'] {
\n"; - $return .= echo_array($value,true); + $return .= echo_array($value, true); $return .= "
}"; $return .= "\n\n"; } else { @@ -1073,7 +1073,7 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) { echo gettext("Currently viewing: "); echo "
"; if ($alias_name['url']) { // TODO: Change it when pf supports tables with ports if ($alias_name['type'] == "urltable") { exec("/sbin/pfctl -t {$alias_name['name']} -T show | wc -l", $total_entries); - $counter=preg_replace("/\D/","",$total_entries[0]); + $counter = preg_replace("/\D/", "", $total_entries[0]); exec("/sbin/pfctl -t {$alias_name['name']} -T show | head -10002", $alias_addresses); } else { $urlfn = alias_expand_urltable($alias_name['name']); @@ -1150,8 +1150,8 @@ function alias_info_popup($alias_id) { $counter = count($alias_addresses); } $alias_objects_with_details .= ""; - $x=0; - foreach ($alias_addresses as $alias_ports_address ) { + $x = 0; + foreach ($alias_addresses as $alias_ports_address) { switch ($x) { case 0: $x++; @@ -1162,8 +1162,8 @@ function alias_info_popup($alias_id) { $alias_objects_with_details .= ""; break; default: - $x=0; - $alias_objects_with_details .= ""; + $x = 0; + $alias_objects_with_details .= ""; break; } } @@ -1182,7 +1182,7 @@ function alias_info_popup($alias_id) { $counter = 0; foreach ($alias_addresses as $alias_ports_address) { $alias_objects_with_details .= ""; - $alias_detail_default = strpos ($alias_details[$counter],"Entry added"); + $alias_detail_default = strpos ($alias_details[$counter], "Entry added"); if ($alias_details[$counter] != "" && $alias_detail_default === False) { $alias_objects_with_details .=""; } else { @@ -1204,8 +1204,8 @@ function alias_info_popup($alias_id) { print "

{$alias_caption}

" . $alias_objects_with_details; } -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 (); @@ -1232,7 +1232,7 @@ function rule_popup($src,$srcport,$dst,$dstport) { $descriptions['srcport'] = $span_begin; $descriptions['srcport_end'] = $span_end; } - if ($alias_name['name'] == $dst ) { + if ($alias_name['name'] == $dst) { $descriptions['dst'] = $span_begin; $descriptions['dst_end'] = $span_end; } diff --git a/usr/local/www/halt.php b/usr/local/www/halt.php index e640e8a..ab4fe99 100755 --- a/usr/local/www/halt.php +++ b/usr/local/www/halt.php @@ -52,7 +52,7 @@ if ($_POST['Submit'] == " " . gettext("No") . " ") { exit; } -$pgtitle = array(gettext("Diagnostics"),gettext("Halt system")); +$pgtitle = array(gettext("Diagnostics"), gettext("Halt system")); include('head.inc'); ?> @@ -61,7 +61,7 @@ include('head.inc');
-
+
 
diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc index ba02b40..d8b8867 100755 --- a/usr/local/www/head.inc +++ b/usr/local/www/head.inc @@ -87,7 +87,7 @@ if (file_exists("{$g['www_path']}/javascript/global.js")) { * Coded by: Erik Kristensen */ -$dir = trim(basename($_SERVER["SCRIPT_FILENAME"], '.php')); +$dir = trim(basename($_SERVER["SCRIPT_FILENAME"], '.php')); $path = "{$g['www_path']}/javascript/" . $dir . "/"; if (is_dir($path)) { if ($dh = opendir($path)) { diff --git a/usr/local/www/headjs.php b/usr/local/www/headjs.php index 4b54ec2..5e4148f 100644 --- a/usr/local/www/headjs.php +++ b/usr/local/www/headjs.php @@ -72,7 +72,7 @@ function getHeadJS() { } } - function submit_form(e){ + function submit_form(e) { // debugging helper //alert(Form.serialize($('iform'))); @@ -88,7 +88,7 @@ function getHeadJS() { jQuery('#submit').keydown(); jQuery('#submit').css('visibility','hidden'); } - if(jQuery('#cancelbutton')) { + if (jQuery('#cancelbutton')) { jQuery('#cancelbutton').css('visibility','hidden'); } jQuery('#loading').css('visibility','visible'); diff --git a/usr/local/www/ifstats.php b/usr/local/www/ifstats.php index 4f07752..68cc6d8 100644 --- a/usr/local/www/ifstats.php +++ b/usr/local/www/ifstats.php @@ -56,9 +56,9 @@ $temp = gettimeofday(); $timing = (double)$temp["sec"] + (double)$temp["usec"] / 1000000.0; - header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); - header("Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" ); - header("Cache-Control: no-cache, no-store, must-revalidate" ); // HTTP/1.1 + header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT"); + header("Expires: " . gmdate("D, j M Y H:i:s", time()) . " GMT"); + header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); // HTTP/1.0 echo "$timing|" . $ifinfo['inbytes'] . "|" . $ifinfo['outbytes'] . "\n"; diff --git a/usr/local/www/index.php b/usr/local/www/index.php index f9f46a4..4de2852 100644 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -44,7 +44,7 @@ ##|-PRIV // Turn on buffering to speed up rendering -ini_set('output_buffering','true'); +ini_set('output_buffering', 'true'); // Start buffering with a cache size of 100000 ob_start(null, "1000"); @@ -61,7 +61,7 @@ if (isset($_REQUEST['closenotice'])) { echo get_menu_messages(); exit; } -if ($_REQUEST['act'] == 'alias_info_popup' && !preg_match("/\D/",$_REQUEST['aliasid'])) { +if ($_REQUEST['act'] == 'alias_info_popup' && !preg_match("/\D/", $_REQUEST['aliasid'])) { alias_info_popup($_REQUEST['aliasid']); exit; } @@ -91,7 +91,7 @@ if ($g['disablecrashreporter'] != true) { ##build list of widgets $directory = "/usr/local/www/widgets/widgets/"; -$dirhandle = opendir($directory); +$dirhandle = opendir($directory); $filename = ""; $widgetnames = array(); $widgetfiles = array(); @@ -142,7 +142,7 @@ require_once('includes/functions.inc.php'); ## if true, display, if false, hide it ... if (file_exists("/usr/sbin/swapinfo")) { $swapinfo = `/usr/sbin/swapinfo`; - if (stristr($swapinfo,'%') == true) { + if (stristr($swapinfo, '%') == true) { $showswap=true; } } @@ -195,10 +195,10 @@ EOF; echo "
\n"; echo "\"logo\"

\n"; echo "

\n"; - echo sprintf(gettext("Welcome to %s!\n"),$g['product_name']) . "

"; + echo sprintf(gettext("Welcome to %s!\n"), $g['product_name']) . "

"; echo gettext("One moment while we start the initial setup wizard.") . "

\n"; echo gettext("Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.") . "

\n"; - echo sprintf(gettext("To bypass the wizard, click on the %s logo on the initial page."),$g['product_name']) . "\n"; + echo sprintf(gettext("To bypass the wizard, click on the %s logo on the initial page."), $g['product_name']) . "\n"; echo "

\n"; echo "\n"; echo " @@ -570,7 +570,7 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard"); <?=gettext(" style="cursor: pointer;" onmouseup="domTT_activate(this, event, 'content', document.getElementById('content1'), 'type', 'velcro', 'delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" /> - <?=gettext(" style="cursor: help;" onmouseup="hideAllWidgets();domTT_activate(this, event, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '','delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" /> + <?=gettext(" style="cursor: help;" onmouseup="hideAllWidgets();domTT_activate(this, event, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '', 'delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" />     " /> @@ -731,9 +731,9 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard");
-
open
-
minimize
-
close
+
open
+
minimize
+
close
@@ -769,9 +769,9 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard"); { jQuery('.ui-sortable').sortable({connectWith: '.ui-sortable', dropOnEmpty: true, handle: '.widgetheader', change: showSave}); - + hideAllWidgets(); - domTT_activate('welcome1', null, 'x', 287, 'y', 107, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '','delay', 1000, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle'); + domTT_activate('welcome1', null, 'x', 287, 'y', 107, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '', 'delay', 1000, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle'); }); //]]> @@ -780,7 +780,7 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard"); //build list of javascript include files $jsincludefiles = array(); $directory = "widgets/javascript/"; - $dirhandle = opendir($directory); + $dirhandle = opendir($directory); $filename = ""; while (false !== ($filename = readdir($dirhandle))) { $jsincludefiles[] = $filename; diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 078857e..59febc1 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -88,7 +88,7 @@ if (!is_array($config['ppps']['ppp'])) { $a_ppps = &$config['ppps']['ppp']; function remove_bad_chars($string) { - return preg_replace('/[^a-z_0-9]/i','',$string); + return preg_replace('/[^a-z_0-9]/i', '', $string); } if (!is_array($config['gateways']['gateway_item'])) { @@ -180,9 +180,9 @@ if ($wancfg['if'] == $a_ppps[$pppid]['if']) { } else if ($a_ppps[$pppid]['type'] == "pptp" || $a_ppps[$pppid]['type'] == "l2tp") { $pconfig['pptp_username'] = $a_ppps[$pppid]['username']; $pconfig['pptp_password'] = base64_decode($a_ppps[$pppid]['password']); - $pconfig['pptp_local'] = explode(",",$a_ppps[$pppid]['localip']); - $pconfig['pptp_subnet'] = explode(",",$a_ppps[$pppid]['subnet']); - $pconfig['pptp_remote'] = explode(",",$a_ppps[$pppid]['gateway']); + $pconfig['pptp_local'] = explode(",", $a_ppps[$pppid]['localip']); + $pconfig['pptp_subnet'] = explode(",", $a_ppps[$pppid]['subnet']); + $pconfig['pptp_remote'] = explode(",", $a_ppps[$pppid]['gateway']); $pconfig['pptp_dialondemand'] = isset($a_ppps[$pppid]['ondemand']); $pconfig['pptp_idletimeout'] = $a_ppps[$pppid]['timeout']; } @@ -255,7 +255,7 @@ $pconfig['enable'] = isset($wancfg['enable']); if (is_array($config['aliases']['alias'])) { foreach ($config['aliases']['alias'] as $alias) { if ($alias['name'] == $wancfg['descr']) { - $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."),$wancfg['descr']); + $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $wancfg['descr']); } } } @@ -504,7 +504,7 @@ if ($_POST['apply']) { } conf_mount_rw(); - /* filter out spaces from descriptions */ + /* filter out spaces from descriptions */ $_POST['descr'] = remove_bad_chars($_POST['descr']); /* okay first of all, cause we are just hiding the PPPoE HTML @@ -531,17 +531,17 @@ if ($_POST['apply']) { $input_errors[] = gettext("The interface description cannot contain only numbers."); } /* input validation */ - if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable']) && (! preg_match("/^staticv4/", $_POST['type']))) { + if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable']) && (!preg_match("/^staticv4/", $_POST['type']))) { $input_errors[] = gettext("The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration."); } - if (isset($config['dhcpdv6']) && isset($config['dhcpdv6'][$if]['enable']) && (! preg_match("/^staticv6/", $_POST['type6']))) { + if (isset($config['dhcpdv6']) && isset($config['dhcpdv6'][$if]['enable']) && (!preg_match("/^staticv6/", $_POST['type6']))) { $input_errors[] = gettext("The DHCP6 Server is active on this interface and it can be used only with a static IPv6 configuration. Please disable the DHCPv6 Server service on this interface first, then change the interface configuration."); } switch (strtolower($_POST['type'])) { case "staticv4": $reqdfields = explode(" ", "ipaddr subnet gateway"); - $reqdfieldsn = array(gettext("IPv4 address"),gettext("Subnet bit count"),gettext("Gateway")); + $reqdfieldsn = array(gettext("IPv4 address"), gettext("Subnet bit count"), gettext("Gateway")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; case "none": @@ -555,36 +555,36 @@ if ($_POST['apply']) { break; case "ppp": $reqdfields = explode(" ", "port phone"); - $reqdfieldsn = array(gettext("Modem Port"),gettext("Phone Number")); + $reqdfieldsn = array(gettext("Modem Port"), gettext("Phone Number")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; case "pppoe": if ($_POST['pppoe_dialondemand']) { $reqdfields = explode(" ", "pppoe_username pppoe_password pppoe_dialondemand pppoe_idletimeout"); - $reqdfieldsn = array(gettext("PPPoE username"),gettext("PPPoE password"),gettext("Dial on demand"),gettext("Idle timeout value")); + $reqdfieldsn = array(gettext("PPPoE username"), gettext("PPPoE password"), gettext("Dial on demand"), gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "pppoe_username pppoe_password"); - $reqdfieldsn = array(gettext("PPPoE username"),gettext("PPPoE password")); + $reqdfieldsn = array(gettext("PPPoE username"), gettext("PPPoE password")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; case "pptp": if ($_POST['pptp_dialondemand']) { $reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote pptp_dialondemand pptp_idletimeout"); - $reqdfieldsn = array(gettext("PPTP username"),gettext("PPTP password"),gettext("PPTP local IP address"),gettext("PPTP subnet"),gettext("PPTP remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value")); + $reqdfieldsn = array(gettext("PPTP username"), gettext("PPTP password"), gettext("PPTP local IP address"), gettext("PPTP subnet"), gettext("PPTP remote IP address"), gettext("Dial on demand"), gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote"); - $reqdfieldsn = array(gettext("PPTP username"),gettext("PPTP password"),gettext("PPTP local IP address"),gettext("PPTP subnet"),gettext("PPTP remote IP address")); + $reqdfieldsn = array(gettext("PPTP username"), gettext("PPTP password"), gettext("PPTP local IP address"), gettext("PPTP subnet"), gettext("PPTP remote IP address")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; case "l2tp": if ($_POST['pptp_dialondemand']) { $reqdfields = explode(" ", "pptp_username pptp_password pptp_remote pptp_dialondemand pptp_idletimeout"); - $reqdfieldsn = array(gettext("L2TP username"),gettext("L2TP password"),gettext("L2TP remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value")); + $reqdfieldsn = array(gettext("L2TP username"), gettext("L2TP password"), gettext("L2TP remote IP address"), gettext("Dial on demand"), gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "pptp_username pptp_password pptp_remote"); - $reqdfieldsn = array(gettext("L2TP username"),gettext("L2TP password"),gettext("L2TP remote IP address")); + $reqdfieldsn = array(gettext("L2TP username"), gettext("L2TP password"), gettext("L2TP remote IP address")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; @@ -592,7 +592,7 @@ if ($_POST['apply']) { switch (strtolower($_POST['type6'])) { case "staticv6": $reqdfields = explode(" ", "ipaddrv6 subnetv6 gatewayv6"); - $reqdfieldsn = array(gettext("IPv6 address"),gettext("Subnet bit count"),gettext("Gateway")); + $reqdfieldsn = array(gettext("IPv6 address"), gettext("Subnet bit count"), gettext("Gateway")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); break; case "none": @@ -606,7 +606,7 @@ if ($_POST['apply']) { break; case "dhcp6": if (in_array($wancfg['ipaddrv6'], array())) { - $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$_POST['type6']); + $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."), $_POST['type6']); } if ($_POST['dhcp6-ia-pd-send-hint'] && strtolower($_POST['dhcp6-ia-pd-len']) == 'none') { $input_errors[] = gettext('DHCPv6 Prefix Delegation size must be provided when Send IPv6 prefix hint flag is checked'); @@ -622,24 +622,24 @@ if ($_POST['apply']) { } } if (in_array($wancfg['ipaddrv6'], array())) { - $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$_POST['type6']); + $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."), $_POST['type6']); } break; case "6to4": foreach ($ifdescrs as $ifent => $ifdescr) { if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $_POST['type6'])) { - $input_errors[] = sprintf(gettext("You can only have one interface configured as 6to4."),$_POST['type6']); + $input_errors[] = sprintf(gettext("You can only have one interface configured as 6to4."), $_POST['type6']); break; } } if (in_array($wancfg['ipaddrv6'], array())) { - $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$_POST['type6']); + $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."), $_POST['type6']); } break; case "track6": /* needs to check if $track6-prefix-id is used on another interface */ if (in_array($wancfg['ipaddrv6'], array())) { - $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$_POST['type6']); + $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."), $_POST['type6']); } if ($_POST['track6-prefix-id--hex'] != "" && !is_numeric("0x" . $_POST['track6-prefix-id--hex'])) { @@ -656,8 +656,9 @@ if ($_POST['apply']) { } if ($config['interfaces'][$ifent]['ipaddrv6'] == 'track6' && $config['interfaces'][$ifent]['track6-interface'] == $_POST['track6-interface'] && - $config['interfaces'][$ifent]['track6-prefix-id'] == $track6_prefix_id) + $config['interfaces'][$ifent]['track6-prefix-id'] == $track6_prefix_id) { $input_errors[] = sprintf(gettext("This track6 prefix ID is already being used in %s."), $ifdescr); + } } } } @@ -948,7 +949,7 @@ if ($_POST['apply']) { if (strlen($_POST['key' . $i]) == 28) { continue; } - $input_errors[] = gettext("Invalid WEP key. Enter a valid 40, 64, 104 or 128 bit WEP key."); + $input_errors[] = gettext("Invalid WEP key. Enter a valid 40, 64, 104 or 128 bit WEP key."); break; } } @@ -1090,7 +1091,7 @@ if ($_POST['apply']) { } $wancfg['descr'] = remove_bad_chars($_POST['descr']); - $wancfg['enable'] = $_POST['enable'] == "yes" ? true : false; + $wancfg['enable'] = $_POST['enable'] == "yes" ? true : false; /* let return_gateways_array() do the magic on dynamic interfaces for us */ switch ($_POST['type']) { @@ -1747,12 +1748,12 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), function show_mon_config() { jQuery("#showmonbox").html(''); - jQuery('#showmon').css('display','block'); + jQuery('#showmon').css('display', 'block'); } function openwindow(url) { - var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150"); - if (oWin==null || typeof(oWin)=="undefined") { + var oWin = window.open(url, "pfSensePop", "width=620,height=400,top=150,left=150"); + if (oWin == null || typeof(oWin) == "undefined") { return false; } else { return true; @@ -1776,7 +1777,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), }); } }); - jQuery('#trcountry').css('display',"table-row"); + jQuery('#trcountry').css('display', "table-row"); } function providers_list() { @@ -1796,8 +1797,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), }); } }); - jQuery('#trprovider').css("display","table-row"); - jQuery('#trproviderplan').css("display","none"); + jQuery('#trprovider').css("display", "table-row"); + jQuery('#trproviderplan').css("display", "none"); } function providerplan_list() { @@ -1821,14 +1822,14 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), }); } }); - jQuery('#trproviderplan').css("display","table-row"); + jQuery('#trproviderplan').css("display", "table-row"); } function prefill_provider() { jQuery.ajax("getserviceproviders.php",{ type: 'post', data: {country : jQuery('#country').val(), provider : jQuery('#provider_list').val(), plan : jQuery('#providerplan').val()}, - success: function(data,textStatus,response) { + success: function(data, textStatus, response) { var xmldoc = response.responseXML; var provider = xmldoc.getElementsByTagName('connection')[0]; jQuery('#ppp_username').val(''); @@ -1869,7 +1870,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),

-

".gettext("You must apply the changes in order for them to take effect.")."

".gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?>


+

" . gettext("You must apply the changes in order for them to take effect.") . "

" . gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?>


{$alias_name['url']}
{$alias_ports_address}{$alias_ports_address}
{$alias_ports_address}
{$alias_addresses[$counter]}{$alias_details[$counter]}
@@ -2039,7 +2040,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), 0) { foreach ($a_gateways as $gateway) { - if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) { + if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) { ?> - + @@ -2307,7 +2308,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),         Presets:   FreeBSD Default   - Clear + Clear
Reboot: @@ -2315,8 +2316,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), Initial Interval:           - pfSense Default   - Saved Cfg + pfSense Default   + Saved Cfg
"); ?> @@ -2396,7 +2397,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
@@ -2568,7 +2569,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), - @@ -3229,10 +3230,11 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), @@ -3432,7 +3434,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), @@ -3663,7 +3665,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), />
+ "for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as"); ?>    @@ -3798,22 +3800,22 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), success: save_callback_v6 }); } - function addOption(selectbox,text,value) + function addOption(selectbox, text, value) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.append(optn); - selectbox.prop('selectedIndex',selectbox.children().length-1); + selectbox.prop('selectedIndex', selectbox.children().length - 1); jQuery('#notebox').html("

<\/strong> <\/a>.<\/p>"); } - function addOption_v6(selectbox,text,value) + function addOption_v6(selectbox, text, value) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.append(optn); - selectbox.prop('selectedIndex',selectbox.children().length-1); + selectbox.prop('selectedIndex', selectbox.children().length - 1); jQuery('#noteboxv6').html("

<\/strong> <\/a>.<\/p>"); } function report_failure(request, textStatus, errorThrown) { diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index c93e32c..03fe582 100644 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -41,7 +41,7 @@ ##|*MATCH=interfaces_assign.php* ##|-PRIV -$pgtitle = array(gettext("Interfaces"),gettext("Assign network ports")); +$pgtitle = array(gettext("Interfaces"), gettext("Assign network ports")); $shortcut_section = "interfaces"; require("guiconfig.inc"); @@ -56,7 +56,7 @@ require_once("rrd.inc"); function interface_assign_description($portinfo, $portname) { global $ovpn_descrs; if ($portinfo['isvlan']) { - $descr = sprintf(gettext('VLAN %1$s on %2$s'),$portinfo['tag'],$portinfo['if']); + $descr = sprintf(gettext('VLAN %1$s on %2$s'), $portinfo['tag'], $portinfo['if']); if ($portinfo['descr']) { $descr .= " (" . $portinfo['descr'] . ")"; } @@ -88,7 +88,7 @@ function interface_assign_description($portinfo, $portname) { $descr .= " (" . $portinfo['descr'] . ")"; } } elseif ($portinfo['isqinq']) { - $descr = $portinfo['descr']; + $descr = $portinfo['descr']; } elseif (substr($portname, 0, 4) == 'ovpn') { $descr = $portname . " (" . $ovpn_descrs[substr($portname, 5)] . ")"; } else { @@ -531,7 +531,7 @@ if ($input_errors) { $portinfo): ?> - $portinfo): ?> - $value) { $ifpriority[$key] = $value; @@ -101,7 +101,7 @@ if (isset($id) && $a_bridges[$id]) { $pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']); $ifpathcost = array(); foreach ($pconfig['ifpathcost'] as $cfg) { - list ($key, $value) = explode(":", $cfg); + list ($key, $value) = explode(":", $cfg); $embpathcfg[$key] = $value; foreach ($embpathcfg as $key => $value) { $ifpathcost[$key] = $value; @@ -273,7 +273,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("Interfaces"),gettext("Bridge"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("Bridge"), gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); @@ -339,7 +339,7 @@ function show_source_port_range() {

- +
/> />
" />
- + /
- /> + />
- /> + />
- /> + />

@@ -3588,14 +3590,14 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
- /> + />
- /> + />

: