summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/ecl.php72
-rw-r--r--etc/inc/auth.inc6
-rw-r--r--etc/inc/captiveportal.inc10
-rw-r--r--etc/inc/certs.inc8
-rw-r--r--etc/inc/config.console.inc5
-rw-r--r--etc/inc/config.lib.inc10
-rw-r--r--etc/inc/dyndns.class16
-rw-r--r--etc/inc/filter.inc2
-rw-r--r--etc/inc/filter_log.inc2
-rw-r--r--etc/inc/functions.inc2
-rw-r--r--etc/inc/gwlb.inc22
-rw-r--r--etc/inc/interfaces.inc28
-rw-r--r--etc/inc/ipsec.inc6
-rw-r--r--etc/inc/led.inc4
-rw-r--r--etc/inc/meta.inc8
-rw-r--r--etc/inc/notices.inc4
-rw-r--r--etc/inc/openvpn.inc24
-rw-r--r--etc/inc/pfsense-utils.inc88
-rw-r--r--etc/inc/priv.inc4
-rw-r--r--etc/inc/rrd.inc2
-rw-r--r--etc/inc/services.inc20
-rw-r--r--etc/inc/shaper.inc132
-rw-r--r--etc/inc/system.inc10
-rw-r--r--etc/inc/upgrade_config.inc4
-rw-r--r--etc/inc/util.inc14
-rw-r--r--etc/inc/voucher.inc12
-rw-r--r--etc/inc/vpn.inc13
-rw-r--r--etc/inc/vslb.inc12
-rwxr-xr-xetc/rc.banner4
-rwxr-xr-xetc/rc.captiveportal_configure_mac2
-rwxr-xr-xetc/rc.filter_synchronize2
-rwxr-xr-xetc/rc.firmware14
-rwxr-xr-xetc/rc.firmware_auto12
-rwxr-xr-xetc/rc.initial.setlanip2
-rw-r--r--usr/local/captiveportal/index.php45
-rw-r--r--usr/local/captiveportal/radius_accounting.inc8
-rw-r--r--usr/local/pkg/miniupnpd.inc24
-rwxr-xr-xusr/local/www/bandwidth_by_ip.php2
-rw-r--r--usr/local/www/carp_status.php2
-rw-r--r--usr/local/www/crash_reporter.php6
-rw-r--r--usr/local/www/diag_backup.php4
-rw-r--r--usr/local/www/diag_dns.php6
-rwxr-xr-xusr/local/www/diag_dump_states.php4
-rw-r--r--usr/local/www/diag_ipsec.php2
-rw-r--r--usr/local/www/diag_limiter_info.php2
-rw-r--r--usr/local/www/diag_logs_filter.php4
-rw-r--r--usr/local/www/diag_logs_filter_summary.php8
-rw-r--r--usr/local/www/diag_logs_ipsec.php4
-rw-r--r--usr/local/www/diag_logs_settings.php2
-rw-r--r--usr/local/www/diag_packet_capture.php2
-rw-r--r--usr/local/www/diag_pf_info.php2
-rw-r--r--usr/local/www/diag_states_summary.php2
-rw-r--r--usr/local/www/diag_system_activity.php2
-rw-r--r--usr/local/www/diag_system_pftop.php2
-rw-r--r--usr/local/www/edit.php8
-rw-r--r--usr/local/www/exec.php36
-rwxr-xr-xusr/local/www/fbegin.inc32
-rw-r--r--usr/local/www/firewall_aliases.php22
-rwxr-xr-xusr/local/www/firewall_aliases_edit.php10
-rwxr-xr-xusr/local/www/firewall_aliases_import.php6
-rw-r--r--usr/local/www/firewall_nat.php6
-rw-r--r--usr/local/www/firewall_nat_1to1.php2
-rw-r--r--usr/local/www/firewall_nat_1to1_edit.php10
-rw-r--r--usr/local/www/firewall_nat_edit.php40
-rw-r--r--usr/local/www/firewall_nat_npt.php2
-rw-r--r--usr/local/www/firewall_nat_npt_edit.php2
-rw-r--r--usr/local/www/firewall_nat_out.php4
-rw-r--r--usr/local/www/firewall_nat_out_edit.php38
-rw-r--r--usr/local/www/firewall_rules.php22
-rw-r--r--usr/local/www/firewall_rules_edit.php62
-rw-r--r--usr/local/www/firewall_schedule.php12
-rw-r--r--usr/local/www/firewall_schedule_edit.php78
-rw-r--r--usr/local/www/firewall_shaper.php11
-rw-r--r--usr/local/www/firewall_shaper_layer7.php30
-rw-r--r--usr/local/www/firewall_shaper_vinterface.php6
-rw-r--r--usr/local/www/firewall_shaper_wizards.php6
-rw-r--r--usr/local/www/firewall_virtual_ip.php14
-rw-r--r--usr/local/www/firewall_virtual_ip_edit.php20
-rw-r--r--usr/local/www/getserviceproviders.php18
-rw-r--r--usr/local/www/getstats.php6
-rwxr-xr-xusr/local/www/graph.php481
-rw-r--r--usr/local/www/graph_cpu.php210
-rw-r--r--usr/local/www/guiconfig.inc70
-rwxr-xr-xusr/local/www/halt.php4
-rwxr-xr-xusr/local/www/head.inc2
-rw-r--r--usr/local/www/headjs.php4
-rw-r--r--usr/local/www/ifstats.php6
-rw-r--r--usr/local/www/index.php60
-rw-r--r--usr/local/www/interfaces.php120
-rw-r--r--usr/local/www/interfaces_assign.php10
-rw-r--r--usr/local/www/interfaces_bridge.php2
-rw-r--r--usr/local/www/interfaces_bridge_edit.php14
-rw-r--r--usr/local/www/interfaces_gif.php4
-rw-r--r--usr/local/www/interfaces_gif_edit.php6
-rw-r--r--usr/local/www/interfaces_gre.php4
-rw-r--r--usr/local/www/interfaces_gre_edit.php6
-rw-r--r--usr/local/www/interfaces_groups.php4
-rw-r--r--usr/local/www/interfaces_groups_edit.php7
-rw-r--r--usr/local/www/interfaces_lagg.php4
-rw-r--r--usr/local/www/interfaces_lagg_edit.php2
-rw-r--r--usr/local/www/interfaces_ppps.php2
-rw-r--r--usr/local/www/interfaces_ppps_edit.php68
-rw-r--r--usr/local/www/interfaces_qinq.php4
-rw-r--r--usr/local/www/interfaces_qinq_edit.php6
-rw-r--r--usr/local/www/interfaces_vlan.php4
-rw-r--r--usr/local/www/interfaces_vlan_edit.php6
-rw-r--r--usr/local/www/interfaces_wireless.php2
-rw-r--r--usr/local/www/interfaces_wireless_edit.php4
-rw-r--r--usr/local/www/license.php2
-rw-r--r--usr/local/www/load_balancer_monitor.php8
-rw-r--r--usr/local/www/load_balancer_monitor_edit.php22
-rw-r--r--usr/local/www/load_balancer_pool.php14
-rw-r--r--usr/local/www/load_balancer_pool_edit.php12
-rw-r--r--usr/local/www/load_balancer_setting.php4
-rw-r--r--usr/local/www/load_balancer_virtual_server.php16
-rw-r--r--usr/local/www/load_balancer_virtual_server_edit.php8
-rwxr-xr-xusr/local/www/pkg.php40
-rw-r--r--usr/local/www/pkg_edit.php67
-rw-r--r--usr/local/www/pkg_mgr.php28
-rw-r--r--usr/local/www/pkg_mgr_install.php2
-rw-r--r--usr/local/www/pkg_mgr_installed.php42
-rw-r--r--usr/local/www/pkg_mgr_settings.php4
-rwxr-xr-xusr/local/www/reboot.php4
-rw-r--r--usr/local/www/services_captiveportal.php6
-rw-r--r--usr/local/www/services_captiveportal_mac.php4
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php14
-rw-r--r--usr/local/www/services_captiveportal_vouchers_edit.php4
-rw-r--r--usr/local/www/services_dhcp.php2
-rw-r--r--usr/local/www/services_dhcpv6.php2
-rw-r--r--usr/local/www/services_dhcpv6_edit.php2
-rw-r--r--usr/local/www/services_dnsmasq.php6
-rw-r--r--usr/local/www/services_dyndns_edit.php2
-rw-r--r--usr/local/www/services_igmpproxy_edit.php14
-rw-r--r--usr/local/www/services_rfc2136_edit.php2
-rw-r--r--usr/local/www/services_unbound_acls.php2
-rw-r--r--usr/local/www/services_wol_edit.php2
-rw-r--r--usr/local/www/shortcuts.inc4
-rwxr-xr-xusr/local/www/status.php88
-rw-r--r--usr/local/www/status_captiveportal.php2
-rw-r--r--usr/local/www/status_captiveportal_expire.php2
-rw-r--r--usr/local/www/status_captiveportal_test.php3
-rw-r--r--usr/local/www/status_captiveportal_voucher_rolls.php4
-rw-r--r--usr/local/www/status_captiveportal_vouchers.php4
-rw-r--r--usr/local/www/status_dhcp_leases.php23
-rw-r--r--usr/local/www/status_dhcpv6_leases.php24
-rw-r--r--usr/local/www/status_filter_reload.php10
-rwxr-xr-xusr/local/www/status_gateway_groups.php2
-rw-r--r--usr/local/www/status_gateways.php2
-rw-r--r--usr/local/www/status_graph.php8
-rw-r--r--usr/local/www/status_interfaces.php6
-rw-r--r--usr/local/www/status_lb_pool.php18
-rw-r--r--usr/local/www/status_lb_vs.php2
-rw-r--r--usr/local/www/status_ntpd.php12
-rw-r--r--usr/local/www/status_openvpn.php12
-rw-r--r--usr/local/www/status_queues.php13
-rw-r--r--usr/local/www/status_rrd_graph.php27
-rw-r--r--usr/local/www/status_rrd_graph_img.php34
-rw-r--r--usr/local/www/status_rrd_graph_settings.php2
-rwxr-xr-xusr/local/www/status_services.php2
-rw-r--r--usr/local/www/status_upnp.php2
-rw-r--r--usr/local/www/status_wireless.php6
-rw-r--r--usr/local/www/system_advanced_admin.php6
-rw-r--r--usr/local/www/system_advanced_notifications.php4
-rw-r--r--usr/local/www/system_certmanager.php2
-rw-r--r--usr/local/www/system_crlmanager.php11
-rw-r--r--usr/local/www/system_firmware.php4
-rw-r--r--usr/local/www/system_firmware_check.php10
-rw-r--r--usr/local/www/system_firmware_restorefullbackup.php10
-rw-r--r--usr/local/www/system_gateways_edit.php6
-rw-r--r--usr/local/www/system_groupmanager_addprivs.php2
-rwxr-xr-xusr/local/www/system_hasync.php8
-rw-r--r--usr/local/www/system_usermanager_addprivs.php2
-rw-r--r--usr/local/www/vpn_ipsec.php10
-rw-r--r--usr/local/www/vpn_ipsec_mobile.php6
-rw-r--r--usr/local/www/vpn_ipsec_phase2.php8
-rw-r--r--usr/local/www/vpn_ipsec_settings.php7
-rw-r--r--usr/local/www/vpn_l2tp.php28
-rw-r--r--usr/local/www/vpn_l2tp_users.php2
-rw-r--r--usr/local/www/vpn_l2tp_users_edit.php12
-rw-r--r--usr/local/www/vpn_openvpn_client.php2
-rw-r--r--usr/local/www/vpn_openvpn_csc.php2
-rw-r--r--usr/local/www/vpn_openvpn_server.php6
-rw-r--r--usr/local/www/vpn_pppoe.php2
-rw-r--r--usr/local/www/vpn_pppoe_edit.php13
-rw-r--r--usr/local/www/wizard.php14
-rwxr-xr-xusr/local/www/xmlrpc.php10
186 files changed, 1604 insertions, 1558 deletions
diff --git a/etc/ecl.php b/etc/ecl.php
index 9aa07d5..15205f1 100755
--- a/etc/ecl.php
+++ b/etc/ecl.php
@@ -1,5 +1,5 @@
<?php
-/*
+/*
external config loader
Copyright (C) 2010 Scott Ullrich
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
@@ -25,7 +25,7 @@
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-
+
Currently supported file system types: MS-Dos, FreeBSD UFS
*/
@@ -53,8 +53,9 @@ function get_disk_slices($disk) {
$slices_array = array();
$slices = trim(exec("/bin/ls " . escapeshellarg("/dev/" . $disk . "s*") . " 2>/dev/null"));
$slices = str_replace("/dev/", "", $slices);
- if($slices == "ls: No match.")
+ if ($slices == "ls: No match.") {
return;
+ }
$slices_array = explode(" ", $slices);
return $slices_array;
}
@@ -63,44 +64,50 @@ function get_disks() {
global $g, $debug;
$disks_array = array();
$disks_s = explode(" ", get_single_sysctl("kern.disks"));
- foreach($disks_s as $disk)
- if(trim($disk))
+ foreach ($disks_s as $disk) {
+ if (trim($disk)) {
$disks_array[] = $disk;
+ }
+ }
return $disks_array;
}
function discover_config($mountpoint) {
global $g, $debug;
$locations_to_check = array("/", "/config");
- foreach($locations_to_check as $ltc) {
+ foreach ($locations_to_check as $ltc) {
$tocheck = "/tmp/mnt/cf{$ltc}config.xml";
- if($debug) {
+ if ($debug) {
echo "\nChecking for $tocheck";
- if(file_exists($tocheck))
+ if (file_exists($tocheck)) {
echo " -> found!";
+ }
}
- if(file_exists($tocheck))
+ if (file_exists($tocheck)) {
return $tocheck;
+ }
}
return "";
}
function test_config($file_location) {
global $g, $debug;
- if(!$file_location)
+ if (!$file_location) {
return;
+ }
// config.xml was found. ensure it is sound.
$root_obj = trim("<{$g['xml_rootobj']}>");
$xml_file_head = exec("/usr/bin/head -2 " . escapeshellarg($file_location) . " | /usr/bin/tail -n1");
- if($debug) {
+ if ($debug) {
echo "\nroot obj = $root_obj";
echo "\nfile head = $xml_file_head";
}
- if($xml_file_head == $root_obj) {
+ if ($xml_file_head == $root_obj) {
// Now parse config to make sure
$config_status = config_validate($file_location);
- if($config_status)
+ if ($config_status) {
return true;
+ }
}
return false;
}
@@ -110,46 +117,53 @@ function find_config_xml() {
global $g, $debug;
$disks = get_disks();
// Safety check.
- if(!is_array($disks))
+ if (!is_array($disks)) {
return;
+ }
$boot_disk = get_boot_disk();
$swap_disks = get_swap_disks();
exec("/bin/mkdir -p /tmp/mnt/cf");
- foreach($disks as $disk) {
+ foreach ($disks as $disk) {
$slices = get_disk_slices($disk);
- if(is_array($slices)) {
- foreach($slices as $slice) {
- if($slice == "")
+ if (is_array($slices)) {
+ foreach ($slices as $slice) {
+ if ($slice == "") {
continue;
- if(stristr($slice, $boot_disk)) {
- if($debug)
+ }
+ if (stristr($slice, $boot_disk)) {
+ if ($debug) {
echo "\nSkipping boot device slice $slice";
+ }
continue;
}
- if(in_array($slice, $swap_disks)) {
- if($debug)
+ if (in_array($slice, $swap_disks)) {
+ if ($debug) {
echo "\nSkipping swap device slice $slice";
+ }
continue;
}
echo " $slice";
// First try msdos fs
- if($debug)
+ if ($debug) {
echo "\n/sbin/mount -t msdosfs /dev/{$slice} /tmp/mnt/cf 2>/dev/null \n";
+ }
$result = exec("/sbin/mount -t msdosfs /dev/{$slice} /tmp/mnt/cf 2>/dev/null");
// Next try regular fs (ufs)
- if(!$result) {
- if($debug)
+ if (!$result) {
+ if ($debug) {
echo "\n/sbin/mount /dev/{$slice} /tmp/mnt/cf 2>/dev/null \n";
+ }
$result = exec("/sbin/mount /dev/{$slice} /tmp/mnt/cf 2>/dev/null");
}
$mounted = trim(exec("/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep '/tmp/mnt/cf' | /usr/bin/wc -l"));
- if($debug)
+ if ($debug) {
echo "\nmounted: $mounted ";
- if(intval($mounted) > 0) {
+ }
+ if (intval($mounted) > 0) {
// Item was mounted - look for config.xml file
$config_location = discover_config($slice);
- if($config_location) {
- if(test_config($config_location)) {
+ if ($config_location) {
+ if (test_config($config_location)) {
// We have a valid configuration. Install it.
echo " -> found config.xml\n";
echo "Backing up old configuration...\n";
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 8b9377b..594b57b 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -1214,7 +1214,7 @@ function ldap_backed($username, $passwd, $authcfg) {
$ldac_splits = explode(";", $ldapauthcont);
/* setup the usercount so we think we haven't found anyone yet */
- $usercount = 0;
+ $usercount = 0;
/*****************************************************************/
/* We First find the user based on username and filter */
@@ -1242,9 +1242,9 @@ function ldap_backed($username, $passwd, $authcfg) {
}
/* Support legacy auth container specification. */
if (stristr($ldac_split, "DC=") || empty($ldapbasedn)) {
- $search = @$ldapfunc($ldap,$ldac_split,$ldapfilter);
+ $search = @$ldapfunc($ldap,$ldac_split,$ldapfilter);
} else {
- $search = @$ldapfunc($ldap,$ldapsearchbasedn,$ldapfilter);
+ $search = @$ldapfunc($ldap,$ldapsearchbasedn,$ldapfilter);
}
if (!$search) {
log_error(sprintf(gettext("Search resulted in error: %s"), ldap_error($ldap)));
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 0d46fec..1d95971 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1825,7 +1825,7 @@ function portal_hostname_from_client_ip($cliip) {
$ourhostname .= ":" . $listenporthttps;
}
} else {
- $listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : ($cpcfg['zoneid'] + 8000);
+ $listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : ($cpcfg['zoneid'] + 8000);
$ifip = portal_ip_from_client_ip($cliip);
if (!$ifip) {
$ourhostname = "{$config['system']['hostname']}.{$config['system']['domain']}";
@@ -1930,7 +1930,7 @@ function captiveportal_reapply_attributes($cpentry, $attributes) {
unset($bw_up_pipeno, $bw_down_pipeno, $bw_up, $bw_down);
}
-function portal_allow($clientip, $clientmac, $username, $password = null, $attributes = null, $pipeno = null, $radiusctx = null) {
+function portal_allow($clientip, $clientmac, $username, $password = null, $attributes = null, $pipeno = null, $radiusctx = null) {
global $redirurl, $g, $config, $type, $passthrumac, $_POST, $cpzone, $cpzoneid;
// Ensure we create an array if we are missing attributes
@@ -2073,9 +2073,9 @@ function portal_allow($clientip, $clientmac, $username, $password = null, $attri
}
}
if ($username == "unauthenticated") {
- $mac['descr'] = "Auto-added";
+ $mac['descr'] = "Auto-added";
} else {
- $mac['descr'] = "Auto-added for user {$username}";
+ $mac['descr'] = "Auto-added for user {$username}";
}
if (!empty($bw_up)) {
$mac['bw_up'] = $bw_up;
@@ -2149,7 +2149,7 @@ function portal_allow($clientip, $clientmac, $username, $password = null, $attri
/* encode password in Base64 just in case it contains commas */
$bpassword = base64_encode($password);
- $insertquery = "INSERT INTO captiveportal (allow_time, pipeno, ip, mac, username, sessionid, bpassword, session_timeout, idle_timeout, session_terminate_time, interim_interval, radiusctx) ";
+ $insertquery = "INSERT INTO captiveportal (allow_time, pipeno, ip, mac, username, sessionid, bpassword, session_timeout, idle_timeout, session_terminate_time, interim_interval, radiusctx) ";
$insertquery .= "VALUES ({$allow_time}, {$pipeno}, '{$clientip}', '{$clientmac}', '{$safe_username}', '{$sessionid}', '{$bpassword}', ";
$insertquery .= "{$session_timeout}, {$idle_timeout}, {$session_terminate_time}, {$interim_interval}, '{$radiusctx}')";
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc
index 75f9fd9..9c99952 100644
--- a/etc/inc/certs.inc
+++ b/etc/inc/certs.inc
@@ -153,7 +153,7 @@ function ca_chain(& $cert) {
return "";
}
-function ca_import(& $ca, $str, $key="", $serial=0) {
+function ca_import(& $ca, $str, $key = "", $serial = 0) {
global $config;
$ca['crt'] = base64_encode($str);
@@ -306,7 +306,7 @@ function cert_import(& $cert, $crt_str, $key_str) {
return true;
}
-function cert_create(& $cert, $caref, $keylen, $lifetime, $dn, $type="user", $digest_alg = "sha256") {
+function cert_create(& $cert, $caref, $keylen, $lifetime, $dn, $type = "user", $digest_alg = "sha256") {
$cert['type'] = $type;
@@ -692,7 +692,7 @@ function cert_in_use($certref) {
is_captiveportal_cert($certref));
}
-function crl_create(& $crl, $caref, $name, $serial=0, $lifetime=9999) {
+function crl_create(& $crl, $caref, $name, $serial = 0, $lifetime = 9999) {
global $config;
$ca =& lookup_ca($caref);
if (!$ca) {
@@ -732,7 +732,7 @@ function crl_update(& $crl) {
return $crl_res;
}
-function cert_revoke($cert, & $crl, $reason=OCSP_REVOKED_STATUS_UNSPECIFIED) {
+function cert_revoke($cert, & $crl, $reason = OCSP_REVOKED_STATUS_UNSPECIFIED) {
global $config;
if (is_cert_revoked($cert, $crl['refid'])) {
return true;
diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc
index 8640628..df3fa6f 100644
--- a/etc/inc/config.console.inc
+++ b/etc/inc/config.console.inc
@@ -175,7 +175,8 @@ EOD;
$config['system']['enablesshd'] = 'enabled';
$key = 'y';
- } else { //Manually assign interfaces
+ } else {
+ //Manually assign interfaces
if (in_array($key, array('y', 'Y'))) {
vlan_setup();
}
@@ -515,7 +516,7 @@ EOD;
if (!is_array($iflist)) {
echo gettext("No interfaces found!") . "\n";
} else {
- $vlan_capable=0;
+ $vlan_capable = 0;
foreach ($iflist as $iface => $ifa) {
if (is_jumbo_capable($iface)) {
echo sprintf("% -8s%s%s\n", $iface, $ifa['mac'],
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index 29c8817..5eb3d5c 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -898,9 +898,10 @@ function backup_config() {
function set_device_perms() {
$devices = array(
- 'pf' => array( 'user' => 'root',
- 'group' => 'proxy',
- 'mode' => 0660),
+ 'pf' => array(
+ 'user' => 'root',
+ 'group' => 'proxy',
+ 'mode' => 0660),
);
foreach ($devices as $name => $attr) {
@@ -975,8 +976,7 @@ function pfSense_clear_globals() {
$errorstr = "PHP ERROR: Type: {$error['type']}, File: {$error['file']}, Line: {$error['line']}, Message: {$error['message']}";
print($errorstr);
log_error($errorstr);
- } else
- if ($error['type'] != E_NOTICE) {
+ } else if ($error['type'] != E_NOTICE) {
$errorstr = "PHP WARNING: Type: {$error['type']}, File: {$error['file']}, Line: {$error['line']}, Message: {$error['message']}";
// XXX: comment out for now, should re-enable post-2.2
//print($errorstr);
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index ff708fd..29b5689 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -595,10 +595,10 @@
/* Setting Variables */
$hostname = "{$this->_dnsHost}.";
$ZoneID = $this->_dnsZoneID;
- $AccessKeyId=$this->_dnsUser;
- $SecretAccessKey=$this->_dnsPass;
- $NewIP=$this->_dnsIP;
- $NewTTL=$this->_dnsTTL;
+ $AccessKeyId = $this->_dnsUser;
+ $SecretAccessKey = $this->_dnsPass;
+ $NewIP = $this->_dnsIP;
+ $NewTTL = $this->_dnsTTL;
/* Include Route 53 Library Class */
require_once('/etc/inc/r53.class');
@@ -623,10 +623,10 @@
/* Get IP for your hostname in Route 53 */
if (false !== ($a_result = SearchRecords($records['ResourceRecordSets'], "$hostname"))) {
- $OldTTL=$a_result[0][TTL];
- $OldIP=$a_result[0][ResourceRecords][0];
+ $OldTTL = $a_result[0][TTL];
+ $OldIP = $a_result[0][ResourceRecords][0];
} else {
- $OldIP="";
+ $OldIP = "";
}
/* Check if we need to update DNS Record */
@@ -1231,7 +1231,7 @@
$lines = count($data)-1;
// loop over the lines
- for ($pos=0; ($successful_update || $pos == 0) && $pos < $lines; $pos++) {
+ for ($pos = 0; ($successful_update || $pos == 0) && $pos < $lines; $pos++) {
$resp = $data[$pos];
if (preg_match('/UAUTH/i', $resp)) {
$status = "DynDNS: The username specified is not authorized to update this hostname and domain.";
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 6439585..910ea80 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -3802,7 +3802,7 @@ function filter_tdr_install_cron($should_install) {
$config['cron']['item'] = array();
}
- $x=0;
+ $x = 0;
$is_installed = false;
foreach ($config['cron']['item'] as $item) {
if (strstr($item['command'], "filter_configure_sync")) {
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index 2276a1b..999d81a 100644
--- a/etc/inc/filter_log.inc
+++ b/etc/inc/filter_log.inc
@@ -156,7 +156,7 @@ function parse_filter_line($line) {
$flent['anchor'] = $rule_data[$field++];
$flent['tracker'] = $rule_data[$field++];
$flent['realint'] = $rule_data[$field++];
- $flent['interface'] = convert_real_interface_to_friendly_descr($flent['realint']);
+ $flent['interface'] = convert_real_interface_to_friendly_descr($flent['realint']);
$flent['reason'] = $rule_data[$field++];
$flent['act'] = $rule_data[$field++];
$flent['direction'] = $rule_data[$field++];
diff --git a/etc/inc/functions.inc b/etc/inc/functions.inc
index 0ccd845..2c8f4c8 100644
--- a/etc/inc/functions.inc
+++ b/etc/inc/functions.inc
@@ -81,7 +81,7 @@ if (!function_exists("get_menu_messages")) {
global $g, $config;
if (are_notices_pending()) {
$notices = get_notices();
- $requests=array();
+ $requests = array();
## Get Query Arguments from URL ###
foreach ($_REQUEST as $key => $value) {
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 724a714..0627cb3 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -267,10 +267,10 @@ EOD;
$apingercfg .= " srcip \"{$gwifip}\"\n";
## How often the probe should be sent
- if (!empty($gateway['interval']) && is_numeric($gateway['interval'])) {
+ if (!empty($gateway['interval']) && is_numeric($gateway['interval'])) {
$interval = intval($gateway['interval']); # Restrict to Integer
- if ($interval < 1) {
- $interval = 1; # Minimum
+ if ($interval < 1) {
+ $interval = 1; # Minimum
}
if ($interval != $apinger_default['interval']) { # If not default value
$apingercfg .= " interval " . $interval . "s\n";
@@ -281,8 +281,8 @@ EOD;
## for controlling "delay" alarms
if (!empty($gateway['avg_delay_samples']) && is_numeric($gateway['avg_delay_samples'])) {
$avg_delay_samples = intval($gateway['avg_delay_samples']); # Restrict to Integer
- if ($avg_delay_samples < 1) {
- $avg_delay_samples = 1; # Minimum
+ if ($avg_delay_samples < 1) {
+ $avg_delay_samples = 1; # Minimum
}
if ($avg_delay_samples != $apinger_default['avg_delay_samples']) { # If not default value
$apingercfg .= " avg_delay_samples " . $avg_delay_samples . "\n";
@@ -629,7 +629,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
break;
default:
$tunnelif = substr($ifcfg['if'], 0, 3);
- if (substr($ifcfg['if'], 0, 4) == "ovpn") {
+ if (substr($ifcfg['if'], 0, 4) == "ovpn") {
// if current iface is an ovpn server endpoint then check its type, skip tap only
if (substr($ifcfg['if'], 4, 1) == 's') {
$ovpnid = substr($ifcfg['if'], 5);
@@ -725,7 +725,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
break;
default:
$tunnelif = substr($ifcfg['if'], 0, 3);
- if (substr($ifcfg['if'], 0, 4) == "ovpn") {
+ if (substr($ifcfg['if'], 0, 4) == "ovpn") {
// if current iface is an ovpn server endpoint then check its type, skip tap only
if (substr($ifcfg['if'], 4, 1) == 's') {
$ovpnid = substr($ifcfg['if'], 5);
@@ -762,7 +762,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
$gateway['name'] = "{$friendly}{$ctype}";
$gateway['attribute'] = "system";
- if (($gateway['dynamic'] === "default") && ($found_defaultv6 == 0)) {
+ if (($gateway['dynamic'] === "default") && ($found_defaultv6 == 0)) {
$gateway['defaultgw'] = true;
$gateway['dynamic'] = true;
$found_defaultv6 = 1;
@@ -992,9 +992,9 @@ function return_gateway_groups_array() {
$gateway_groups_array[$group['name']]['ipprotocol'] = $gateway['ipprotocol'];
if (is_ipaddr($gatewayip)) {
$groupmember = array();
- $groupmember['int'] = $int;
- $groupmember['gwip'] = $gatewayip;
- $groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
+ $groupmember['int'] = $int;
+ $groupmember['gwip'] = $gatewayip;
+ $groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
if (is_array($gwvip_arr[$group['name']])&& !empty($gwvip_arr[$group['name']][$member])) {
$groupmember['vip'] = $gwvip_arr[$group['name']][$member];
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index ae44af4..a192591 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -235,7 +235,7 @@ function interface_vlan_configure(&$vlan) {
return;
}
$if = $vlan['if'];
- $vlanif = empty($vlan['vlanif']) ? "{$if}_vlan{$vlan['tag']}" : $vlan['vlanif'];
+ $vlanif = empty($vlan['vlanif']) ? "{$if}_vlan{$vlan['tag']}" : $vlan['vlanif'];
$tag = $vlan['tag'];
if (empty($if)) {
@@ -2020,12 +2020,12 @@ EOD;
mwexec("/bin/ps auxww|grep \"{$interface}\" |grep \"[3]gstats\" | awk '{print $2}' |xargs kill");
foreach ($ports as $port) {
if (preg_match("/huawei/i", implode("\n", $usbmodemoutput))) {
- $mondev = substr(basename($port), 0, -1);
+ $mondev = substr(basename($port), 0, -1);
$devlist = glob("/dev/{$mondev}?");
$mondev = basename(end($devlist));
}
if (preg_match("/zte/i", implode("\n", $usbmodemoutput))) {
- $mondev = substr(basename($port), 0, -1) . "1";
+ $mondev = substr(basename($port), 0, -1) . "1";
}
if ($mondev != '') {
log_error("Starting 3gstats.php on device '{$mondev}' for interface '{$interface}'");
@@ -2169,7 +2169,7 @@ function interface_proxyarp_configure($interface = "") {
mwexec_bg("/usr/local/sbin/choparp " . $args);
}
} else if (count($paa) > 0) {
- foreach ($paa as $paif => $paents) {
+ foreach ($paa as $paif => $paents) {
$paaifip = get_interface_ip($paif);
if (!is_ipaddr($paaifip)) {
continue;
@@ -3162,7 +3162,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
if ($wancfg['spoofmac'] && ($wancfg['spoofmac'] != $mac)) {
mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) .
" link " . escapeshellarg($wancfg['spoofmac']));
- } else {
+ } else {
if ($mac == "ff:ff:ff:ff:ff:ff") {
/* this is not a valid mac address. generate a
@@ -3963,7 +3963,7 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif) {
$id_assoc_statement_address .= ";\n";
}
- $id_assoc_statement_address .= "};\n";
+ $id_assoc_statement_address .= "};\n";
}
$id_assoc_statement_prefix = "";
@@ -4005,7 +4005,7 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif) {
$id_assoc_statement_prefix .= "\n";
}
- $id_assoc_statement_prefix .= "};\n";
+ $id_assoc_statement_prefix .= "};\n";
}
$authentication_statement = "";
@@ -4135,7 +4135,7 @@ EOD;
$subnetmask = gen_subnet_mask($wancfg['alias-subnet']);
$dhclientconf .= <<<EOD
alias {
- interface "{$wanif}";
+ interface "{$wanif}";
fixed-address {$wancfg['alias-address']};
option subnet-mask {$subnetmask};
}
@@ -4379,7 +4379,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan", $
if (stripos($interface, "_vip")) {
foreach ($config['virtualip']['vip'] as $counter => $vip) {
- if ($vip['mode'] == "carp") {
+ if ($vip['mode'] == "carp") {
if ($interface == "{$vip['interface']}_vip{$vip['vhid']}") {
return $vip['interface'];
}
@@ -4452,7 +4452,7 @@ function convert_friendly_interface_to_friendly_descr($interface) {
} else if (substr($interface, 0, 4) == '_vip') {
if (is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $counter => $vip) {
- if ($vip['mode'] == "carp") {
+ if ($vip['mode'] == "carp") {
if ($interface == "{$vip['interface']}_vip{$vip['vhid']}") {
return "{$vip['subnet']} - {$vip['descr']}";
}
@@ -5438,7 +5438,7 @@ function get_interfaces_with_gateway() {
$ints[$ifdescr] = $ifdescr;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn" ||
+ if (substr($ifname['if'], 0, 4) == "ovpn" ||
!empty($ifname['gateway'])) {
$ints[$ifdescr] = $ifdescr;
}
@@ -5463,7 +5463,7 @@ function interface_has_gateway($friendly) {
return true;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn") {
+ if (substr($ifname['if'], 0, 4) == "ovpn") {
return true;
}
$tunnelif = substr($ifname['if'], 0, 3);
@@ -5494,7 +5494,7 @@ function interface_has_gatewayv6($friendly) {
return true;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn") {
+ if (substr($ifname['if'], 0, 4) == "ovpn") {
return true;
}
$tunnelif = substr($ifname['if'], 0, 3);
@@ -5671,7 +5671,7 @@ function get_interface_mac($interface) {
******/
function generate_random_mac_address() {
$mac = "02";
- for ($x=0; $x<5; $x++) {
+ for ($x = 0; $x < 5; $x++) {
$mac .= ":" . dechex(rand(16, 255));
}
return $mac;
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc
index d8fa843..5c7d15d 100644
--- a/etc/inc/ipsec.inc
+++ b/etc/inc/ipsec.inc
@@ -220,7 +220,7 @@ function ipsec_get_phase1_src(& $ph1ent) {
$interfaceip = get_interface_ip($if);
}
} else {
- $interfaceip=$ph1ent['interface'];
+ $interfaceip = $ph1ent['interface'];
}
} else {
$if = "wan";
@@ -511,7 +511,7 @@ function ipsec_dump_spd() {
$upperspec = explode("/", $linea[0]);
$cursp['proto'] = $upperspec[0];
list($cursp['src'], $cursp['dst']) = explode("-", $upperspec[2]);
- $cursp['reqid'] = substr($upperspec[3], strpos($upperspec[3], "#")+1);
+ $cursp['reqid'] = substr($upperspec[3], strpos($upperspec[3], "#")+1);
break;
}
}
@@ -619,7 +619,7 @@ function ipsec_get_number_of_phase2($ikeid) {
global $config;
$a_phase2 = $config['ipsec']['phase2'];
- $nbph2=0;
+ $nbph2 = 0;
if (is_array($a_phase2) && count($a_phase2)) {
foreach ($a_phase2 as $ph2tmp) {
diff --git a/etc/inc/led.inc b/etc/inc/led.inc
index 1661950..a08eef4 100644
--- a/etc/inc/led.inc
+++ b/etc/inc/led.inc
@@ -29,7 +29,7 @@ function led_ctl($led, $str) {
/*
* Blink an LED at set speed from 1-9 (1=Very Fast, 9=Very Slow)
*/
-function led_blink($led, $speed=0) {
+function led_blink($led, $speed = 0) {
switch ($speed) {
case "reallyfast":
case "veryfast":
@@ -60,7 +60,7 @@ function led_blink($led, $speed=0) {
* Letters A-J are on from 1/10s to 1s
* Letters a-j are off from 1/10s to 1s
*/
-function led_pattern($led, $pattern, $repeat=true) {
+function led_pattern($led, $pattern, $repeat = true) {
/* End with a . to stop after one iteration. */
$end = $repeat ? "" : ".";
return led_ctl($led, "s{$pattern}{$end}");
diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc
index 520e622..ac8bdfc 100644
--- a/etc/inc/meta.inc
+++ b/etc/inc/meta.inc
@@ -95,9 +95,9 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
}
$fname = $fpath;
- $slash = strrpos($fname,"/");
+ $slash = strrpos($fname, "/");
if ($slash) {
- $fname = substr($fname,$slash + 1);
+ $fname = substr($fname, $slash + 1);
}
$fdata = @file_get_contents($fpath);
@@ -157,14 +157,14 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) {
$offset = $tagend_trm + 1;
if (is_array($taglist)) {
- if (!in_array($tagbeg,$taglist)) {
+ if (!in_array($tagbeg, $taglist)) {
continue;
}
}
$vals = array();
- $lines = explode("\n",$mdata);
+ $lines = explode("\n", $mdata);
foreach ($lines as $line) {
if (!strlen($line)) {
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc
index 1ea30c8..891c18b 100644
--- a/etc/inc/notices.inc
+++ b/etc/inc/notices.inc
@@ -346,7 +346,7 @@ function send_smtp_message($message, $subject = "(no subject)", $force = false)
$smtp->tls = (isset($config['notifications']['smtp']['tls'])) ? 1 : 0;
$smtp->debug = 0;
$smtp->html_debug = 0;
- $smtp->localhost=$config['system']['hostname'].".".$config['system']['domain'];
+ $smtp->localhost = $config['system']['hostname'] . "." . $config['system']['domain'];
if ($config['notifications']['smtp']['fromaddress']) {
$from = $config['notifications']['smtp']['fromaddress'];
@@ -410,7 +410,7 @@ function notify_via_growl($message, $force=false) {
$growl_name = $config['notifications']['growl']['name'];
$growl_notification = $config['notifications']['growl']['notification_name'];
- if(!empty($growl_ip) && (is_ipaddr($growl_ip) || dns_get_record($growl_ip, DNS_A) || dns_get_record($growl_ip, DNS_AAAA))) {
+ if (!empty($growl_ip) && (is_ipaddr($growl_ip) || dns_get_record($growl_ip, DNS_A) || dns_get_record($growl_ip, DNS_AAAA))) {
$growl = new Growl($growl_ip, $growl_password, $growl_name);
$growl->notify("{$growl_notification}", gettext(sprintf("%s (%s) - Notification", $g['product_name'], $hostname)), "{$message}");
}
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index fba87da..6e81c03 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -526,14 +526,14 @@ function openvpn_reconfigure($mode, $settings) {
// Otherwise, if a specific interface is requested, use it
// If "any" interface was selected, local directive will be omitted.
if (is_ipaddrv4($ipaddr)) {
- $iface_ip=$ipaddr;
+ $iface_ip = $ipaddr;
} else {
if ((!empty($interface)) && (strcmp($interface, "any"))) {
$iface_ip=get_interface_ip($interface);
}
}
if (is_ipaddrv6($ipaddr)) {
- $iface_ipv6=$ipaddr;
+ $iface_ipv6 = $ipaddr;
} else {
if ((!empty($interface)) && (strcmp($interface, "any"))) {
$iface_ipv6=get_interface_ipv6($interface);
@@ -1326,7 +1326,7 @@ function openvpn_get_active_clients() {
$client['vpnid'] = $settings['vpnid'];
$client['mgmt'] = "client{$client['vpnid']}";
$socket = "unix://{$g['varetc_path']}/openvpn/{$client['mgmt']}.sock";
- $client['status']="down";
+ $client['status'] = "down";
$clients[] = openvpn_get_client_status($client, $socket);
}
@@ -1355,28 +1355,28 @@ function openvpn_get_client_status($client, $socket) {
/* Get the client state */
if (strstr($line, "CONNECTED")) {
- $client['status']="up";
+ $client['status'] = "up";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
- $client['virtual_addr'] = $list[3];
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['virtual_addr'] = $list[3];
$client['remote_host'] = $list[4];
}
if (strstr($line, "CONNECTING")) {
- $client['status']="connecting";
+ $client['status'] = "connecting";
}
if (strstr($line, "ASSIGN_IP")) {
- $client['status']="waiting";
+ $client['status'] = "waiting";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
- $client['virtual_addr'] = $list[3];
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['virtual_addr'] = $list[3];
}
if (strstr($line, "RECONNECTING")) {
- $client['status']="reconnecting";
+ $client['status'] = "reconnecting";
$list = explode(",", $line);
- $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
+ $client['connect_time'] = date("D M j G:i:s Y", $list[0]);
$client['status'] .= "; " . $list[2];
}
/* parse end of output line */
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 9986f52..a4ef718 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -98,7 +98,7 @@ function does_url_exist($url) {
******/
function is_private_ip($iptocheck) {
$isprivate = false;
- $ip_private_list=array(
+ $ip_private_list = array(
"10.0.0.0/8",
"100.64.0.0/10",
"172.16.0.0/12",
@@ -498,7 +498,7 @@ function WakeOnLan($addr, $mac) {
$addr_byte = explode(':', $mac);
$hw_addr = '';
- for ($a=0; $a < 6; $a++) {
+ for ($a = 0; $a < 6; $a++) {
$hw_addr .= chr(hexdec($addr_byte[$a]));
}
@@ -515,7 +515,7 @@ function WakeOnLan($addr, $mac) {
log_error(sprintf(gettext("Error code is '%1\$s' - %2\$s"), socket_last_error($s), socket_strerror(socket_last_error($s))));
} else {
// setting a broadcast option to socket:
- $opt_ret = socket_set_option($s, 1, 6, TRUE);
+ $opt_ret = socket_set_option($s, 1, 6, TRUE);
if ($opt_ret < 0) {
log_error(sprintf(gettext("setsockopt() failed, error: %s"), strerror($opt_ret)));
}
@@ -981,7 +981,7 @@ function reload_all_sync() {
send_event("service restart webgui");
}
-function setup_serial_port($when="save", $path="") {
+function setup_serial_port($when = "save", $path = "") {
global $g, $config;
conf_mount_rw();
$ttys_file = "{$path}/etc/ttys";
@@ -1260,7 +1260,7 @@ function is_pppoe_server_enabled() {
}
function convert_seconds_to_hms($sec) {
- $min=$hrs=0;
+ $min = $hrs = 0;
if ($sec != 0) {
$min = floor($sec/60);
$sec %= 60;
@@ -1288,7 +1288,7 @@ function get_ppp_uptime($port) {
if (file_exists("/conf/{$port}.log")) {
$saved_time = file_get_contents("/conf/{$port}.log");
$uptime_data = explode("\n", $saved_time);
- $sec=0;
+ $sec = 0;
foreach ($uptime_data as $upt) {
$sec += substr($upt, 1 + strpos($upt, " "));
}
@@ -1770,10 +1770,11 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- if (!isset($config['system']['host_uuid']))
+ if (!isset($config['system']['host_uuid'])) {
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
- else
+ } else {
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
+ }
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
@@ -1793,10 +1794,10 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout
return ($http_code == 200) ? true : $http_code;
}
-function download_file_with_progress_bar($url_file, $destination_file, $readbody = 'read_body', $connect_timeout = 5, $timeout=0) {
+function download_file_with_progress_bar($url_file, $destination_file, $readbody = 'read_body', $connect_timeout = 5, $timeout = 0) {
global $config, $g;
global $ch, $fout, $file_size, $downloaded, $config, $first_progress_update;
- $file_size = 1;
+ $file_size = 1;
$downloaded = 1;
$first_progress_update = TRUE;
/* open destination file */
@@ -1815,10 +1816,11 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody
curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- if (!isset($config['system']['host_uuid']))
+ if (!isset($config['system']['host_uuid'])) {
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
- else
+ } else {
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
+ }
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
@@ -2354,21 +2356,21 @@ function nanobsd_switch_boot_slice() {
}
ob_implicit_flush(1);
if (strstr($slice, "s2")) {
- $ASLICE="2";
- $AOLDSLICE="1";
- $AGLABEL_SLICE="pfsense1";
- $AUFS_ID="1";
- $AOLD_UFS_ID="0";
+ $ASLICE = "2";
+ $AOLDSLICE = "1";
+ $AGLABEL_SLICE = "pfsense1";
+ $AUFS_ID = "1";
+ $AOLD_UFS_ID = "0";
} else {
- $ASLICE="1";
- $AOLDSLICE="2";
- $AGLABEL_SLICE="pfsense0";
- $AUFS_ID="0";
- $AOLD_UFS_ID="1";
- }
- $ATOFLASH="{$BOOT_DRIVE}s{$ASLICE}";
- $ACOMPLETE_PATH="{$BOOT_DRIVE}s{$ASLICE}a";
- $ABOOTFLASH="{$BOOT_DRIVE}s{$AOLDSLICE}";
+ $ASLICE = "1";
+ $AOLDSLICE = "2";
+ $AGLABEL_SLICE = "pfsense0";
+ $AUFS_ID = "0";
+ $AOLD_UFS_ID = "1";
+ }
+ $ATOFLASH = "{$BOOT_DRIVE}s{$ASLICE}";
+ $ACOMPLETE_PATH = "{$BOOT_DRIVE}s{$ASLICE}a";
+ $ABOOTFLASH = "{$BOOT_DRIVE}s{$AOLDSLICE}";
conf_mount_rw();
set_single_sysctl("kern.geom.debugflags", "16");
exec("gpart set -a active -i {$ASLICE} {$BOOT_DRIVE}");
@@ -2442,23 +2444,23 @@ function nanobsd_detect_slice_info() {
// Detect which slice is active and set information.
if (strstr($REAL_BOOT_DEVICE, "s1")) {
- $SLICE="2";
- $OLDSLICE="1";
- $GLABEL_SLICE="pfsense1";
- $UFS_ID="1";
- $OLD_UFS_ID="0";
+ $SLICE = "2";
+ $OLDSLICE = "1";
+ $GLABEL_SLICE = "pfsense1";
+ $UFS_ID = "1";
+ $OLD_UFS_ID = "0";
} else {
- $SLICE="1";
- $OLDSLICE="2";
- $GLABEL_SLICE="pfsense0";
- $UFS_ID="0";
- $OLD_UFS_ID="1";
+ $SLICE = "1";
+ $OLDSLICE = "2";
+ $GLABEL_SLICE = "pfsense0";
+ $UFS_ID = "0";
+ $OLD_UFS_ID = "1";
}
- $TOFLASH="{$BOOT_DRIVE}s{$SLICE}";
- $COMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
- $COMPLETE_BOOT_PATH="{$BOOT_DRIVE}s{$OLDSLICE}";
- $BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
+ $TOFLASH = "{$BOOT_DRIVE}s{$SLICE}";
+ $COMPLETE_PATH = "{$BOOT_DRIVE}s{$SLICE}a";
+ $COMPLETE_BOOT_PATH = "{$BOOT_DRIVE}s{$OLDSLICE}";
+ $BOOTFLASH = "{$BOOT_DRIVE}s{$OLDSLICE}";
}
function nanobsd_friendly_slice_name($slicename) {
@@ -2657,7 +2659,7 @@ function generate_ipv6_from_mac($mac) {
$ipv6 = "fe80::";
foreach ($elements as $byte) {
if ($i == 0) {
- $hexadecimal = substr($byte, 1, 2);
+ $hexadecimal = substr($byte, 1, 2);
$bitmap = base_convert($hexadecimal, 16, 2);
$bitmap = str_pad($bitmap, 4, "0", STR_PAD_LEFT);
$bitmap = substr($bitmap, 0, 2) ."1". substr($bitmap, 3, 4);
@@ -2697,7 +2699,7 @@ function load_mac_manufacturer_table() {
foreach ($macs as $line) {
if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)) {
/* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
+ $mac_man["$matches[1]"] = $matches[2];
}
}
return $mac_man;
@@ -2819,7 +2821,7 @@ function where_is_ipaddr_configured($ipaddr, $ignore_if = "", $check_localip = f
$interface_list_vips = get_configured_vips_list(true);
foreach ($interface_list_vips as $id => $vip) {
/* Skip CARP interfaces here since they were already checked above */
- if ($id == $ignore_vip_id || (substr($ignore_if, 0, 4) == '_vip') && substr($ignore_vip_if, 5) == $vip['uniqdid']) {
+ if ($id == $ignore_vip_id || (substr($ignore_if, 0, 4) == '_vip') && substr($ignore_vip_if, 5) == $vip['uniqdid']) {
continue;
}
if (strcasecmp($ipaddr, $vip['ipaddr']) == 0) {
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index 45dcc3b..7549844 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -133,7 +133,7 @@ function cmp_page_matches($page, & $matches, $fullwc = true) {
}
/* compare exact or wildcard match */
- $match = str_replace(array(".", "*", "?"), array("\.", ".*", "\?"), $match);
+ $match = str_replace(array(".", "*", "?"), array("\.", ".*", "\?"), $match);
$result = preg_match("@^/{$match}$@", "/{$page}");
if ($result) {
@@ -328,7 +328,7 @@ function sort_user_privs($privs) {
$priority_privs = array("page-dashboard-all", "page-system-login/logout");
$fprivs = array_intersect($privs, $priority_privs);
- $sprivs = array_diff($privs, $priority_privs);
+ $sprivs = array_diff($privs, $priority_privs);
return array_merge($fprivs, $sprivs);
}
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index d0f14ec..b15f8eb 100644
--- a/etc/inc/rrd.inc
+++ b/etc/inc/rrd.inc
@@ -485,7 +485,7 @@ function enable_rrd_graphing() {
break;
}
$qbandwidth = $altq->GetBandwidth() * $factor;
- if ($qbandwidth <=0) {
+ if ($qbandwidth <= 0) {
$qbandwidth = 100 * 1000 * 1000; /* 100Mbit */
}
$qlist =& $altq->get_queue_list($notused);
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 8ea9f9d..c0a2b34 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -410,7 +410,7 @@ function services_dhcpd_configure($family = "all", $blacklist = array()) {
fwrite($fd, "/bin/cp -n /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
fwrite($fd, "/bin/chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n");
- $status = `/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep "{$g['dhcpd_chroot_path']}/dev"`;
+ $status = `/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep "{$g['dhcpd_chroot_path']}/dev"`;
if (!trim($status)) {
fwrite($fd, "/sbin/mount -t devfs devfs {$g['dhcpd_chroot_path']}/dev\n");
}
@@ -600,7 +600,7 @@ EOD;
$my_port = "519";
$peer_port = "520";
$type = "primary";
- $dhcpdconf_pri = "split 128;\n";
+ $dhcpdconf_pri = "split 128;\n";
$dhcpdconf_pri .= " mclt 600;\n";
}
@@ -1622,7 +1622,7 @@ function services_dhcrelay_configure() {
if (!is_ipaddr($subnet)) {
continue;
}
- $subnet .= "/" . get_interface_subnet($ifname);
+ $subnet .= "/" . get_interface_subnet($ifname);
if (ip_in_subnet($srvip, $subnet)) {
$destif = get_real_interface($ifname);
break;
@@ -1688,10 +1688,10 @@ function services_dhcrelay_configure() {
return; /* XXX */
}
- $cmd = "/usr/local/sbin/dhcrelay -i " . implode(" -i ", $dhcrelayifs);
+ $cmd = "/usr/local/sbin/dhcrelay -i " . implode(" -i ", $dhcrelayifs);
if (isset($dhcrelaycfg['agentoption'])) {
- $cmd .= " -a -m replace";
+ $cmd .= " -a -m replace";
}
$cmd .= " " . implode(" ", $srvips);
@@ -1755,7 +1755,7 @@ function services_dhcrelay6_configure() {
if (!is_ipaddrv6($subnet)) {
continue;
}
- $subnet .= "/" . get_interface_subnetv6($ifname);
+ $subnet .= "/" . get_interface_subnetv6($ifname);
if (ip_in_subnet($srvip, $subnet)) {
$destif = get_real_interface($ifname);
break;
@@ -1848,8 +1848,8 @@ function services_dyndns_configure_client($conf) {
$dnsPort = NULL,
$dnsUpdateURL = "{$conf['updateurl']}",
$forceUpdate = $conf['force'],
- $dnsZoneID=$conf['zoneid'],
- $dnsTTL=$conf['ttl'],
+ $dnsZoneID = $conf['zoneid'],
+ $dnsTTL = $conf['ttl'],
$dnsResultMatch = "{$conf['resultmatch']}",
$dnsRequestIf = "{$conf['requestif']}",
$dnsID = "{$conf['id']}",
@@ -2621,7 +2621,7 @@ function upnp_start() {
}
}
-function install_cron_job($command, $active=false, $minute="0", $hour="*", $monthday="*", $month="*", $weekday="*", $who="root") {
+function install_cron_job($command, $active = false, $minute = "0", $hour = "*", $monthday = "*", $month = "*", $weekday = "*", $who = "root") {
global $config, $g;
$is_installed = false;
@@ -2634,7 +2634,7 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
$config['cron']['item'] = array();
}
- $x=0;
+ $x = 0;
foreach ($config['cron']['item'] as $item) {
if (strstr($item['command'], $command)) {
$is_installed = true;
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 416f920..9f2f4b6 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -525,7 +525,7 @@ class altq_root_queue {
function &find_parentqueue($interface, $qname) {
if ($qname == $interface) {
- $result = NULL;
+ $result = NULL;
} else if ($this->queues[$qname]) {
$result = $this;
} else if ($this->GetScheduler() <> "PRIQ") {
@@ -545,7 +545,7 @@ class altq_root_queue {
$tree .= "\">" . $shaperIFlist[$this->GetInterface()] . "</a>";
if (is_array($this->queues)) {
$tree .= "<ul>";
- foreach ($this->queues as $q) {
+ foreach ($this->queues as $q) {
$tree .= $q->build_tree();
}
$tree .= "</ul>";
@@ -707,7 +707,7 @@ class altq_root_queue {
$form .= "<br /></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on") {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /><span class=\"vexpl\"> " . gettext("Enable/disable discipline and its children") . "</span>";
$form .= "</td></tr>";
@@ -790,8 +790,8 @@ class altq_root_queue {
$form .= "\" />";
$form .= "<br /> <span class=\"vexpl\">";
$form .= gettext("Adjusts the size, in bytes, of the token bucket regulator. "
- . "If not specified, heuristics based on the interface "
- . "bandwidth are used to determine the size.");
+ . "If not specified, heuristics based on the interface "
+ . "bandwidth are used to determine the size.");
$form .= "</span></td></tr>";
$form .= "<input type=\"hidden\" id=\"interface\" name=\"interface\"";
$form .= " value=\"" . $this->GetInterface() . "\" />";
@@ -1278,7 +1278,7 @@ class priq_queue {
$form .= "<br /></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on") {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /><span class=\"vexpl\"> " . gettext("Enable/Disable queue and its children") . "</span>";
$form .= "</td></tr>";
@@ -1322,25 +1322,25 @@ class priq_queue {
$form .= "<input type=\"checkbox\" id=\"red\" name=\"red\" value=\"red\" ";
$tmpvalue = $this->GetRed();
if (!empty($tmpvalue)) {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#red\">" . gettext("Random Early Detection") . "</a><br />";
$form .= "<input type=\"checkbox\" id=\"rio\" name=\"rio\" value=\"rio\"";
$tmpvalue = $this->GetRio();
if (!empty($tmpvalue)) {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#rio\">" . gettext("Random Early Detection In and Out") . "</a><br />";
$form .= "<input type=\"checkbox\" id=\"ecn\" name=\"ecn\" value=\"ecn\"";
$tmpvalue = $this->GetEcn();
if (!empty($tmpvalue)) {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#ecn\">" . gettext("Explicit Congestion Notification") . "</a><br />";
$form .= "<input type=\"checkbox\" id=\"codel\" name=\"codel\" value=\"codel\"";
$tmpvalue = $this->GetCodel();
if (!empty($tmpvalue)) {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /> <a target=\"_new\" href=\"http://www.bufferbloat.net/projects/codel/wiki\">" . gettext("Codel Active Queue") . "</a><br />";
$form .= "<span class=\"vexpl\"><br />" . gettext("Select options for this queue");
@@ -1698,7 +1698,7 @@ class hfsc_queue extends priq_queue {
unref_on_altq_queue_list($this->GetQname());
cleanup_queue_from_rules($this->GetQname());
$parent =& $this->GetParent();
- foreach ($this->subqueues as $q) {
+ foreach ($this->subqueues as $q) {
$this->SetAvailableBandwidth($this->GetAvailableBandwidth() + $q->GetAvailableBandwidth());
$q->delete_queue();
}
@@ -1772,10 +1772,10 @@ class hfsc_queue extends priq_queue {
*/
}
- if ($data['upperlimit1'] <> "" && $data['upperlimit2'] == "") {
+ if ($data['upperlimit1'] <> "" && $data['upperlimit2'] == "") {
$input_errors[] = gettext("upperlimit service curve defined but missing (d) value");
}
- if ($data['upperlimit2'] <> "" && $data['upperlimit1'] == "") {
+ if ($data['upperlimit2'] <> "" && $data['upperlimit1'] == "") {
$input_errors[] = gettext("upperlimit service curve defined but missing initial bandwidth (m1) value");
}
if ($data['upperlimit1'] <> "" && !is_valid_shaperbw($data['upperlimit1'])) {
@@ -1801,10 +1801,10 @@ class hfsc_queue extends priq_queue {
}
}
*/
- if ($data['linkshare1'] <> "" && $data['linkshare2'] == "") {
+ if ($data['linkshare1'] <> "" && $data['linkshare2'] == "") {
$input_errors[] = gettext("linkshare service curve defined but missing (d) value");
}
- if ($data['linkshare2'] <> "" && $data['linkshare1'] == "") {
+ if ($data['linkshare2'] <> "" && $data['linkshare1'] == "") {
$input_errors[] = gettext("linkshare service curve defined but missing initial bandwidth (m1) value");
}
if ($data['linkshare1'] <> "" && !is_valid_shaperbw($data['linkshare1'])) {
@@ -1816,10 +1816,10 @@ class hfsc_queue extends priq_queue {
if ($data['linkshare3'] <> "" && !is_valid_shaperbw($data['linkshare3'])) {
$input_errors[] = gettext("linkshare m2 value needs to be Kb, Mb, Gb, or %");
}
- if ($data['realtime1'] <> "" && $data['realtime2'] == "") {
+ if ($data['realtime1'] <> "" && $data['realtime2'] == "") {
$input_errors[] = gettext("realtime service curve defined but missing (d) value");
}
- if ($data['realtime2'] <> "" && $data['realtime1'] == "") {
+ if ($data['realtime2'] <> "" && $data['realtime1'] == "") {
$input_errors[] = gettext("realtime service curve defined but missing initial bandwidth (m1) value");
}
@@ -1927,7 +1927,7 @@ class hfsc_queue extends priq_queue {
$tree .= " >" . $this->GetQname() . "</a>";
if (is_array($this->subqueues)) {
$tree .= "<ul>";
- foreach ($this->subqueues as $q) {
+ foreach ($this->subqueues as $q) {
$tree .= $q->build_tree();
}
$tree .= "</ul>";
@@ -1993,13 +1993,13 @@ class hfsc_queue extends priq_queue {
$default = true;
}
- if ($this->GetRealtime() <> "") {
+ if ($this->GetRealtime() <> "") {
if ($comma) {
$pfq_rule .= " , ";
}
- if ($this->GetR_m1() <> "" && $this->GetR_d() <> "" && $this->GetR_m2() <> "") {
+ if ($this->GetR_m1() <> "" && $this->GetR_d() <> "" && $this->GetR_m2() <> "") {
$pfq_rule .= " realtime (".$this->GetR_m1() . ", " . $this->GetR_d().", ". $this->GetR_m2() .") ";
- } else if ($this->GetR_m2() <> "") {
+ } else if ($this->GetR_m2() <> "") {
$pfq_rule .= " realtime " . $this->GetR_m2();
}
$comma = 1;
@@ -2136,7 +2136,7 @@ class hfsc_queue extends priq_queue {
$form .= "<tr><td>&nbsp;</td><td><center>m1</center></td><td><center>d</center></td><td><center><b>m2</b></center></td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"upperlimit\" name=\"upperlimit\"";
if ($this->GetUpperlimit()<> "") {
- $form .= " checked=\"checked\" ";
+ $form .= " checked=\"checked\" ";
}
$form .= "onchange=\"enable_upperlimit()\" /> " . gettext("Upperlimit:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->GetU_m1());
@@ -2159,7 +2159,7 @@ class hfsc_queue extends priq_queue {
$form .= " /></td><td>" . gettext("The maximum allowed bandwidth for the queue.") . "</td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"realtime\" name=\"realtime\"";
if ($this->GetRealtime() <> "") {
- $form .= " checked=\"checked\" ";
+ $form .= " checked=\"checked\" ";
}
$form .= "onchange=\"enable_realtime()\" /> " . gettext("Real time:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->GetR_m1());
@@ -2182,7 +2182,7 @@ class hfsc_queue extends priq_queue {
$form .= " /></td><td>" . gettext("The minimum required bandwidth for the queue.") . "</td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"linkshare\" name=\"linkshare\"";
if ($this->GetLinkshare() <> "") {
- $form .= " checked=\"checked\" ";
+ $form .= " checked=\"checked\" ";
}
$form .= "onchange=\"enable_linkshare()\" /> " . gettext("Link share:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->GetL_m1());
@@ -2205,9 +2205,9 @@ class hfsc_queue extends priq_queue {
$form .= " /></td><td>" . gettext("The bandwidth share of a backlogged queue - this overrides priority.") . "</td></tr>";
$form .= "</table><br />";
$form .= gettext("The format for service curve specifications is (m1, d, m2). m2 controls "
- . "the bandwidth assigned to the queue. m1 and d are optional and can be "
- . "used to control the initial bandwidth assignment. For the first d milliseconds the queue gets the bandwidth given as m1, afterwards the value "
- . "given in m2.");
+ . "the bandwidth assigned to the queue. m1 and d are optional and can be "
+ . "used to control the initial bandwidth assignment. For the first d milliseconds the queue gets the bandwidth given as m1, afterwards the value "
+ . "given in m2.");
$form .= "</td>";
$form .= "</tr>";
@@ -2543,7 +2543,7 @@ class cbq_queue extends priq_queue {
$tree .= " >" . $this->GetQname() . "</a>";
if (is_array($this->subqueues)) {
$tree .= "<ul>";
- foreach ($this->subqueues as $q) {
+ foreach ($this->subqueues as $q) {
$tree .= $q->build_tree();
}
$tree .= "</ul>";
@@ -2677,7 +2677,7 @@ class cbq_queue extends priq_queue {
$form .= "<tr><td class=\"vncellreq\">" . gettext("Scheduler specific options") . "</td>";
$form .= "<td class=\"vtable\"><input type=\"checkbox\" id=\"borrow\" name=\"borrow\"";
if ($this->GetBorrow() == "on") {
- $form .= " checked=\"checked\" ";
+ $form .= " checked=\"checked\" ";
}
$form .= " /> " . gettext("Borrow from other queues when available") . "<br /></td></tr>";
@@ -2989,13 +2989,13 @@ class fairq_queue extends priq_queue {
$form .= "<input id=\"buckets\" name=\"buckets\" value=\"";
$tmpvalue = trim($this->GetBuckets());
if (!empty($tmpvalue)) {
- $form .= $this->GetBuckets();
+ $form .= $this->GetBuckets();
}
$form .= "\" /> " . gettext("Number of buckets available.") . "<br /></td></tr>";
$form .= "<tr><td class=\"vtable\"><input id=\"hogs\" name=\"hogs\" value=\"";
$tmpvalue = trim($this->GetHogs());
if (!empty($tmpvalue)) {
- $form .= $this->GetHogs();
+ $form .= $this->GetHogs();
}
$form .= "\" /> " . gettext("Bandwidth limit for hosts to not saturate link.") . "<br /></td></tr>";
$form .= "</table></td></tr>";
@@ -3481,7 +3481,7 @@ class dnpipe_class extends dummynet_class {
$tree .= $this->GetQname() . "</a>";
if (is_array($this->subqueues)) {
$tree .= "<ul>";
- foreach ($this->subqueues as $q) {
+ foreach ($this->subqueues as $q) {
$tree .= $q->build_tree();
}
$tree .= "</ul>";
@@ -3655,7 +3655,7 @@ EOD;
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on") {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /><span class=\"vexpl\"> " . gettext("Enable limiter and its children") . "</span>";
$form .= "</td></tr>";
@@ -3740,10 +3740,10 @@ EOD;
$form .= "</select>";
$form .= "&nbsp;<br />";
$form .= "<span class=\"vexpl\">" . gettext("If 'source' or 'destination' slots is chosen, \n"
- . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"
- . "be created for each source/destination IP address encountered, \n"
- . "respectively. This makes it possible to easily specify bandwidth \n"
- . "limits per host.") . "</span><br />";
+ . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"
+ . "be created for each source/destination IP address encountered, \n"
+ . "respectively. This makes it possible to easily specify bandwidth \n"
+ . "limits per host.") . "</span><br />";
$form .= "255.255.255.255/&nbsp;<input type=\"text\" class=\"formfld unknown\" size=\"2\" id=\"maskbits\" name=\"maskbits\" value=\"";
if ($mask['type'] <> "none") {
$form .= $mask['bits'];
@@ -3765,9 +3765,9 @@ EOD;
$form .= " />";
$form .= "&nbsp; IPV6 mask bits (1-128)<br />";
$form .= "<span class=\"vexpl\">" . gettext("If 'source' or 'destination' slots is chosen, \n"
- . "leaving the mask bits blank will create one pipe per host. Otherwise specify \n"
- . "the number of 'one' bits in the subnet mask used to group multiple hosts \n"
- . "per pipe.") . "</span>";
+ . "leaving the mask bits blank will create one pipe per host. Otherwise specify \n"
+ . "the number of 'one' bits in the subnet mask used to group multiple hosts \n"
+ . "per pipe.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr><td valign=\"middle\" class=\"vncellreq\">" . gettext("Description") . "</td>";
$form .= "<td class=\"vncellreq\">";
@@ -3790,7 +3790,7 @@ EOD;
$form .= "<input name=\"delay\" type=\"text\" id=\"delay\" size=\"5\" value=\"";
$form .= $this->GetDelay() . "\" />";
$form .= "&nbsp;ms<br /> <span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should specify 0 here (or leave the field empty)") . "</span><br />";
+ . "should specify 0 here (or leave the field empty)") . "</span><br />";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Packet loss rate") . "</td>";
@@ -3798,8 +3798,8 @@ EOD;
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\" />";
$form .= "&nbsp;<br /> <span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should specify 0 here (or leave the field empty). "
- . "A value of 0.001 means one packet in 1000 gets dropped") . "</span>";
+ . "should specify 0 here (or leave the field empty). "
+ . "A value of 0.001 means one packet in 1000 gets dropped") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Queue Size") . "</td>";
@@ -3808,9 +3808,9 @@ EOD;
$form .= $this->GetQlimit() . "\" />";
$form .= "&nbsp;slots<br />";
$form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, "
- . "then they are delayed by value specified in the Delay field, and then they "
- . "are delivered to their destination.") . "</span>";
+ . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, "
+ . "then they are delayed by value specified in the Delay field, and then they "
+ . "are delivered to their destination.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Bucket Size") . "</td>";
@@ -3819,7 +3819,7 @@ EOD;
$form .= $this->GetBuckets() . "\" />";
$form .= "&nbsp;slots<br />";
$form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should leave the field empty. It increases the hash size set.");
+ . "should leave the field empty. It increases the hash size set.");
$form .= "</span></td></tr>";
return $form;
@@ -4011,7 +4011,7 @@ class dnqueue_class extends dummynet_class {
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on") {
- $form .= " checked=\"checked\"";
+ $form .= " checked=\"checked\"";
}
$form .= " /><span class=\"vexpl\"> " . gettext("Enable/Disable queue") . "</span>";
$form .= "</td></tr>";
@@ -4048,10 +4048,10 @@ class dnqueue_class extends dummynet_class {
$form .= "</select>";
$form .= "&nbsp;slots<br />";
$form .= "<span class=\"vexpl\">" . gettext("If 'source' or 'destination' slots is chosen, \n"
- . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"
- . "be created for each source/destination IP address encountered, \n"
- . "respectively. This makes it possible to easily specify bandwidth \n"
- . "limits per host.") . "</span><br />";
+ . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"
+ . "be created for each source/destination IP address encountered, \n"
+ . "respectively. This makes it possible to easily specify bandwidth \n"
+ . "limits per host.") . "</span><br />";
$form .= "255.255.255.255/&nbsp;<input type=\"text\" class=\"formfld unknown\" size=\"2\" id=\"maskbits\" name=\"maskbits\" value=\"";
if ($mask['type'] <> "none") {
$form .= $mask['bits'];
@@ -4073,9 +4073,9 @@ class dnqueue_class extends dummynet_class {
$form .= " />";
$form .= "&nbsp; IPV6 mask bits (1-128)<br />";
$form .= "<span class=\"vexpl\">" . gettext("If 'source' or 'destination' slots is chosen, \n"
- . "leaving the mask bits blank will create one pipe per host. Otherwise specify \n"
- . "the number of 'one' bits in the subnet mask used to group multiple hosts \n"
- . "per queue.") . "</span>";
+ . "leaving the mask bits blank will create one pipe per host. Otherwise specify \n"
+ . "the number of 'one' bits in the subnet mask used to group multiple hosts \n"
+ . "per queue.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr><td valign=\"middle\" class=\"vncellreq\">" . gettext("Description") . "</td>";
$form .= "<td class=\"vncellreq\">";
@@ -4097,7 +4097,7 @@ class dnqueue_class extends dummynet_class {
$form .= "<input name=\"weight\" type=\"text\" id=\"weight\" size=\"5\" value=\"";
$form .= $this->GetWeight() . "\" />";
$form .= "&nbsp;<br /> <span class=\"vexpl\">" . gettext("Hint: For queues under the same parent "
- . "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)") . "</span>";
+ . "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Packet loss rate") . "</td>";
@@ -4105,8 +4105,8 @@ class dnqueue_class extends dummynet_class {
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\" />";
$form .= "&nbsp;<br /> <span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should specify 0 here (or leave the field empty). "
- . "A value of 0.001 means one packet in 1000 gets dropped") . "</span>";
+ . "should specify 0 here (or leave the field empty). "
+ . "A value of 0.001 means one packet in 1000 gets dropped") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Queue Size") . "</td>";
@@ -4115,9 +4115,9 @@ class dnqueue_class extends dummynet_class {
$form .= $this->GetQlimit() . "\" />";
$form .= "&nbsp;slots<br />";
$form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, "
- . "then they are delayed by value specified in the Delay field, and then they "
- . "are delivered to their destination.") . "</span>";
+ . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, "
+ . "then they are delayed by value specified in the Delay field, and then they "
+ . "are delivered to their destination.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\">";
$form .= "<td valign=\"middle\" class=\"vncellreq\">" . gettext("Bucket Size") . "</td>";
@@ -4126,7 +4126,7 @@ class dnqueue_class extends dummynet_class {
$form .= $this->GetBuckets() . "\" />";
$form .= "&nbsp;" . gettext("slots") . "<br />";
$form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
- . "should leave the field empty. It increases the hash size set.");
+ . "should leave the field empty. It increases the hash size set.");
$form .= "</span></td></tr>";
$form .= "<input type=\"hidden\" id=\"pipe\" name=\"pipe\"";
@@ -4268,7 +4268,7 @@ class layer7 {
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\" ";
if ($this->GetREnabled() == "on") {
- $form .= "checked=\"checked\"";
+ $form .= "checked=\"checked\"";
}
$form .= " /><span class=\"vexpl\"> " . gettext("Enable/Disable layer7 Container") . "</span>";
$form .= "</td></tr>";
@@ -4816,7 +4816,7 @@ function get_interface_list_to_show() {
foreach ($shaperIFlist as $shif => $shDescr) {
if ($altq_list_queues[$shif]) {
continue;
- } else {
+ } else {
if (!is_altq_capable(get_real_interface($shif))) {
continue;
}
@@ -4952,14 +4952,14 @@ function build_iface_without_this_queue($iface, $qname) {
}
-$default_shaper_msg = "<tr><td align=\"center\" width=\"80%\">";
+$default_shaper_msg = "<tr><td align=\"center\" width=\"80%\">";
$default_shaper_msg .= "<span class=\"vexpl\"><strong><b>" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "</b><br />";
$default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues <br />"
. "buttons at the bottom represent queue actions and are activated accordingly.");
$default_shaper_msg .= "</strong></span>";
$default_shaper_msg .= "</td></tr>";
-$dn_default_shaper_msg = "<tr><td align=\"center\" width=\"80%\">";
+$dn_default_shaper_msg = "<tr><td align=\"center\" width=\"80%\">";
$dn_default_shaper_msg .= "<span class=\"vexpl\"><strong><b>" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "</b><br />";
$dn_default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues <br />"
. "buttons at the bottom represent queue actions and are activated accordingly.");
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index cefc177..7909451 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -331,7 +331,7 @@ function system_hosts_generate() {
$dnsmasqcfg = $config['dnsmasq'];
}
- $hosts = "127.0.0.1 localhost localhost.{$syscfg['domain']}\n";
+ $hosts = "127.0.0.1 localhost localhost.{$syscfg['domain']}\n";
$hosts .= "::1 localhost localhost.{$syscfg['domain']}\n";
$lhosts = "";
$dhosts = "";
@@ -782,7 +782,7 @@ function system_syslogd_get_remote_servers($syslogcfg, $facility = "*.*") {
// Rather than repeatedly use the same code, use this function to build a list of remote servers.
$facility .= " ".
$remote_servers = "";
- $pad_to = 56;
+ $pad_to = 56;
$padding = ceil(($pad_to - strlen($facility))/8)+1;
if ($syslogcfg['remoteserver']) {
$remote_servers .= "{$facility}" . str_repeat("\t", $padding) . "@" . system_syslogd_fixup_server($syslogcfg['remoteserver']) . "\n";
@@ -1106,7 +1106,7 @@ function system_webgui_start() {
if (!$config['system']['webgui']['port']) {
$portarg = "443";
}
- $ca = ca_chain($cert);
+ $ca = ca_chain($cert);
}
/* generate lighttpd configuration */
@@ -1157,7 +1157,7 @@ function system_generate_lighty_config($filename,
echo "system_generate_lighty_config() being called $mt\n";
}
- if ($captive_portal !== false) {
+ if ($captive_portal !== false) {
$captiveportal = ",\"mod_rewrite\",\"mod_evasive\"";
$captive_portal_rewrite = "url.rewrite-once = ( \"(.*captiveportal.*)\" => \"$1\", \"(.*)\" => \"/index.php?zone={$captive_portal}&redirurl=$1\" )\n";
@@ -1199,7 +1199,7 @@ function system_generate_lighty_config($filename,
}
// Ramp up captive portal max procs, assuming each PHP process can consume up to 64MB RAM
- if ($captive_portal !== false) {
+ if ($captive_portal !== false) {
if ($realmem > 135 and $realmem < 256) {
$max_procs += 1; // 2 worker processes
} else if ($realmem > 255 and $realmem < 513) {
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index c66eb3f..c3ce9e5 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2415,7 +2415,7 @@ function upgrade_062_to_063() {
function upgrade_063_to_064() {
global $config;
- $j=0;
+ $j = 0;
$ifcfg = &$config['interfaces'];
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
@@ -2448,7 +2448,7 @@ function upgrade_063_to_064() {
if (isset($ifinfo['ptpid'])) {
continue;
}
- $ppp['ptpid'] = $j;
+ $ppp['ptpid'] = $j;
$ppp['type'] = $ifinfo['ipaddr'];
$ppp['if'] = $ifinfo['ipaddr'].$j;
$ppp['ports'] = $ifinfo['if'];
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 2cbfce4..169f784 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -762,7 +762,7 @@ function subnet_expand($subnet) {
function subnetv4_expand($subnet) {
$result = array();
list ($ip, $bits) = explode("/", $subnet);
- $net = ip2long($ip);
+ $net = ip2long($ip);
$mask = (0xffffffff << (32 - $bits));
$net &= $mask;
$size = round(exp(log(2) * (32 - $bits)));
@@ -1064,7 +1064,7 @@ function get_configured_carp_interface_list($carpinterface = '', $family = 'inet
function get_configured_ip_aliases_list($returnfullentry = false) {
global $config;
- $alias_list=array();
+ $alias_list = array();
if (is_array($config['virtualip']['vip'])) {
$viparr = &$config['virtualip']['vip'];
@@ -1086,7 +1086,7 @@ function get_configured_ip_aliases_list($returnfullentry = false) {
function get_configured_vips_list() {
global $config;
- $alias_list=array();
+ $alias_list = array();
if (is_array($config['virtualip']['vip'])) {
$viparr = &$config['virtualip']['vip'];
@@ -1708,7 +1708,7 @@ function run_plugins($directory) {
* safe_mkdir($path, $mode = 0755)
* create directory if it doesn't already exist and isn't a file!
*/
-function safe_mkdir($path, $mode=0755) {
+function safe_mkdir($path, $mode = 0755) {
global $g;
if (!is_file($path) && !is_dir($path)) {
@@ -1951,7 +1951,7 @@ function isAjax() {
function timeout($timer = 9) {
while (!isset($key)) {
if ($timer >= 9) {
- echo chr(8) . chr(8) . ($timer == 9 ? chr(32) : null) . "{$timer}";
+ echo chr(8) . chr(8) . ($timer == 9 ? chr(32) : null) . "{$timer}";
} else {
echo chr(8). "{$timer}";
}
@@ -1977,11 +1977,11 @@ function timeout($timer = 9) {
* RESULT
* returns newly sorted array
******/
-function msort($array, $id="id", $sort_ascending=true) {
+function msort($array, $id = "id", $sort_ascending = true) {
$temp_array = array();
while (count($array)>0) {
$lowest_id = 0;
- $index=0;
+ $index = 0;
foreach ($array as $item) {
if (isset($item[$id])) {
if ($array[$lowest_id][$id]) {
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 54df10b..bf18fcb 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -56,7 +56,7 @@ function xmlrpc_sync_voucher_expire($vouchers, $syncip, $port, $password, $usern
/* Construct code that is run on remote machine */
$method = 'pfsense.exec_php';
- $execcmd = <<<EOF
+ $execcmd = <<<EOF
global \$cpzone;
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
@@ -90,7 +90,7 @@ EOF;
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
}
- $toreturn = XML_RPC_Decode($resp->value());
+ $toreturn = XML_RPC_Decode($resp->value());
return $toreturn;
}
@@ -114,7 +114,7 @@ function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $user
$dbent_str = serialize($dbent);
$tmp_stop_time = (isset($stop_time)) ? $stop_time : "null";
$method = 'pfsense.exec_php';
- $execcmd = <<<EOF
+ $execcmd = <<<EOF
global \$cpzone;
require_once('/etc/inc/captiveportal.inc');
require_once('/etc/inc/voucher.inc');
@@ -150,7 +150,7 @@ EOF;
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
}
- $toreturn = XML_RPC_Decode($resp->value());
+ $toreturn = XML_RPC_Decode($resp->value());
return $toreturn;
}
@@ -172,7 +172,7 @@ function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password,
/* Construct code that is run on remote machine */
$method = 'pfsense.exec_php';
- $execcmd = <<<EOF
+ $execcmd = <<<EOF
global \$cpzone;
require_once('/etc/inc/voucher.inc');
\$cpzone = "$cpzone";
@@ -208,7 +208,7 @@ EOF;
} else {
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
}
- $toreturn = XML_RPC_Decode($resp->value());
+ $toreturn = XML_RPC_Decode($resp->value());
if (!is_array($config['voucher'])) {
$config['voucher'] = array();
}
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 437f148..0430ce3 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -154,8 +154,9 @@ function vpn_ipsec_configure($restart = false) {
mwexec("/sbin/ifconfig enc0 up");
set_single_sysctl("net.inet.ip.ipsec_in_use", "1");
- if (php_uname('m') != "amd64")
+ if (php_uname('m') != "amd64") {
set_single_sysctl("net.inet.ipsec.directdispatch", "0");
+ }
/* needed for config files */
if (!is_dir("{$g['varetc_path']}/ipsec")) {
@@ -683,7 +684,7 @@ EOD;
/* begin ipsec.conf */
$ipsecconf = "";
$enablecompression = false;
- if (is_array($a_phase1) && count($a_phase1)) {
+ if (is_array($a_phase1) && count($a_phase1)) {
$ipsecconf .= "# This file is automatically generated. Do not edit\n";
$ipsecconf .= "config setup\n\tuniqueids = {$uniqueids}\n";
@@ -1005,7 +1006,7 @@ EOD;
continue;
}
if (!empty($ph2ent['natlocalid'])) {
- $natleftsubnet_data = ipsec_idinfo_to_cidr($ph2ent['natlocalid'], false, $ph2ent['mode']);
+ $natleftsubnet_data = ipsec_idinfo_to_cidr($ph2ent['natlocalid'], false, $ph2ent['mode']);
if ($ph2ent['natlocalid']['type'] != "address") {
if (is_subnet($natleftsubnet_data)) {
$leftsubnet_data = "{$natleftsubnet_data}|{$leftsubnet_data}";
@@ -1063,7 +1064,7 @@ EOD;
/* XXX: in some cases where include ordering is suspect these variables
* are somehow 0 and we enter this loop forever and timeout after 900
* seconds wrecking bootup */
- if ($key_hi != 0 and $key_lo !=0 and $key_step !=0) {
+ if ($key_hi != 0 and $key_lo != 0 and $key_step != 0) {
for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step) {
if (!empty($ph2ent['hash-algorithm-option']) && is_array($ph2ent['hash-algorithm-option'])) {
foreach ($ph2ent['hash-algorithm-option'] as $halgo) {
@@ -1449,8 +1450,8 @@ EOD;
EOD;
}
- if (isset($pptpdcfg["wins"]) && $pptpdcfg['wins'] != "") {
- $mpdconf .= " set ipcp nbns {$pptpdcfg['wins']}\n";
+ if (isset($pptpdcfg["wins"]) && $pptpdcfg['wins'] != "") {
+ $mpdconf .= " set ipcp nbns {$pptpdcfg['wins']}\n";
}
if (!empty($pptpdcfg['dns1'])) {
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index 74b978f..b163e15 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -124,12 +124,12 @@ function echo_lbaction($action) {
// Index actions by name
$actions_a = array();
- for ($i=0; isset($config['load_balancer']['lbaction'][$i]); $i++) {
+ for ($i = 0; isset($config['load_balancer']['lbaction'][$i]); $i++) {
$actions_a[$config['load_balancer']['lbaction'][$i]['name']] = $config['load_balancer']['lbaction'][$i];
}
$ret = "";
- $ret .= "{$actions_a[$action]['direction']} {$actions_a[$action]['type']} {$actions_a[$action]['action']}";
+ $ret .= "{$actions_a[$action]['direction']} {$actions_a[$action]['type']} {$actions_a[$action]['action']}";
switch ($actions_a[$action]['action']) {
case 'append':
$ret .= " \"{$actions_a[$action]['options']['value']}\" to \"{$actions_a[$action]['options']['akey']}\"";
@@ -303,7 +303,7 @@ function relayd_configure($kill_first=false) {
for ($j = 0; $j < count($ip_list); $j += 1) {
$ip = $ip_list[$j];
for ($k = 0; $k < count($src_port_array) && $k < count($dest_port_array); $k += 1) {
- $src_port = $src_port_array[$k];
+ $src_port = $src_port_array[$k];
$dest_port = $dest_port_array[$k];
$name = $vs_a[$i]['name'];
@@ -330,11 +330,11 @@ function relayd_configure($kill_first=false) {
$conf .= " forward to <{$vs_a[$i]['poolname']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n";
- if (isset($vs_a[$i]['sitedown']) && strlen($vs_a[$i]['sitedown']) > 0 && ($vs_a[$i]['relay_protocol'] != 'dns')) {
+ if (isset($vs_a[$i]['sitedown']) && strlen($vs_a[$i]['sitedown']) > 0 && ($vs_a[$i]['relay_protocol'] != 'dns')) {
$conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n";
}
$conf .= "}\n";
- } else {
+ } else {
$conf .= "redirect \"{$name}\" {\n";
$conf .= " listen on {$ip} port {$src_port}\n";
$conf .= " forward to <{$vs_a[$i]['poolname']}> port {$dest_port} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n";
@@ -358,7 +358,7 @@ function relayd_configure($kill_first=false) {
fclose($fd);
if (is_process_running('relayd')) {
- if (! empty($vs_a)) {
+ if (!empty($vs_a)) {
if ($kill_first) {
mwexec('pkill relayd');
/* Remove all active relayd anchors now that relayd is no longer running. */
diff --git a/etc/rc.banner b/etc/rc.banner
index 5fd95c2..768a70d 100755
--- a/etc/rc.banner
+++ b/etc/rc.banner
@@ -36,7 +36,7 @@
require_once("gwlb.inc");
require_once("interfaces.inc");
- $version = trim(file_get_contents("{$g['etc_path']}/version"));
+ $version = trim(file_get_contents("{$g['etc_path']}/version"));
$platform = trim(file_get_contents("{$g['etc_path']}/platform"));
$hostname = $config['system']['hostname'];
$product = $g['product_name'];
@@ -111,7 +111,7 @@
}
if (!empty($ipaddr6) && !empty($subnet6)) {
if (!$v6first) {
- printf("\n%s", str_repeat(" ",34));
+ printf("\n%s", str_repeat(" ", 34));
}
printf("v6%s: %s/%s",
$class6,
diff --git a/etc/rc.captiveportal_configure_mac b/etc/rc.captiveportal_configure_mac
index 93e3df5..2006f27 100755
--- a/etc/rc.captiveportal_configure_mac
+++ b/etc/rc.captiveportal_configure_mac
@@ -43,7 +43,7 @@ $stopidx = isset($_GET['cpzone']) ? $_GET['stopidx'] : trim($argv[3]);
$cpzoneidx = $config['captiveportal'][$cpzone]['zoneid'];
$filename = "{$g['tmp_path']}/{$cpzoneidx}_mac_{$startidx}_{$stopidx}";
-//log_error("STARTED: " . time() . " - {$cpzone} : $startidx : {$stopidx} : {$cpzoneidx} : {$filename}");
+//log_error("STARTED: " . time() . " - {$cpzone} : $startidx : {$stopidx} : {$cpzoneidx} : {$filename}");
captiveportal_passthrumac_configure($filename, $startidx, $stopidx);
//log_error("STOPPED: " .time() . " - {$cpzone} : $startidx : {$stopidx} : {$cpzoneidx} : {$filename}");
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize
index f8aaea2..8c97514 100755
--- a/etc/rc.filter_synchronize
+++ b/etc/rc.filter_synchronize
@@ -120,7 +120,7 @@ function carp_check_version($url, $username, $password, $port = 80, $method = 'p
} elseif ($resp->faultCode()) {
$error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
} else {
- $parsed_response = XML_RPC_decode($resp->value());
+ $parsed_response = XML_RPC_decode($resp->value());
if (!is_array($parsed_response)) {
if (trim($parsed_response) == "Authentication failed") {
$error = "An authentication failure occurred while trying to access {$url}:{$port} ({$method}).";
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 8d87a77..cf15f1d 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -104,7 +104,7 @@ binary_update() {
PATCHED_MD5=`/sbin/md5 -q /tmp/patched/${FILE} 2>/dev/null`
if [ "$PATCHED_MD5" = "$NEW_PATCH_MD5" ]; then
- /usr/bin/install -S /tmp/patched/${FILE} /${i}
+ /usr/bin/install -S /tmp/patched/${FILE} /${i}
else
#echo "${i} file does not match intended final md5."
echo "${i} file does not match intended final md5." >> ${ERR_F}
@@ -154,7 +154,7 @@ pfSenseNanoBSDupgrade)
touch /var/run/firmwarelock.dirty
- echo "NanoBSD Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1
+ echo "NanoBSD Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1
echo "NanoBSD Firmware upgrade in progress..." | wall
/etc/rc.notify_message -e -g -m "NanoBSD Firmware upgrade in progress..."
@@ -371,7 +371,7 @@ pfSenseNanoBSDupgrade)
/etc/rc.conf_mount_ro
/bin/sync
- echo "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1
+ echo "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1
echo "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds." | wall
/etc/rc.notify_message -e -g -m "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds."
@@ -423,8 +423,8 @@ pfSenseupgrade)
sh /tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
fi
- echo "Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1
- echo "Firmware upgrade in progress..." | wall
+ echo "Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1
+ echo "Firmware upgrade in progress..." | wall
/etc/rc.notify_message -e -g -m "Firmware upgrade in progress..."
# backup config
@@ -502,8 +502,8 @@ pfSenseupgrade)
rm -f /var/run/firmware.lock
/bin/sync
- echo "Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1
- echo "Firmware upgrade is complete. Rebooting in 10 seconds." | wall
+ echo "Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1
+ echo "Firmware upgrade is complete. Rebooting in 10 seconds." | wall
/etc/rc.notify_message -e -g -m "Firmware upgrade is complete. Rebooting in 10 seconds."
# Sleep and allow disks to catch up
diff --git a/etc/rc.firmware_auto b/etc/rc.firmware_auto
index 33ef2b6..e7247cb 100755
--- a/etc/rc.firmware_auto
+++ b/etc/rc.firmware_auto
@@ -22,7 +22,7 @@ fi
#echo "Downloading $FMFILENAME from $FMBASEURL ..." | logger -p daemon.info -i -t AutoUpgrade
#/usr/bin/fetch -o /tmp/latest.tgz $FETCHFILENAME | logger -p daemon.info -i -t AutoUpgrade
-#echo "Downloading $FMFILENAME.md5 from $FMBASEURL ..." | logger -p daemon.info -i -t AutoUpgrade
+#echo "Downloading $FMFILENAME.md5 from $FMBASEURL ..." | logger -p daemon.info -i -t AutoUpgrade
#/usr/bin/fetch -o /tmp/latest.tgz.md5 $FETCHFILENAME.md5 | logger -p daemon.info -i -t AutoUpgrade
PMD=`/bin/cat /tmp/latest.tgz.md5 | cut -d" " -f4 `
@@ -31,20 +31,20 @@ MD=`/sbin/md5 /tmp/latest.tgz | cut -d" " -f4`
PLATFORM=`cat /etc/platform`
echo " Package MD5: ${PMD}" | logger -p daemon.info -i -t AutoUpgrade
-echo "Downloaded MD5: ${MD}" | logger -p daemon.info -i -t AutoUpgrade
+echo "Downloaded MD5: ${MD}" | logger -p daemon.info -i -t AutoUpgrade
if [ "$PMD" = "" ]; then
- echo "Package MD5 is null md5. Require proxy auth?" | logger -p daemon.info -i -t AutoUpgrade
+ echo "Package MD5 is null md5. Require proxy auth?" | logger -p daemon.info -i -t AutoUpgrade
exit 1
fi
if [ "$MD" = "" ]; then
- echo "Downloaded MD5 is null md5. Require proxy auth?" | logger -p daemon.info -i -t AutoUpgrade
+ echo "Downloaded MD5 is null md5. Require proxy auth?" | logger -p daemon.info -i -t AutoUpgrade
exit 1
fi
if [ "$PMD" = "$MD" ]; then
- echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade
+ echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade
echo "Beginning ${product} upgrade." | wall
if [ "$PLATFORM" = "net45xx" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw
@@ -83,6 +83,6 @@ if [ "$PMD" = "$MD" ]; then
exit 0
fi
-echo "MD5's do not match. Upgrade aborted." | logger -p daemon.info -i -t AutoUpgrade
+echo "MD5's do not match. Upgrade aborted." | logger -p daemon.info -i -t AutoUpgrade
rm /tmp/latest*
exit 1
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip
index b64dec8..893146a 100755
--- a/etc/rc.initial.setlanip
+++ b/etc/rc.initial.setlanip
@@ -167,7 +167,7 @@ if ($intnum > $count) {
$index = 1;
foreach ($ifdescrs as $ifname => $ifdesc) {
- if ($intnum == $index) {
+ if ($intnum == $index) {
$interface = $ifname;
break;
} else {
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 "<p><i>" . gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.") . "</i></p>";
echo "<p>" . gettext("Contents of crash reports") . ":<br />";
echo "<textarea readonly=\"readonly\" rows=\"40\" cols=\"65\" name=\"crashreports\">{$crash_reports}</textarea></p>";
- echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\" />" . gettext(" - Submit this to the developers for inspection") . "</p>";
- echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\" />" . gettext(" - Just delete the crash report and take me back to the Dashboard") . "</p>";
+ echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\" />" . gettext(" - Submit this to the developers for inspection") . "</p>";
+ echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\" />" . gettext(" - Just delete the crash report and take me back to the Dashboard") . "</p>";
echo "</form>";
}
-$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 name=\"{$name}\" id=\"{$name}\">";
+ $select = "<select name=\"{$name}\" id=\"{$name}\">";
$select .= "<option value=\"\">" . gettext("ALL") . "</option>";
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) {
?>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
<td width="78%" class="vtable">
<a href ="/diag_ping.php?host=<?=htmlspecialchars($host)?>&amp;interface=wan&amp;count=3"><?=gettext("Ping");?></a> <br />
<a href ="/diag_traceroute.php?host=<?=htmlspecialchars($host)?>&amp;ttl=18"><?=gettext("Traceroute");?></a>
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();
<tr>
<td class="listrborder" colspan="9">
<div id="btnchildsa-<?=$ikeid;?>">
- <input type="button" onclick="show_childsa('childsa-<?=$ikeid;?>','btnchildsa-<?=$ikeid;?>');" value="+" /> - Show child SA entries
+ <input type="button" onclick="show_childsa('childsa-<?=$ikeid;?>', 'btnchildsa-<?=$ikeid;?>');" value="+" /> - Show child SA entries
</div>
<table class="tabcont" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="childsa-<?=$ikeid;?>" style="display:none" summary="">
<thead>
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('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
+ jQuery('#limiteractivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + 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");
<td rowspan="2">
<div align="center"><?=gettext("Action");?></div>
<div align="left">
- <input id="actpass" name="actpass" type="checkbox" value="Pass" <?php if (in_arrayi('Pass', $Include_Act)) echo "checked=\"checked\""; ?> /> Pass<br />
- <input id="actblock" name="actblock" type="checkbox" value="Block" <?php if (in_arrayi('Block', $Include_Act)) echo "checked=\"checked\""; ?> /> Block<br />
+ <input id="actpass" name="actpass" type="checkbox" value="Pass" <?php if (in_arrayi('Pass', $Include_Act)) echo "checked=\"checked\""; ?> /> Pass<br />
+ <input id="actblock" name="actblock" type="checkbox" value="Block" <?php if (in_arrayi('Block', $Include_Act)) echo "checked=\"checked\""; ?> /> Block<br />
</div>
</td>
<td>
diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php
index fe10383..331df0d 100644
--- a/usr/local/www/diag_logs_filter_summary.php
+++ b/usr/local/www/diag_logs_filter_summary.php
@@ -54,7 +54,7 @@ $fields = array(
$summary = array();
foreach (array_keys($fields) as $f) {
- $summary[$f] = array();
+ $summary[$f] = array();
}
$totals = array();
@@ -74,7 +74,7 @@ function stat_block($summary, $stat, $num) {
$k = array_keys($summary[$stat]);
$total = 0;
$numentries = 0;
- for ($i=0; $i < $num; $i++) {
+ for ($i = 0; $i < $num; $i++) {
if ($k[$i]) {
$total += $summary[$stat][$k[$i]];
$numentries++;
@@ -106,7 +106,7 @@ function pie_block($summary, $stat, $num) {
$numentries = 0;
print "\n<script type=\"text/javascript\">\n";
print "//<![CDATA[\n";
- for ($i=0; $i < $num; $i++) {
+ for ($i = 0; $i < $num; $i++) {
if ($k[$i]) {
$total += $summary[$stat][$k[$i]];
$numentries++;
@@ -123,7 +123,7 @@ function pie_block($summary, $stat, $num) {
print "Event.observe(window, 'load', function() {\n";
print " new Proto.Chart($('piechart{$stat}'),\n";
print " [\n";
- for ($i=0; $i < $num; $i++) {
+ for ($i = 0; $i < $num; $i++) {
if ($k[$i]) {
print " { data: d{$stat}{$i}, label: \"{$k[$i]}\"}";
if (!(($i == ($numentries - 1)) && ($leftover <= 0))) {
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index 9340571..8fa79ce 100644
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -92,7 +92,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s IPsec log entries"), $nentries);?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s IPsec log entries"), $nentries);?></td>
</tr>
<?php
foreach ($ipsec_logarr as $logent) {
@@ -100,7 +100,7 @@ include("head.inc");
$logent = preg_split("/\s+/", $logent, 6);
echo "<tr valign=\"top\">\n";
$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
- echo "<td class=\"listlr nowrap\">" . $entry_date_time . "</td>\n";
+ echo "<td class=\"listlr nowrap\">" . $entry_date_time . "</td>\n";
echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
echo "</tr>\n";
}
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php
index c3d6993..c9f2791 100644
--- a/usr/local/www/diag_logs_settings.php
+++ b/usr/local/www/diag_logs_settings.php
@@ -379,7 +379,7 @@ function check_everything() {
<tr>
<td width="22%" valign="top">Reset Logs</td>
<td width="78%">
- <input name="resetlogs" type="submit" class="formbtn" value="<?=gettext("Reset Log Files"); ?>" onclick="return confirm('<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>')" />
+ <input name="resetlogs" type="submit" class="formbtn" value="<?=gettext("Reset Log Files"); ?>" onclick="return confirm('<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>')" />
<br /><br />
<?= gettext("Note: Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if you have made any setting changes."); ?>
</td>
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index ae41a67..68e12d4 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -338,7 +338,7 @@ include("fbegin.inc");
<option value="full" <?php if ($detail == "full") echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
</select>
<br />
- <?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
+ <?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
gettext("Note:") . "</b> " .
gettext("This option does not affect the level of detail when downloading the packet capture.");?>
</td>
diff --git a/usr/local/www/diag_pf_info.php b/usr/local/www/diag_pf_info.php
index b6ed73a..369c0f4 100644
--- a/usr/local/www/diag_pf_info.php
+++ b/usr/local/www/diag_pf_info.php
@@ -74,7 +74,7 @@ jQuery(document).ready(function() {setTimeout('getpfinfo()', 5000);});
});
}
function activitycallback(transport) {
- jQuery('#pfactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
+ jQuery('#pfactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
setTimeout('getpfinfo()', 2000);
}
//]]>
diff --git a/usr/local/www/diag_states_summary.php b/usr/local/www/diag_states_summary.php
index 3b31df9..7aa91d6 100644
--- a/usr/local/www/diag_states_summary.php
+++ b/usr/local/www/diag_states_summary.php
@@ -68,7 +68,7 @@ if (count($states) > 0) {
$iface = array_shift($line_split);
$proto = array_shift($line_split);
$state = array_pop($line_split);
- $info = implode(" ", $line_split);
+ $info = implode(" ", $line_split);
/* Handle NAT cases
Replaces an external IP + NAT by the internal IP */
diff --git a/usr/local/www/diag_system_activity.php b/usr/local/www/diag_system_activity.php
index 58c5345..1f6380f 100644
--- a/usr/local/www/diag_system_activity.php
+++ b/usr/local/www/diag_system_activity.php
@@ -71,7 +71,7 @@ include("head.inc");
});
}
function activitycallback(transport) {
- jQuery('#cpuactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
+ jQuery('#cpuactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
setTimeout('getcpuactivity()', 2500);
}
setTimeout('getcpuactivity()', 1000);
diff --git a/usr/local/www/diag_system_pftop.php b/usr/local/www/diag_system_pftop.php
index 5c15e6f..7d51c84 100644
--- a/usr/local/www/diag_system_pftop.php
+++ b/usr/local/www/diag_system_pftop.php
@@ -108,7 +108,7 @@ if ($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], $sorttypes) &&
});
}
function activitycallback(transport) {
- jQuery('#pftopactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
+ jQuery('#pftopactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
setTimeout('getpftopactivity()', 2500);
}
setTimeout('getpftopactivity()', 1000);
diff --git a/usr/local/www/edit.php b/usr/local/www/edit.php
index 7a78974..481b2ce 100644
--- a/usr/local/www/edit.php
+++ b/usr/local/www/edit.php
@@ -49,7 +49,7 @@ if ($_POST['action']) {
echo "|5|" . gettext("No file name specified") . ".|";
} elseif (is_dir($_POST['file'])) {
echo "|4|" . gettext("Loading a directory is not supported") . ".|";
- } elseif (! is_file($_POST['file'])) {
+ } elseif (!is_file($_POST['file'])) {
echo "|3|" . gettext("File does not exist or is not a regular file") . ".|";
} else {
$data = file_get_contents(urldecode($_POST['file']));
@@ -129,11 +129,11 @@ outputJavaScriptFileInline("javascript/base64.js");
if (file.indexOf(".php") > 0) lang = "php";
else if (file.indexOf(".inc") > 0) lang = "php";
else if (file.indexOf(".xml") > 0) lang = "xml";
- else if (file.indexOf(".js" ) > 0) lang = "js";
+ else if (file.indexOf(".js") > 0) lang = "js";
else if (file.indexOf(".css") > 0) lang = "css";
if (jQuery("#highlight").checked && lang != "none") {
- jQuery("fileContent").prop("className",lang + ":showcolumns");
+ jQuery("fileContent").prop("className", lang + ":showcolumns");
dp.SyntaxHighlighter.HighlightAll("fileContent", true, false);
}
} else {
@@ -148,7 +148,7 @@ outputJavaScriptFileInline("javascript/base64.js");
jQuery("#fileStatusBox").show(500);
var fileContent = Base64.encode(jQuery("#fileContent").val());
- fileContent = fileContent.replace(/\+/g,"%2B");
+ fileContent = fileContent.replace(/\+/g, "%2B");
jQuery.ajax(
"<?=$_SERVER['SCRIPT_NAME'];?>", {
diff --git a/usr/local/www/exec.php b/usr/local/www/exec.php
index f1da7a1..ecf938a 100644
--- a/usr/local/www/exec.php
+++ b/usr/local/www/exec.php
@@ -75,7 +75,7 @@ if ($_POST) {
// Returns true or false depending on blankness of argument.
function isBlank($arg) {
- return preg_match( "/^\s*$/", $arg );
+ return preg_match("/^\s*$/", $arg);
}
// Function: Puts
@@ -96,7 +96,7 @@ $arrDT = localtime();
$intYear = $arrDT[5] + 1900;
$closehead = false;
-$pgtitle = array(gettext("Diagnostics"),gettext("Execute command"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Execute command"));
include("head.inc");
?>
@@ -107,16 +107,16 @@ include("head.inc");
<?php
-if (isBlank( $_POST['txtRecallBuffer'] )) {
- puts( " var arrRecallBuffer = new Array;" );
+if (isBlank($_POST['txtRecallBuffer'])) {
+ puts(" var arrRecallBuffer = new Array;");
} else {
- puts( " var arrRecallBuffer = new Array(" );
- $arrBuffer = explode( "&", $_POST['txtRecallBuffer'] );
- for ($i=0; $i < (count( $arrBuffer ) - 1); $i++) {
- puts( " '" . htmlspecialchars($arrBuffer[$i], ENT_QUOTES | ENT_HTML401) . "'," );
+ puts(" var arrRecallBuffer = new Array(");
+ $arrBuffer = explode("&", $_POST['txtRecallBuffer']);
+ for ($i = 0; $i < (count($arrBuffer) - 1); $i++) {
+ puts(" '" . htmlspecialchars($arrBuffer[$i], ENT_QUOTES | ENT_HTML401) . "',");
}
- puts( " '" . htmlspecialchars($arrBuffer[count( $arrBuffer ) - 1], ENT_QUOTES | ENT_HTML401) . "'" );
- puts( " );" );
+ puts(" '" . htmlspecialchars($arrBuffer[count($arrBuffer) - 1], ENT_QUOTES | ENT_HTML401) . "'");
+ puts(" );");
}
?>
@@ -161,7 +161,7 @@ if (isBlank( $_POST['txtRecallBuffer'] )) {
// If nothing in recall buffer, then error.
if (!arrRecallBuffer.length) {
- alert( '<?=gettext("Nothing to recall"); ?>!' );
+ alert('<?=gettext("Nothing to recall"); ?>!');
form.txtCommand.focus();
return;
}
@@ -241,7 +241,7 @@ if (!isBlank($_POST['txtCommand'])) {
puts("\$ " . htmlspecialchars($_POST['txtCommand']));
putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
putenv("SCRIPT_FILENAME=" . strtok($_POST['txtCommand'], " ")); /* PHP scripts */
- $ph = popen($_POST['txtCommand'] . ' 2>&1', "r" );
+ $ph = popen($_POST['txtCommand'] . ' 2>&1', "r");
while ($line = fgets($ph)) {
echo htmlspecialchars($line);
}
@@ -260,7 +260,7 @@ if (!isBlank($_POST['txtPHPCommand'])) {
?>
<div id="niftyOutter">
-<form action="exec.php" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit( this );">
+<form action="exec.php" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit(this);">
<table summary="exec">
<tr>
<td colspan="2" valign="top" class="vnsepcell"><?=gettext("Execute Shell command"); ?></td>
@@ -273,10 +273,10 @@ if (!isBlank($_POST['txtPHPCommand'])) {
<td valign="top">&nbsp;&nbsp;&nbsp;</td>
<td valign="top" class="label">
<input type="hidden" name="txtRecallBuffer" value="<?=htmlspecialchars($_POST['txtRecallBuffer']) ?>" />
- <input type="button" class="button" name="btnRecallPrev" value="<" onclick="btnRecall_onClick( this.form, -1 );" />
+ <input type="button" class="button" name="btnRecallPrev" value="<" onclick="btnRecall_onClick(this.form, -1);" />
<input type="submit" class="button" value="<?=gettext("Execute"); ?>" />
- <input type="button" class="button" name="btnRecallNext" value=">" onclick="btnRecall_onClick( this.form, 1 );" />
- <input type="button" class="button" value="<?=gettext("Clear"); ?>" onclick="return Reset_onClick( this.form );" />
+ <input type="button" class="button" name="btnRecallNext" value=">" onclick="btnRecall_onClick(this.form, 1);" />
+ <input type="button" class="button" value="<?=gettext("Clear"); ?>" onclick="return Reset_onClick(this.form);" />
</td>
</tr>
<tr>
@@ -294,7 +294,7 @@ if (!isBlank($_POST['txtPHPCommand'])) {
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;</td>
<td valign="top" class="label">
- <input name="submit" type="submit" class="button" id="download" value="<?=gettext("Download"); ?>" />
+ <input name="submit" type="submit" class="button" id="download" value="<?=gettext("Download"); ?>" />
</td>
</tr>
<tr>
@@ -312,7 +312,7 @@ if (!isBlank($_POST['txtPHPCommand'])) {
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;</td>
<td valign="top" class="label">
- <input name="submit" type="submit" class="button" id="upload" value="<?=gettext("Upload"); ?>" /></td>
+ <input name="submit" type="submit" class="button" id="upload" value="<?=gettext("Upload"); ?>" /></td>
</tr>
<tr>
<td colspan="2" valign="top" height="16"></td>
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index 47be7e0..50a3f2e 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -76,7 +76,7 @@ function return_ext_menu($section) {
function output_menu($arrayitem, $target = null) {
foreach ($arrayitem as $item) {
- if (isAllowedPage($item[1]) || $item[1]=="/index.php?logout") {
+ if (isAllowedPage($item[1]) || $item[1] == "/index.php?logout") {
$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
if ($target) {
$attr .= sprintf(" target=\"%s\"", htmlentities($target));
@@ -114,7 +114,7 @@ if (!isAllowedPage("system_usermanager.php*")) {
} else {
$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
}
-$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0);
+$system_menu = msort(array_merge($system_menu, return_ext_menu("System")), 0);
// Interfaces
$interfaces_menu = array();
@@ -127,7 +127,7 @@ foreach ($opts as $oif => $odescr) {
$interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
}
}
-$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0);
+$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")), 0);
// Firewall
$firewall_menu = array();
@@ -137,7 +137,7 @@ $firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
-$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0);
+$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")), 0);
// Services
$services_menu = array();
@@ -163,7 +163,7 @@ if (count($config['interfaces']) > 1) {
$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml");
}
$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php");
-$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0);
+$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")), 0);
// VPN
$vpn_menu = array();
@@ -171,7 +171,7 @@ $vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
-$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0);
+$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")), 0);
// Status
$status_menu = array();
@@ -210,7 +210,7 @@ foreach ($ifentries as $ent => $entdesc) {
if (count($wifdescrs) > 0) {
$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
}
-$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0);
+$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")), 0);
// Diagnostics
$diagnostics_menu = array();
@@ -223,11 +223,11 @@ $diagnostics_menu[] = array(gettext("Edit File"), "/edit.php");
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
if (file_exists("/var/run/gmirror_active")) {
- $diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php" );
+ $diagnostics_menu[] = array(gettext("GEOM Mirrors"), "/diag_gmirror.php");
}
-$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" );
-$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php" );
-$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php" );
+$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php");
+$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php");
+$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php");
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
@@ -237,7 +237,7 @@ $diagnostics_menu[] = array(gettext("pfTop"), "/diag_system_pftop.php");
$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php");
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php");
-$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php" );
+$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php");
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
@@ -250,11 +250,11 @@ if ($g['platform'] == "nanobsd") {
if (isset($config['system']['developer'])) {
$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
}
-$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0);
+$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")), 0);
$gold_menu = array();
$gold_menu[] = array(gettext("pfSense Gold"), "https://www.pfsense.org/gold");
-$gold_menu = msort(array_merge($gold_menu, return_ext_menu("Gold")),0);
+$gold_menu = msort(array_merge($gold_menu, return_ext_menu("Gold")), 0);
if (!$g['disablehelpmenu']) {
$help_menu = array();
@@ -269,7 +269,7 @@ if (!$g['disablehelpmenu']) {
$help_menu[] = array(gettext("pfSense Book"), "https://www.pfsense.org/j.php?jumpto=book");
$help_menu[] = array(gettext("Search portal"), "https://www.pfsense.org/j.php?jumpto=searchportal");
$help_menu[] = array(gettext("FreeBSD Handbook"), "https://www.pfsense.org/j.php?jumpto=fbsdhandbook");
- $help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);
+ $help_menu = msort(array_merge($help_menu, return_ext_menu("Help")), 0);
}
?>
@@ -450,7 +450,7 @@ if (is_subsystem_dirty('packagelock') || (file_exists('/conf/needs_package_sync'
if (file_exists('/conf/needs_package_sync') && platform_booting()) {
$info_text = sprintf(gettext("%s is booting then packages will be reinstalled in the background.<p>Do not make changes in the GUI until this is complete."), $g['product_name']);
} else {
- $pgtitle = array(gettext("System"),gettext("Package Manager"));
+ $pgtitle = array(gettext("System"), gettext("Package Manager"));
$info_text = gettext("Packages are currently being reinstalled in the background.<p>Do not make changes in the GUI until this is complete.");
}
print_info_box($info_text . "<p><img src='/themes/{$g['theme']}/images/icons/icon_fw-update.gif' alt='firmware update' />");
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php
index 0df3c81..950a8a2 100644
--- a/usr/local/www/firewall_aliases.php
+++ b/usr/local/www/firewall_aliases.php
@@ -52,7 +52,7 @@ if (!is_array($config['aliases']['alias'])) {
}
$a_aliases = &$config['aliases']['alias'];
-$tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab']));
+$tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/", "", $_REQUEST['tab']));
if ($_POST) {
@@ -160,7 +160,7 @@ function find_alias_reference($section, $field, $origname, &$is_alias_referenced
}
}
-$pgtitle = array(gettext("Firewall"),gettext("Aliases"));
+$pgtitle = array(gettext("Firewall"), gettext("Aliases"));
$shortcut_section = "aliases";
include("head.inc");
@@ -180,10 +180,10 @@ include("head.inc");
<td class="tabnavtbl">
<?php
$tab_array = array();
- $tab_array[] = array(gettext("IP"),($tab=="ip" ? true : ($tab=="host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip");
- $tab_array[] = array(gettext("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port");
- $tab_array[] = array(gettext("URLs"), ($tab=="url"? true : false), "/firewall_aliases.php?tab=url");
- $tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all");
+ $tab_array[] = array(gettext("IP"), ($tab == "ip" ? true : ($tab == "host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip");
+ $tab_array[] = array(gettext("Ports"), ($tab == "port"? true : false), "/firewall_aliases.php?tab=port");
+ $tab_array[] = array(gettext("URLs"), ($tab == "url"? true : false), "/firewall_aliases.php?tab=url");
+ $tab_array[] = array(gettext("All"), ($tab == "all"? true : false), "/firewall_aliases.php?tab=all");
display_top_tabs($tab_array);
?>
<input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>" />
@@ -198,7 +198,7 @@ include("head.inc");
<td width="43%" class="listhdrr"><?=gettext("Values"); ?></td>
<td width="30%" class="listhdr"><?=gettext("Description"); ?></td>
<td width="7%" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="add">
+ <table border="0" cellspacing="0" cellpadding="1" summary="add">
<tr>
<td valign="middle" width="17">&nbsp;</td>
<td valign="middle"><a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias"));?> alt="add" /></a></td>
@@ -208,21 +208,21 @@ include("head.inc");
</tr>
<?php
asort($a_aliases);
- foreach ($a_aliases as $i=> $alias){
+ foreach ($a_aliases as $i=> $alias) {
unset ($show_alias);
- switch ($tab){
+ switch ($tab) {
case "all":
$show_alias= true;
break;
case "ip":
case "host":
case "network":
- if (preg_match("/(host|network)/",$alias["type"])) {
+ if (preg_match("/(host|network)/", $alias["type"])) {
$show_alias= true;
}
break;
case "url":
- if (preg_match("/(url)/i",$alias["type"])) {
+ if (preg_match("/(url)/i", $alias["type"])) {
$show_alias= true;
}
break;
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
index 81b38e1..d78c500 100755
--- a/usr/local/www/firewall_aliases_edit.php
+++ b/usr/local/www/firewall_aliases_edit.php
@@ -50,7 +50,7 @@ require_once("functions.inc");
require_once("filter.inc");
require_once("shaper.inc");
-$pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Edit"));
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
@@ -93,7 +93,7 @@ function alias_same_type($name, $type) {
in_array($alias['type'], array("host", "network"))) {
return true;
}
- if ($type == $alias['type']) {
+ if ($type == $alias['type']) {
return true;
} else {
return false;
@@ -194,7 +194,7 @@ if ($_POST) {
$alias['updatefreq'] = $_POST['address_subnet0'] ? $_POST['address_subnet0'] : 7;
if (!is_URL($alias['url']) || empty($alias['url'])) {
$input_errors[] = gettext("You must provide a valid URL.");
- } elseif (! process_alias_urltable($alias['name'], $alias['url'], 0, true)) {
+ } elseif (!process_alias_urltable($alias['name'], $alias['url'], 0, true)) {
$input_errors[] = gettext("Unable to fetch usable data.");
}
if ($_POST["detail0"] <> "") {
@@ -214,7 +214,7 @@ if ($_POST) {
$desc_fmt_err_found = false;
/* item is a url type */
- for ($x=0; $x<$max_alias_addresses-1; $x++) {
+ for ($x = 0; $x < $max_alias_addresses - 1; $x++) {
$_POST['address' . $x] = trim($_POST['address' . $x]);
if ($_POST['address' . $x]) {
/* fetch down and add in */
@@ -278,7 +278,7 @@ if ($_POST) {
// Users can paste strings like "10.1.2.0/24 10.3.0.0/16 9.10.11.0/24" into an address box.
// They can also put an IP range.
// This loop expands out that stuff so it can easily be validated.
- for ($x=0; $x<($max_alias_addresses-1); $x++) {
+ for ($x = 0; $x < ($max_alias_addresses - 1); $x++) {
if ($_POST["address{$x}"] <> "") {
if ($_POST["detail{$x}"] <> "") {
if ((strpos($_POST["detail{$x}"], "||") === false) && (substr($_POST["detail{$x}"], 0, 1) != "|") && (substr($_POST["detail{$x}"], -1, 1) != "|")) {
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php
index 5660717..09a2b79 100755
--- a/usr/local/www/firewall_aliases_import.php
+++ b/usr/local/www/firewall_aliases_import.php
@@ -47,7 +47,7 @@ require_once("util.inc");
require_once("filter.inc");
require("shaper.inc");
-$pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Bulk import"));
+$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Bulk import"));
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
@@ -68,7 +68,7 @@ $a_aliases = &$config['aliases']['alias'];
if ($_POST['aliasimport'] <> "") {
$reqdfields = explode(" ", "name aliasimport");
- $reqdfieldsn = array(gettext("Name"),gettext("Aliases"));
+ $reqdfieldsn = array(gettext("Name"), gettext("Aliases"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -104,7 +104,7 @@ if ($_POST['aliasimport'] <> "") {
$desc_len_err_found = false;
$desc_fmt_err_found = false;
foreach ($tocheck as $impline) {
- $implinea = explode(" ",trim($impline),2);
+ $implinea = explode(" ", trim($impline), 2);
$impip = $implinea[0];
$impdesc = trim($implinea[1]);
if (strlen($impdesc) < 200) {
diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php
index 2fba0b7..70c8041 100644
--- a/usr/local/www/firewall_nat.php
+++ b/usr/local/www/firewall_nat.php
@@ -106,7 +106,7 @@ if (isset($_POST['del_x'])) {
foreach ($_POST['rule'] as $rulei) {
$target = $rule['target'];
// Check for filter rule associations
- if (isset($a_nat[$rulei]['associated-rule-id'])){
+ if (isset($a_nat[$rulei]['associated-rule-id'])) {
delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
mark_subsystem_dirty('filter');
@@ -171,7 +171,7 @@ if (isset($_POST['del_x'])) {
}
$closehead = false;
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward"));
include("head.inc");
echo "<script type=\"text/javascript\" src=\"/javascript/domTT/domLib.js\"></script>";
@@ -251,7 +251,7 @@ echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></
$alias_dst_span_end = $alias_popup["dst_end"];
$alias_dst_port_span_end = $alias_popup["dstport_end"];
- $alias_popup = rule_popup("","",$natent['target'], pprint_port($natent['local-port']));
+ $alias_popup = rule_popup("", "", $natent['target'], pprint_port($natent['local-port']));
$alias_target_span_begin = $alias_popup["dst"];
$alias_local_port_span_begin = $alias_popup["dstport"];
diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php
index fea2dd4..10b48dc 100644
--- a/usr/local/www/firewall_nat_1to1.php
+++ b/usr/local/www/firewall_nat_1to1.php
@@ -157,7 +157,7 @@ if (isset($_POST['del_x'])) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("1:1"));
include("head.inc");
?>
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php
index 5964c5d..37c25ca 100644
--- a/usr/local/www/firewall_nat_1to1_edit.php
+++ b/usr/local/www/firewall_nat_1to1_edit.php
@@ -116,7 +116,7 @@ if ($_POST) {
$temp = str_replace(">", "", $value);
$newpost = htmlentities($temp);
if ($newpost <> $temp) {
- $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."),$temp);
+ $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."), $temp);
}
}
@@ -241,7 +241,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("1:1"), gettext("Edit"));
include("head.inc");
?>
@@ -390,8 +390,8 @@ if ($input_errors) {
<?php
$sel = is_specialnet($pconfig['src']);
?>
- <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
- <option value="single" <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>>
+ <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
+ <option value="single" <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>>
<?=gettext("Single host"); ?>
</option>
<option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
@@ -417,7 +417,7 @@ if ($input_errors) {
<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>>
<?=htmlspecialchars($ifdesc);?> <?=gettext("net"); ?>
</option>
- <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
+ <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
<?=$ifdesc?> <?=gettext("address");?>
</option>
<?php
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index ce6d31b..7015f65 100644
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -214,10 +214,10 @@ if ($_POST) {
/* input validation */
if (strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
$reqdfields = explode(" ", "interface proto dstbeginport dstendport");
- $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("Destination port from"),gettext("Destination port to"));
+ $reqdfieldsn = array(gettext("Interface"), gettext("Protocol"), gettext("Destination port from"), gettext("Destination port to"));
} else {
$reqdfields = explode(" ", "interface proto");
- $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"));
+ $reqdfieldsn = array(gettext("Interface"), gettext("Protocol"));
}
if ($_POST['srctype'] == "single" || $_POST['srctype'] == "network") {
@@ -276,8 +276,8 @@ if ($_POST) {
}
/* if user enters an alias and selects "network" then disallow. */
- if (($_POST['srctype'] == "network" && is_alias($_POST['src']) ) ||
- ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) )) {
+ if (($_POST['srctype'] == "network" && is_alias($_POST['src'])) ||
+ ($_POST['dsttype'] == "network" && is_alias($_POST['dst']))) {
$input_errors[] = gettext("You must specify single host or alias for alias entries.");
}
@@ -332,7 +332,7 @@ if ($_POST) {
continue;
}
- list($begp,$endp) = explode("-", $natent['destination']['port']);
+ list($begp, $endp) = explode("-", $natent['destination']['port']);
if (!$endp) {
$endp = $begp;
}
@@ -405,15 +405,15 @@ if ($_POST) {
$need_filter_rule = true;
}
// Create a rule or if we want to create a new one
- if ($natent['associated-rule-id']=='new') {
+ if ($natent['associated-rule-id'] == 'new') {
$need_filter_rule = true;
- unset( $natent['associated-rule-id'] );
+ unset($natent['associated-rule-id']);
$_POST['filter-rule-association']='add-associated';
}
// If creating a new rule, where we want to add the filter rule, associated or not
else if (isset($_POST['filter-rule-association']) &&
- ($_POST['filter-rule-association']=='add-associated' ||
- $_POST['filter-rule-association']=='add-unassociated')) {
+ ($_POST['filter-rule-association'] == 'add-associated' ||
+ $_POST['filter-rule-association'] == 'add-unassociated')) {
$need_filter_rule = true;
}
@@ -456,7 +456,7 @@ if ($_POST) {
$filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 62);
// If this is a new rule, create an ID and add the rule
- if ($_POST['filter-rule-association']=='add-associated') {
+ if ($_POST['filter-rule-association'] == 'add-associated') {
$filterent['associated-rule-id'] = $natent['associated-rule-id'] = get_unique_id();
$filterent['created'] = make_config_revision_entry(null, gettext("NAT Port Forward"));
$config['filter']['rule'][] = $filterent;
@@ -496,7 +496,7 @@ if ($_POST) {
}
$closehead = false;
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward"), gettext("Edit"));
include("head.inc");
?>
@@ -536,7 +536,7 @@ include("fbegin.inc"); ?>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
<td width="78%" class="vtable">
- <select name="interface" class="formselect" onchange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
+ <select name="interface" class="formselect" onchange="dst_change(this.value, iface_old, document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
<?php
$iflist = get_configured_interface_with_descr(false, true);
// Allow extending of the firewall edit interfaces
@@ -623,24 +623,24 @@ include("fbegin.inc"); ?>
<select name="srctype" class="formselect" onchange="typesel_change()">
<?php
$sel = is_specialnet($pconfig['src']); ?>
- <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
- <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
+ <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
+ <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
<option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
<?php if (have_ruleint_access("pptp")): ?>
- <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
+ <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
<?php endif; ?>
<?php if (have_ruleint_access("pppoe")): ?>
- <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
+ <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
<?php endif; ?>
<?php if (have_ruleint_access("l2tp")): ?>
- <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
+ <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
<?php endif; ?>
<?php
foreach ($ifdisp as $ifent => $ifdesc):
if (have_ruleint_access($ifent)):
?>
<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("net"); ?></option>
- <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
+ <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
<?=$ifdesc?> <?=gettext("address");?>
</option>
<?php
@@ -898,7 +898,7 @@ include("fbegin.inc"); ?>
foreach ($config['filter']['rule'] as $filter_id => $filter_rule) {
if (isset($filter_rule['associated-rule-id'])) {
echo "<option value=\"{$filter_rule['associated-rule-id']}\"";
- if ($filter_rule['associated-rule-id']==$pconfig['associated-rule-id']) {
+ if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {
echo " selected=\"selected\"";
$linkedrule = "<br /><a href=\"firewall_rules_edit.php?id={$filter_id}\">" . gettext("View the filter rule") . "</a><br />";
}
@@ -994,7 +994,7 @@ include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
- var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
+ var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
var oTextbox1 = new AutoSuggestControl(document.getElementById("localip"), new StateSuggestions(addressarray));
var oTextbox2 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray));
diff --git a/usr/local/www/firewall_nat_npt.php b/usr/local/www/firewall_nat_npt.php
index 3fcfbf4..003bd88 100644
--- a/usr/local/www/firewall_nat_npt.php
+++ b/usr/local/www/firewall_nat_npt.php
@@ -79,7 +79,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("NPt"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"));
include("head.inc");
?>
diff --git a/usr/local/www/firewall_nat_npt_edit.php b/usr/local/www/firewall_nat_npt_edit.php
index 2f2531d..e4b5818 100644
--- a/usr/local/www/firewall_nat_npt_edit.php
+++ b/usr/local/www/firewall_nat_npt_edit.php
@@ -151,7 +151,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("NPt"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"), gettext("Edit"));
include("head.inc");
?>
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index 1e942d2..d560abe 100644
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -228,7 +228,7 @@ if (isset($_POST['del_x'])) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Outbound"));
include("head.inc");
?>
@@ -360,7 +360,7 @@ if (is_subsystem_dirty('natconf')) {
$alias_dst_span_begin = "";
$alias_dst_port_span_begin = "";
- $alias_popup = rule_popup($natent['source']['network'],pprint_port($natent['sourceport']),$natent['destination']['address'],pprint_port($natent['dstport']));
+ $alias_popup = rule_popup($natent['source']['network'], pprint_port($natent['sourceport']), $natent['destination']['address'], pprint_port($natent['dstport']));
$alias_src_span_begin = $alias_popup["src"];
$alias_src_port_span_begin = $alias_popup["srcport"];
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index d646e68..6471516 100644
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -92,7 +92,7 @@ if (isset($id) && $a_out[$id]) {
}
$pconfig['protocol'] = $a_out[$id]['protocol'];
- list($pconfig['source'],$pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']);
+ list($pconfig['source'], $pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']);
if (!is_numeric($pconfig['source_subnet'])) {
$pconfig['source_subnet'] = 32;
}
@@ -148,13 +148,13 @@ if ($_POST) {
$temp = str_replace(">", "", $value);
$newpost = htmlentities($temp);
if ($newpost <> $temp) {
- $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."),$temp);
+ $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."), $temp);
}
}
/* input validation */
$reqdfields = explode(" ", "interface protocol source source_subnet destination destination_subnet");
- $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("Source"),gettext("Source bit count"),gettext("Destination"),gettext("Destination bit count"));
+ $reqdfieldsn = array(gettext("Interface"), gettext("Protocol"), gettext("Source"), gettext("Source bit count"), gettext("Destination"), gettext("Destination bit count"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -364,7 +364,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Outbound"), gettext("Edit"));
$closehead = false;
include("head.inc");
@@ -440,19 +440,19 @@ function proto_change() {
}
}
function poolopts_change() {
- if (jQuery('#target option:selected').text().trim().substring(0,4) == "Host") {
- jQuery('#poolopts_tr').css('display','');
- jQuery('#target_network').css('display','none');
- } else if (jQuery('#target option:selected').text().trim().substring(0,6) == "Subnet") {
- jQuery('#poolopts_tr').css('display','');
- jQuery('#target_network').css('display','none');
- } else if (jQuery('#target option:selected').text().trim().substring(0,5) == "Other") {
- jQuery('#poolopts_tr').css('display','');
- jQuery('#target_network').css('display','');
+ if (jQuery('#target option:selected').text().trim().substring(0, 4) == "Host") {
+ jQuery('#poolopts_tr').css('display', '');
+ jQuery('#target_network').css('display', 'none');
+ } else if (jQuery('#target option:selected').text().trim().substring(0, 6) == "Subnet") {
+ jQuery('#poolopts_tr').css('display', '');
+ jQuery('#target_network').css('display', 'none');
+ } else if (jQuery('#target option:selected').text().trim().substring(0, 5) == "Other") {
+ jQuery('#poolopts_tr').css('display', '');
+ jQuery('#target_network').css('display', '');
} else {
- jQuery('#poolopts').prop('selectedIndex',0);
- jQuery('#poolopts_tr').css('display','none');
- jQuery('#target_network').css('display','none');
+ jQuery('#poolopts').prop('selectedIndex', 0);
+ jQuery('#poolopts_tr').css('display', 'none');
+ jQuery('#target_network').css('display', 'none');
jQuery('#targetip').val('');
jQuery('#targetip_subnet').val('0');
}
@@ -525,7 +525,7 @@ function poolopts_change() {
}
/* add openvpn/tun interfaces */
- if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
+ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$interfaces["openvpn"] = "OpenVPN";
}
@@ -558,7 +558,7 @@ function poolopts_change() {
</select><br />
<span class="vexpl"><?=gettext("Choose which protocol this rule should match.");?><br />
<?php
- printf(gettext("Hint: in most cases, you should specify %s any %s here."),"<em>","</em>&nbsp;");
+ printf(gettext("Hint: in most cases, you should specify %s any %s here."), "<em>", "</em>&nbsp;");
?>
</span>
</td>
@@ -887,7 +887,7 @@ function poolopts_change() {
poolopts_change();
var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
- var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
+ var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
var oTextbox1 = new AutoSuggestControl(document.getElementById("source"), new StateSuggestions(addressarray));
var oTextbox2 = new AutoSuggestControl(document.getElementById("sourceport"), new StateSuggestions(customarray));
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index f66ac10..d3e8f24 100644
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -47,7 +47,7 @@ require_once("functions.inc");
require_once("filter.inc");
require_once("shaper.inc");
-$pgtitle = array(gettext("Firewall"),gettext("Rules"));
+$pgtitle = array(gettext("Firewall"), gettext("Rules"));
$shortcut_section = "firewall";
function delete_nat_association($id) {
@@ -122,7 +122,7 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl
}
/* add openvpn/tun interfaces */
-if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
+if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$iflist["openvpn"] = "OpenVPN";
}
@@ -152,7 +152,7 @@ if ($_POST) {
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/apply");
- $savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background.<br />You can also %s monitor %s the reload progress"),"<a href='status_filter_reload.php'>","</a>");
+ $savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background.<br />You can also %s monitor %s the reload progress"), "<a href='status_filter_reload.php'>", "</a>");
}
}
@@ -516,7 +516,7 @@ include("head.inc");
$alias_dst_span_begin = "";
$alias_dst_port_span_begin = "";
- $alias_popup = rule_popup($filterent['source']['address'],pprint_port($filterent['source']['port']),$filterent['destination']['address'],pprint_port($filterent['destination']['port']));
+ $alias_popup = rule_popup($filterent['source']['address'], pprint_port($filterent['source']['port']), $filterent['destination']['address'], pprint_port($filterent['destination']['port']));
$alias_src_span_begin = $alias_popup["src"];
$alias_src_port_span_begin = $alias_popup["srcport"];
@@ -535,8 +535,8 @@ include("head.inc");
$sched_caption_escaped = "";
$sched_content = "";
$schedstatus = false;
- $dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun'));
- $monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December'));
+ $dayArray = array (gettext('Mon'), gettext('Tues'), gettext('Wed'), gettext('Thur'), gettext('Fri'), gettext('Sat'), gettext('Sun'));
+ $monthArray = array (gettext('January'), gettext('February'), gettext('March'), gettext('April'), gettext('May'), gettext('June'), gettext('July'), gettext('August'), gettext('September'), gettext('October'), gettext('November'), gettext('December'));
if ($config['schedules']['schedule'] <> "" and is_array($config['schedules']['schedule'])) {
foreach ($a_schedules as $schedule) {
if ($schedule['name'] == $filterent['sched']) {
@@ -559,7 +559,7 @@ include("head.inc");
if ($timerange['month']) {
$tempmontharray = explode(",", $timerange['month']);
- $tempdayarray = explode(",",$timerange['day']);
+ $tempdayarray = explode(",", $timerange['day']);
$arraycounter = 0;
$firstDayFound = false;
$firstPrint = false;
@@ -584,7 +584,7 @@ include("head.inc");
if ($currentDay != $firstDay) {
$dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
} else {
- $dayFriendly .= $monthArray[$month-1] . " " . $day;
+ $dayFriendly .= $monthArray[$month-1] . " " . $day;
}
$firstDayFound = false;
$firstPrint = true;
@@ -702,7 +702,7 @@ include("head.inc");
}
break;
case 'openvpn':
- if ($config['openvpn']['openvpn-server'] || $config['openvpn']['openvpn-client']) {
+ if ($config['openvpn']['openvpn-server'] || $config['openvpn']['openvpn-client']) {
$selected_descs[] = 'OpenVPN';
}
break;
@@ -743,7 +743,7 @@ include("head.inc");
echo strtoupper($filterent['protocol']);
if (strtoupper($filterent['protocol']) == "ICMP" && !empty($filterent['icmptype'])) {
echo ' <span style="cursor: help;" title="ICMP type: ' .
- ($filterent['ipprotocol'] == "inet6" ? $icmp6types[$filterent['icmptype']] : $icmptypes[$filterent['icmptype']]) .
+ ($filterent['ipprotocol'] == "inet6" ? $icmp6types[$filterent['icmptype']] : $icmptypes[$filterent['icmptype']]) .
'"><u>';
echo $filterent['icmptype'];
echo '</u></span>';
@@ -767,7 +767,7 @@ include("head.inc");
<?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
</td>
<td class="listr" onclick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
- <?=$textss;?><?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])) echo htmlspecialchars($config['interfaces'][$filterent['gateway']]['descr']); else echo htmlspecialchars(pprint_port($filterent['gateway'])); ?><?=$textse;?>
+ <?=$textss;?><?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])) echo htmlspecialchars($config['interfaces'][$filterent['gateway']]['descr']); else echo htmlspecialchars(pprint_port($filterent['gateway'])); ?><?=$textse;?>
</td>
<td class="listr" onclick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';">
<?=$textss;?>
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index 9d610ea..fa4a8eb 100644
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -328,7 +328,7 @@ if ($_POST) {
}
if (($_POST['proto'] == "icmp") && ($_POST['icmptype'] <> "")) {
if ($_POST['ipprotocol'] == "inet46") {
- $input_errors[] = gettext("You can not assign a ICMP type to a rule that applies to IPv4 and IPv6");
+ $input_errors[] = gettext("You can not assign a ICMP type to a rule that applies to IPv4 and IPv6");
}
}
@@ -389,7 +389,7 @@ if ($_POST) {
if (is_specialnet($_POST['dsttype'])) {
$_POST['dst'] = $_POST['dsttype'];
$_POST['dstmask'] = 0;
- } else if ($_POST['dsttype'] == "single") {
+ } else if ($_POST['dsttype'] == "single") {
if (is_ipaddrv6($_POST['dst'])) {
$_POST['dstmask'] = 128;
} else {
@@ -401,31 +401,31 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "type proto");
- if (isset($a_filter[$id]['associated-rule-id'])===false) {
+ if (isset($a_filter[$id]['associated-rule-id']) === false) {
$reqdfields[] = "src";
$reqdfields[] = "dst";
}
$reqdfieldsn = explode(",", "Type,Protocol");
- if (isset($a_filter[$id]['associated-rule-id'])===false) {
+ if (isset($a_filter[$id]['associated-rule-id']) === false) {
$reqdfieldsn[] = "Source";
$reqdfieldsn[] = "Destination";
}
if ($_POST['statetype'] == "modulate state" or $_POST['statetype'] == "synproxy state") {
if ($_POST['proto'] != "tcp") {
- $input_errors[] = sprintf(gettext("%s is only valid with protocol TCP."),$_POST['statetype']);
+ $input_errors[] = sprintf(gettext("%s is only valid with protocol TCP."), $_POST['statetype']);
}
if (($_POST['statetype'] == "synproxy state") && ($_POST['gateway'] != "")) {
- $input_errors[] = sprintf(gettext("%s is only valid if the gateway is set to 'default'."),$_POST['statetype']);
+ $input_errors[] = sprintf(gettext("%s is only valid if the gateway is set to 'default'."), $_POST['statetype']);
}
}
- if (isset($a_filter[$id]['associated-rule-id'])===false &&
+ if (isset($a_filter[$id]['associated-rule-id']) === false &&
(!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single")))) {
$reqdfields[] = "srcmask";
$reqdfieldsn[] = "Source bit count";
}
- if (isset($a_filter[$id]['associated-rule-id'])===false &&
+ if (isset($a_filter[$id]['associated-rule-id']) === false &&
(!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single")))) {
$reqdfields[] = "dstmask";
$reqdfieldsn[] = gettext("Destination bit count");
@@ -443,16 +443,16 @@ if ($_POST) {
}
if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport'])) {
- $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']);
+ $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcbeginposrt']);
}
if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport'])) {
- $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcendport']);
+ $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcendport']);
}
if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport'])) {
- $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstbeginport']);
+ $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstbeginport']);
}
if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport'])) {
- $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstendport']);
+ $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstendport']);
}
if (!$_POST['srcbeginport_cust'] && $_POST['srcendport_cust']) {
if (is_alias($_POST['srcendport_cust'])) {
@@ -463,8 +463,8 @@ if ($_POST) {
if (is_alias($_POST['srcendport_cust']) && is_alias($_POST['srcendport_cust']) && $_POST['srcbeginport_cust'] != $_POST['srcendport_cust']) {
$input_errors[] = 'The same port alias must be used in Source port range from: and to: fields';
}
- if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) ||
- ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust']))) {
+ if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust'] != '')) ||
+ ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust'] != '') && is_alias($_POST['srcendport_cust']))) {
$input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field';
}
}
@@ -477,8 +477,8 @@ if ($_POST) {
if (is_alias($_POST['dstendport_cust']) && is_alias($_POST['dstendport_cust']) && $_POST['dstbeginport_cust'] != $_POST['dstendport_cust']) {
$input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields';
}
- if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) ||
- ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust']))) {
+ if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust'] != '')) ||
+ ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust'] != '') && is_alias($_POST['dstendport_cust']))) {
$input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field';
}
}
@@ -504,7 +504,7 @@ if ($_POST) {
if (!is_specialnet($_POST['srctype'])) {
if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) {
- $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."),$_POST['src']);
+ $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $_POST['src']);
}
if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) {
$input_errors[] = gettext("A valid source bit count must be specified.");
@@ -512,7 +512,7 @@ if ($_POST) {
}
if (!is_specialnet($_POST['dsttype'])) {
if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) {
- $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."),$_POST['dst']);
+ $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']);
}
if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) {
$input_errors[] = gettext("A valid destination bit count must be specified.");
@@ -594,7 +594,7 @@ if ($_POST) {
}
}
- if (!in_array($_POST['proto'], array("tcp","tcp/udp"))) {
+ if (!in_array($_POST['proto'], array("tcp", "tcp/udp"))) {
if (!empty($_POST['max-src-conn'])) {
$input_errors[] = gettext("You can only specify the maximum number of established connections per host (advanced option) for TCP protocol.");
}
@@ -744,7 +744,7 @@ if ($_POST) {
$filterent['quick'] = $_POST['quick'];
}
$filterent['floating'] = "yes";
- if (isset($_POST['interface']) && count($_POST['interface']) > 0) {
+ if (isset($_POST['interface']) && count($_POST['interface']) > 0) {
$filterent['interface'] = implode(",", $_POST['interface']);
}
}
@@ -919,7 +919,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("Rules"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("Rules"), gettext("Edit"));
$shortcut_section = "firewall";
$closehead = false;
@@ -1001,7 +1001,7 @@ include("head.inc");
$edit_disabled = "disabled";
if (is_array($config['nat']['rule'])) {
foreach ($config['nat']['rule'] as $index => $nat_rule) {
- if (isset($nat_rule['associated-rule-id']) && $nat_rule['associated-rule-id']==$pconfig['associated-rule-id']) {
+ if (isset($nat_rule['associated-rule-id']) && $nat_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {
echo "<a href=\"firewall_nat_edit.php?id={$index}\">" . gettext("View the NAT rule") . "</a><br />";
break;
}
@@ -1065,7 +1065,7 @@ include("head.inc");
}
}
/* add openvpn/tun interfaces */
- if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
+ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$interfaces["openvpn"] = "OpenVPN";
}
if (is_array($pconfig['interface'])) {
@@ -1091,7 +1091,7 @@ include("head.inc");
</td>
<td width="78%" class="vtable">
<select name="direction" class="formselect">
- <?php $directions = array('any','in','out');
+ <?php $directions = array('any', 'in', 'out');
foreach ($directions as $direction): ?>
<option value="<?=$direction;?>"
<?php if ($direction == $pconfig['direction']): ?>
@@ -1109,7 +1109,7 @@ include("head.inc");
<td width="78%" class="vtable">
<select name="ipprotocol" class="formselect" onchange="proto_change()">
<?php
- $ipproto = array('inet' => 'IPv4','inet6' => 'IPv6', 'inet46' => 'IPv4+IPv6');
+ $ipproto = array('inet' => 'IPv4', 'inet6' => 'IPv6', 'inet46' => 'IPv4+IPv6');
foreach ($ipproto as $proto => $name):
?>
<option value="<?=$proto;?>"
@@ -1213,7 +1213,7 @@ include("head.inc");
?>
<?php if (have_ruleint_access($ifent)): ?>
<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("net");?></option>
- <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
+ <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
<?=$ifdesc?> <?=gettext("address");?>
</option>
<?php endif; ?>
@@ -1509,13 +1509,13 @@ include("head.inc");
$tcpflags1 = "<td width='40' class='nowrap'>set</td>";
$tcpflags2 = "<td width='40' class='nowrap'>out of</td>";
foreach ($tcpflags as $tcpflag) {
- $header .= "<td width='40' class='nowrap'><strong>" . strtoupper($tcpflag) . "</strong></td>\n";
- $tcpflags1 .= "<td width='40' class='nowrap'> <input type='checkbox' name='tcpflags1_{$tcpflag}' value='on' ";
+ $header .= "<td width='40' class='nowrap'><strong>" . strtoupper($tcpflag) . "</strong></td>\n";
+ $tcpflags1 .= "<td width='40' class='nowrap'> <input type='checkbox' name='tcpflags1_{$tcpflag}' value='on' ";
if (array_search($tcpflag, $setflags) !== false) {
$tcpflags1 .= "checked=\"checked\"";
}
$tcpflags1 .= " /></td>\n";
- $tcpflags2 .= "<td width='40' class='nowrap'> <input type='checkbox' name='tcpflags2_{$tcpflag}' value='on' ";
+ $tcpflags2 .= "<td width='40' class='nowrap'> <input type='checkbox' name='tcpflags2_{$tcpflag}' value='on' ";
if (array_search($tcpflag, $outofflags) !== false) {
$tcpflags2 .= "checked=\"checked\"";
}
@@ -1550,7 +1550,7 @@ include("head.inc");
<select name="statetype">
<option value="keep state" <?php if (!isset($pconfig['statetype']) or $pconfig['statetype'] == "keep state") echo "selected=\"selected\""; ?>><?=gettext("keep state");?></option>
<option value="sloppy state" <?php if ($pconfig['statetype'] == "sloppy state") echo "selected=\"selected\""; ?>><?=gettext("sloppy state");?></option>
- <option value="synproxy state"<?php if ($pconfig['statetype'] == "synproxy state") echo "selected=\"selected\""; ?>><?=gettext("synproxy state");?></option>
+ <option value="synproxy state"<?php if ($pconfig['statetype'] == "synproxy state") echo "selected=\"selected\""; ?>><?=gettext("synproxy state");?></option>
<option value="none"<?php if ($pconfig['statetype'] == "none") echo "selected=\"selected\""; ?>><?=gettext("none");?></option>
</select><br />
<span class="vexpl">
@@ -1926,7 +1926,7 @@ $has_updated_time = (isset($a_filter[$id]['updated']) && is_array($a_filter[$id]
<?php endif; ?>
var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
- var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
+ var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>;
var oTextbox1 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray));
var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray));
diff --git a/usr/local/www/firewall_schedule.php b/usr/local/www/firewall_schedule.php
index 347f806..e6b7a21 100644
--- a/usr/local/www/firewall_schedule.php
+++ b/usr/local/www/firewall_schedule.php
@@ -41,14 +41,14 @@
##|-PRIV
-$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun'));
-$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December'));
+$dayArray = array (gettext('Mon'), gettext('Tues'), gettext('Wed'), gettext('Thur'), gettext('Fri'), gettext('Sat'), gettext('Sun'));
+$monthArray = array (gettext('January'), gettext('February'), gettext('March'), gettext('April'), gettext('May'), gettext('June'), gettext('July'), gettext('August'), gettext('September'), gettext('October'), gettext('November'), gettext('December'));
require("guiconfig.inc");
require_once("filter.inc");
require("shaper.inc");
-$pgtitle = array(gettext("Firewall"),gettext("Schedules"));
+$pgtitle = array(gettext("Firewall"), gettext("Schedules"));
if (!is_array($config['schedules']['schedule'])) {
$config['schedules']['schedule'] = array();
@@ -76,7 +76,7 @@ if ($_GET['act'] == "del") {
}
if ($is_schedule_referenced == true) {
- $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"),$referenced_by);
+ $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"), $referenced_by);
} else {
unset($a_schedules[$_GET['id']]);
write_config();
@@ -137,7 +137,7 @@ include("head.inc");
if ($timerange['month']) {
$tempmontharray = explode(",", $timerange['month']);
- $tempdayarray = explode(",",$timerange['day']);
+ $tempdayarray = explode(",", $timerange['day']);
$arraycounter = 0;
$firstDayFound = false;
$firstPrint = false;
@@ -162,7 +162,7 @@ include("head.inc");
if ($currentDay != $firstDay) {
$dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
} else {
- $dayFriendly .= $monthArray[$month-1] . " " . $day;
+ $dayFriendly .= $monthArray[$month-1] . " " . $day;
}
$firstDayFound = false;
$firstPrint = true;
diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php
index a6df301..c0b46c0 100644
--- a/usr/local/www/firewall_schedule_edit.php
+++ b/usr/local/www/firewall_schedule_edit.php
@@ -60,12 +60,12 @@ require_once("functions.inc");
require_once("filter.inc");
require_once("shaper.inc");
-$pgtitle = array(gettext("Firewall"),gettext("Schedules"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("Schedules"), gettext("Edit"));
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_schedule.php');
-$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun'));
-$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December'));
+$dayArray = array (gettext('Mon'), gettext('Tues'), gettext('Wed'), gettext('Thur'), gettext('Fri'), gettext('Sat'), gettext('Sun'));
+$monthArray = array (gettext('January'), gettext('February'), gettext('March'), gettext('April'), gettext('May'), gettext('June'), gettext('July'), gettext('August'), gettext('September'), gettext('October'), gettext('November'), gettext('December'));
if (!is_array($config['schedules']['schedule'])) {
$config['schedules']['schedule'] = array();
@@ -126,7 +126,7 @@ if ($_POST) {
$schedule['descr'] = htmlentities($_POST['descr'], ENT_QUOTES, 'UTF-8');
$timerangeFound = false;
- for ($x=0; $x<99; $x++) {
+ for ($x = 0; $x < 99; $x++) {
if ($_POST['schedule' . $x]) {
if (!preg_match('/^[0-9]+:[0-9]+$/', $_POST['starttime' . $x])) {
$input_errors[] = sprintf(gettext("Invalid start time - '%s'"), $_POST['starttime' . $x]);
@@ -162,7 +162,7 @@ if ($_POST) {
$monthpos = strpos($currentselection, "m");
$daypos = strpos($currentselection, "d");
$monthstr .= substr($currentselection, $monthpos+1, $daypos-$monthpos-1);
- $daystr .= substr($currentselection, $daypos+1);
+ $daystr .= substr($currentselection, $daypos+1);
$firstprint = true;
}
}
@@ -220,8 +220,8 @@ $jscriptstr = <<<EOD
<script type="text/javascript">
//<![CDATA[
var daysSelected = "";
-var month_array = ['January','February','March','April','May','June','July','August','September','October','November','December'];
-var day_array = ['Mon','Tues','Wed','Thur','Fri','Sat','Sun'];
+var month_array = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
+var day_array = ['Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'];
var schCounter = 0;
function rgb2hex(rgb) {
@@ -239,10 +239,10 @@ function repeatExistingDays() {
var tempstr, tempstrdaypos, week, daypos, dayposdone = "";
var dayarray = daysSelected.split(",");
- for (i=0; i<=dayarray.length; i++) {
+ for (i = 0; i <= dayarray.length; i++) {
tempstr = dayarray[i];
tempstrdaypos = tempstr.search("p");
- week = tempstr.substring(1,tempstrdaypos);
+ week = tempstr.substring(1, tempstrdaypos);
week = parseInt(week);
dashpos = tempstr.search("-");
daypos = tempstr.substring(tempstrdaypos+1, dashpos);
@@ -253,21 +253,21 @@ function repeatExistingDays() {
daycell = eval('document.getElementById(tempstr)');
if (daydone == "-1") {
if (rgb2hex(daycell.style.backgroundColor) == "#F08080") { // lightcoral
- daytogglerepeating(week,daypos,true);
+ daytogglerepeating(week, daypos, true);
} else {
- daytogglerepeating(week,daypos,false);
+ daytogglerepeating(week, daypos, false);
}
dayposdone += daypos + ",";
}
}
}
-function daytogglerepeating(week,daypos,bExists) {
+function daytogglerepeating(week, daypos, bExists) {
var tempstr, daycell, dayoriginal = "";
for (j=1; j<=53; j++) {
tempstr = 'w' + j + 'p' + daypos;
daycell = eval('document.getElementById(tempstr)');
- dayoriginalpos = daysSelected.indexOf(tempstr);
+ dayoriginalpos = daysSelected.indexOf(tempstr);
//if bExists set to true, means cell is already select it
//unselect it and remove original day from daysSelected string
@@ -295,7 +295,7 @@ function daytoggle(id) {
iddashpos = id.search("-");
var tempstrdaypos = id.search("p");
- var week = id.substring(1,tempstrdaypos);
+ var week = id.substring(1, tempstrdaypos);
week = parseInt(week);
if (iddashpos == "-1") {
@@ -303,8 +303,8 @@ function daytoggle(id) {
runrepeat = true;
var daypos = id.substr(tempstrdaypos+1);
} else {
- idmod = id.substring(0,iddashpos);
- var daypos = id.substring(tempstrdaypos+1,iddashpos);
+ idmod = id.substring(0, iddashpos);
+ var daypos = id.substring(tempstrdaypos+1, iddashpos);
}
daypos = parseInt(daypos);
@@ -318,14 +318,14 @@ function daytoggle(id) {
str = id + ",";
daysSelected = daysSelected.replace(str, "");
} else if (rgb2hex(daycell.style.backgroundColor) == "#F08080") { // lightcoral
- daytogglerepeating(week,daypos,true);
+ daytogglerepeating(week, daypos, true);
} else {
//color is white cell
if (!runrepeat) {
daycell.style.backgroundColor = "#FF0000"; // red
} else {
daycell.style.backgroundColor = "#F08080"; // lightcoral
- daytogglerepeating(week,daypos,false);
+ daytogglerepeating(week, daypos, false);
}
daysSelected += id + ",";
}
@@ -343,7 +343,7 @@ function update_month() {
var indexNum = document.forms[0].monthsel.selectedIndex;
var selected = document.forms[0].monthsel.options[indexNum].text;
- for (i=0; i<=11; i++) {
+ for (i = 0; i <= 11; i++) {
option = document.forms[0].monthsel.options[i].text;
document.popupMonthLayer = eval('document.getElementById (option)');
@@ -413,7 +413,7 @@ function addTimeRange() {
//check for existing entries
var findCurrentCounter;
- for (u=0; u<99; u++) {
+ for (u = 0; u < 99; u++) {
findCurrentCounter = document.getElementById("schedule" + u);
if (!findCurrentCounter) {
schCounter = u;
@@ -423,11 +423,11 @@ function addTimeRange() {
if (daysSelected != "") {
//get days selected
- for (i=0; i<tempdayarray.length; i++) {
+ for (i = 0; i < tempdayarray.length; i++) {
tempstr = tempdayarray[i];
if (tempstr != "") {
tempstrdaypos = tempstr.search("p");
- week = tempstr.substring(1,tempstrdaypos);
+ week = tempstr.substring(1, tempstrdaypos);
week = parseInt(week);
dashpos = tempstr.search("-");
@@ -461,7 +461,7 @@ function addTimeRange() {
var tempFriendlyMonthArray = monthstr.split(",");
var tempFriendlyDayArray = daystr.split(",");
var currentDay, firstDay, nextDay, currentMonth, nextMonth, firstDay, firstMonth = "";
- for (k=0; k<tempFriendlyMonthArray.length; k++) {
+ for (k = 0; k < tempFriendlyMonthArray.length; k++) {
tempstr = tempFriendlyMonthArray[k];
if (tempstr != "") {
if (!firstDayFound) {
@@ -502,7 +502,7 @@ function addTimeRange() {
tempFriendlyDayArray = rtempFriendlyDay.split(",");
tempFriendlyDayArray.sort();
currentDay, firstDay, nextDay = "";
- for (k=0; k<tempFriendlyDayArray.length; k++) {
+ for (k = 0; k < tempFriendlyDayArray.length; k++) {
tempstr = tempFriendlyDayArray[k];
if (tempstr != "") {
if (!firstDayFound) {
@@ -538,7 +538,7 @@ function addTimeRange() {
tempsortArray.sort();
//clear tempID
rtempID = "";
- for (t=0; t<tempsortArray.length; t++) {
+ for (t = 0; t < tempsortArray.length; t++) {
if (tempsortArray[t] != "") {
if (!isFirstdone) {
rtempID += tempsortArray[t];
@@ -551,7 +551,7 @@ function addTimeRange() {
//get time specified
- starttimehour = document.getElementById("starttimehour").value
+ starttimehour = document.getElementById("starttimehour").value
starttimemin = document.getElementById("starttimemin").value;
stoptimehour = document.getElementById("stoptimehour").value;
stoptimemin = document.getElementById("stoptimemin").value;
@@ -694,7 +694,7 @@ function editRow(incTime, el) {
document.getElementById("timerangedescr").value = descr;
//toggle the appropriate days
- for (i=0; i<tempdayArray.length; i++) {
+ for (i = 0; i < tempdayArray.length; i++) {
if (tempdayArray[i]) {
var tempweekstr = tempdayArray[i];
dashpos = tempweekstr.search("-");
@@ -762,7 +762,7 @@ EOD;
<td width="15%" valign="top" class="vncellreq"><?=gettext("Schedule Name");?></td>
<td width="85%" class="vtable">
<?php if (is_schedule_inuse($pconfig['name']) == true): ?>
- <input name="name" type="hidden" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" />
+ <input name="name" type="hidden" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" />
<?php echo $pconfig['name']; ?>
<p>
<span class="vexpl"><?=gettext("NOTE: This schedule is in use so the name may not be modified!");?></span>
@@ -793,7 +793,7 @@ EOD;
$monthcounter = date("n");
$monthlimit = $monthcounter + 12;
$yearcounter = date("Y");
- for ($k=0; $k<12; $k++) {?>
+ for ($k = 0; $k < 12; $k++) {?>
<option value="<?php echo $monthcounter;?>"><?php echo date("F_y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?></option>
<?php
if ($monthcounter == 12) {
@@ -809,7 +809,7 @@ EOD;
$firstmonth = TRUE;
$monthcounter = date("n");
$yearcounter = date("Y");
- for ($k=0; $k<12; $k++) {
+ for ($k = 0; $k < 12; $k++) {
$firstdayofmonth = date("w", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));
if ($firstdayofmonth == 0) {
$firstdayofmonth = 7;
@@ -822,7 +822,7 @@ EOD;
$lasttr = FALSE;
$positioncounter = 1;//7 for Sun, 1 for Mon, 2 for Tues, etc
?>
- <div id="<?php echo date("F_y",mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?>" style=" position:relative; display:<?php if ($firstmonth)echo "block";else echo "none";?>">
+ <div id="<?php echo date("F_y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?>" style=" position:relative; display:<?php if ($firstmonth)echo "block";else echo "none";?>">
<table border="1" cellspacing="1" cellpadding="1" id="calTable<?=$monthcounter . $yearcounter;?>" class="tabcont" summary="month">
<tr>
<td colspan="7" align="center" class="listbg"><b><?php echo date("F_Y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?></b></td>
@@ -839,7 +839,7 @@ EOD;
<?php
$firstmonth = FALSE;
while ($daycounter<=$numberofdays) {
- $weekcounter = date("W", mktime(0, 0, 0, date($monthcounter), date($daycounter), date($yearcounter)));
+ $weekcounter = date("W", mktime(0, 0, 0, date($monthcounter), date($daycounter), date($yearcounter)));
$weekcounter = ltrim($weekcounter, "0");
if ($positioncounter == 1) {
echo "<tr>";
@@ -898,7 +898,7 @@ EOD;
<td>
<select name="starttimehour" class="formselect" id="starttimehour">
<?php
- for ($i=0; $i<24; $i++) {
+ for ($i = 0; $i < 24; $i++) {
echo "<option value=\"$i\">";
echo $i;
echo "</option>";
@@ -917,8 +917,8 @@ EOD;
<td>
<select name="stoptimehour" class="formselect" id="stoptimehour">
<?php
- for ($i=0; $i<24; $i++) {
- if ($i==23) {
+ for ($i = 0; $i < 24; $i++) {
+ if ($i == 23) {
$selected = "selected=\"selected\"";
} else {
$selected = "";
@@ -955,7 +955,7 @@ EOD;
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
- <input type="button" value="<?=gettext("Add Time");?>" class="formbtn" onclick="javascript:processEntries();" />&nbsp;&nbsp;&nbsp;
+ <input type="button" value="<?=gettext("Add Time");?>" class="formbtn" onclick="javascript:processEntries();" />&nbsp;&nbsp;&nbsp;
<input type="button" value="<?=gettext("Clear Selection");?>" class="formbtn" onclick="javascript:clearCalendar(); clearTime(); clearDescr();" />
</td>
</tr>
@@ -1005,7 +1005,7 @@ EOD;
if ($timerange['month']) {
$tempmontharray = explode(",", $timerange['month']);
- $tempdayarray = explode(",",$timerange['day']);
+ $tempdayarray = explode(",", $timerange['day']);
$arraycounter = 0;
foreach ($tempmontharray as $monthtmp) {
$month = $tempmontharray[$arraycounter];
@@ -1021,7 +1021,7 @@ EOD;
if ($firstPrint) {
$tempID .= ",";
}
- $tempID .= "w" . $weeknumber . "p" . $daypos . "-m" . $month . "d" . $day;
+ $tempID .= "w" . $weeknumber . "p" . $daypos . "-m" . $month . "d" . $day;
$firstPrint = true;
if (!$firstDayFound) {
@@ -1041,7 +1041,7 @@ EOD;
if ($currentDay != $firstDay) {
$tempFriendlyTime .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
} else {
- $tempFriendlyTime .= $monthArray[$month-1] . " " . $day;
+ $tempFriendlyTime .= $monthArray[$month-1] . " " . $day;
}
$firstDayFound = false;
$firstprint2 = true;
diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php
index 043200b..7b8f489 100644
--- a/usr/local/www/firewall_shaper.php
+++ b/usr/local/www/firewall_shaper.php
@@ -52,7 +52,7 @@ if ($_GET['reset'] <> "") {
exit;
}
-$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"));
+$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"));
$shortcut_section = "trafficshaper";
$shaperIFlist = get_configured_interface_with_descr();
@@ -163,7 +163,7 @@ if ($_GET) {
$q = new cbq_queue();
break;
default:
- /* XXX: Happens when sched==NONE?! */
+ /* XXX: Happens when sched == NONE?! */
$q = new altq_root_queue();
break;
}
@@ -194,8 +194,9 @@ if ($_GET) {
if ($queue) {
$queue->SetEnabled("on");
$output_form .= $queue->build_form();
- if (write_config())
+ if (write_config()) {
mark_subsystem_dirty('shaper');
+ }
} else {
$input_errors[] = gettext("Queue not found!");
}
@@ -333,7 +334,7 @@ if ($_GET) {
}
read_altq_config();
$output_form .= $queue->build_form();
- } else {
+ } else {
$output_form .= $default_shaper_msg;
$dontshow = true;
}
@@ -405,7 +406,7 @@ if (!$dontshow || $newqueue) {
$output_form .= "</table>";
}
-$output = "<table summary=\"output form\">";
+$output = "<table summary=\"output form\">";
$output .= $output_form;
//$pgtitle = "Firewall: Shaper: By Interface View";
diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php
index ae38988..9a72233 100644
--- a/usr/local/www/firewall_shaper_layer7.php
+++ b/usr/local/www/firewall_shaper_layer7.php
@@ -46,7 +46,7 @@ require_once("shaper.inc");
// Variables protocols (dynamic) and structures (static)
$avail_protos =& generate_protocols_array();
-$avail_structures = array("action","queue","limiter");
+$avail_structures = array("action", "queue", "limiter");
// Available behaviours
$avail_behaviours_action = array("block");
@@ -57,7 +57,7 @@ $avail_behaviours_limiter = get_dummynet_name_list();
$show_proto_form = false;
//More variables
-$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Layer7"));
+$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"), gettext("Layer7"));
$shortcut_section = "trafficshaper";
$output_form = "";
@@ -131,17 +131,17 @@ if ($_GET) {
$l7r =& new layer7();
$_POST['divert_port'] = $l7r->gen_divert_port();
}
- for ($i=0; $_POST['protocol'][$i] <> ""; $i++) {
+ for ($i = 0; $_POST['protocol'][$i] <> ""; $i++) {
$_POST['l7rules'][$i]['protocol'] = $_POST['protocol'][$i];
$_POST['l7rules'][$i]['structure'] = $_POST['structure'][$i];
$_POST['l7rules'][$i]['behaviour'] = $_POST['behaviour'][$i];
}
- $l7r->validate_input($_POST,$input_errors);
+ $l7r->validate_input($_POST, $input_errors);
$l7r->ReadConfig($_POST['container'], $_POST);
//Before writing the results, we need to test for repeated protocols
$non_dupes = array();
$dupes = array();
- for ($j=0; $j<$i; $j++) {
+ for ($j = 0; $j < $i; $j++) {
if (!$non_dupes[$_POST['protocol'][$j]]) {
$non_dupes[$_POST['protocol'][$j]] = true;
} else {
@@ -340,7 +340,7 @@ function changeBehaviourValues(row) {
//Build the html statement with the array values previously selected
var new_behav;
var name;
- for (i=0; i<a_behav.length; i++) {
+ for (i = 0; i < a_behav.length; i++) {
new_behav += "<option value=" + a_behav[i] + ">" + a_behav[i] + "<\/option>";
}
@@ -357,8 +357,8 @@ function addRow(table_id) {
initial_count[table_id] = rows_count;
}
// determining real count of added fields
- var tFielsNum = rows_count - initial_count[table_id];
- if (rows_limit!=0 && tFielsNum >= rows_limit) return false;
+ var tFielsNum = rows_count - initial_count[table_id];
+ if (rows_limit != 0 && tFielsNum >= rows_limit) return false;
var remove = '<a onclick="removeRow(\''+table_id+'\',this.parentNode.parentNode)" href="#"><img border="0" src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" alt="x" /><\/a>';
@@ -380,7 +380,7 @@ function addRow(table_id) {
}
/* Remove row from the table */
-function removeRow(tbl,row) {
+function removeRow(tbl, row) {
var table = document.getElementById(tbl);
try {
table.deleteRow(row.rowIndex);
@@ -402,7 +402,7 @@ function removeRow(tbl,row) {
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?><p>
-<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p>
+<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="traffic shaper layer7">
<tr><td>
@@ -434,7 +434,7 @@ function removeRow(tbl,row) {
?>
<br /><br />
<a href="firewall_shaper_layer7.php?action=add">
- <img src="./themes/<?=$g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("Create new l7 rules group"); ?>" width="17" height="17" border="0" alt="add" /> <?=gettext("Create new l7 rules group"); ?>
+ <img src="./themes/<?=$g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("Create new l7 rules group"); ?>" width="17" height="17" border="0" alt="add" /> <?=gettext("Create new l7 rules group"); ?>
</a>
<br />
</td>
@@ -489,14 +489,14 @@ function removeRow(tbl,row) {
<tr>
<td>
<select name="protocol[]" class="formselect" style="font-size:8pt">
- <?php foreach ($avail_protos as $proto): ?>
+ <?php foreach ($avail_protos as $proto): ?>
<option value="<?=$proto;?>" <?php if ($proto == $l7rule->GetRProtocol()) echo "selected=\"selected\""; ?>><?=$proto;?></option>
- <?php endforeach; ?>
+ <?php endforeach; ?>
</select>
</td>
<td>
<select name="structure[]" class="formselect" style="font-size:8pt" onchange="changeBehaviourValues(this.parentNode.parentNode);">
- <?php foreach ($avail_structures as $struct) {
+ <?php foreach ($avail_structures as $struct) {
if ($struct == "queue") {
if (!empty($avail_behaviours_altq)) { ?>
<option value="<?=$struct ?>" <?php if ($struct == $l7rule->GetRStructure()) echo "selected=\"selected\""; ?>><?=$struct;?></option>
@@ -535,7 +535,7 @@ function removeRow(tbl,row) {
</select>
</td>
<td>
- <a onclick="removeRow('maintable',this.parentNode.parentNode); return false;" href="#"><img border="0" src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" alt="x" /></a>
+ <a onclick="removeRow('maintable', this.parentNode.parentNode); return false;" href="#"><img border="0" src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" alt="x" /></a>
</td>
</tr>
<?php
diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php
index 8c979ae..ffa3f15 100644
--- a/usr/local/www/firewall_shaper_vinterface.php
+++ b/usr/local/www/firewall_shaper_vinterface.php
@@ -51,7 +51,7 @@ if ($_GET['reset'] <> "") {
exit;
}
-$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Limiter"));
+$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"), gettext("Limiter"));
$shortcut_section = "trafficshaper-limiters";
read_dummynet_config();
@@ -121,7 +121,7 @@ if ($_GET) {
}
$output_form .= $queue->build_form();
} else {
- $input_errors[] = sprintf(gettext("No queue with name %s was found!"),$qname);
+ $input_errors[] = sprintf(gettext("No queue with name %s was found!"), $qname);
$output_form .= $dn_default_shaper_msg;
$dontshow = true;
}
@@ -305,7 +305,7 @@ if ($_GET) {
}
read_dummynet_config();
$output_form .= $queue->build_form();
- } else {
+ } else {
$output_form .= $dn_default_shaper_msg;
$dontshow = true;
}
diff --git a/usr/local/www/firewall_shaper_wizards.php b/usr/local/www/firewall_shaper_wizards.php
index 763aa58..583fdef 100644
--- a/usr/local/www/firewall_shaper_wizards.php
+++ b/usr/local/www/firewall_shaper_wizards.php
@@ -72,7 +72,7 @@ if ($_POST['apply']) {
clear_subsystem_dirty('shaper');
}
-$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"),gettext("Wizards"));
+$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"), gettext("Wizards"));
$shortcut_section = "trafficshaper";
$wizards = array(
@@ -88,7 +88,7 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
-<?php include("fbegin.inc"); ?>
+<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_shaper_wizards.php" method="post" id="iform" name="iform">
@@ -112,7 +112,7 @@ include("head.inc");
<tr>
<td>
<div id="mainarea">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
<tr>
<td class="listhdrr" width="25%" align="center" ><?=gettext("Wizard function");?></td>
<td class="listhdrr" width="75%" align="center"><?=gettext("Wizard Link");?></td>
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index 200e9ac..148477f 100644
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -107,7 +107,7 @@ if ($_GET['act'] == "del") {
/* make sure no inbound NAT mappings reference this entry */
if (is_array($config['nat']['rule'])) {
foreach ($config['nat']['rule'] as $rule) {
- if($rule['destination']['address'] <> "") {
+ if ($rule['destination']['address'] <> "") {
if ($rule['destination']['address'] == $a_vip[$_GET['id']]['subnet']) {
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one NAT mapping.");
break;
@@ -152,7 +152,7 @@ if ($_GET['act'] == "del") {
$if_subnet .= "/" . $if_subnet_bits;
if (is_array($config['gateways']['gateway_item'])) {
- foreach($config['gateways']['gateway_item'] as $gateway) {
+ foreach ($config['gateways']['gateway_item'] as $gateway) {
if ($a_vip[$_GET['id']]['interface'] != $gateway['interface']) {
continue;
}
@@ -242,7 +242,7 @@ if ($_GET['act'] == "del") {
$id = $_GET['id'];
}
-$pgtitle = array(gettext("Firewall"),gettext("Virtual IP Addresses"));
+$pgtitle = array(gettext("Firewall"), gettext("Virtual IP Addresses"));
include("head.inc");
?>
@@ -299,20 +299,20 @@ include("head.inc");
$interfaces['lo0'] = "Localhost";
$i = 0;
foreach ($a_vip as $vipent):
- if($vipent['subnet'] <> "" or $vipent['range'] <> "" or $vipent['subnet_bits'] <> "" or (isset($vipent['range']['from']) && $vipent['range']['from'] <> "")):
+ if ($vipent['subnet'] <> "" or $vipent['range'] <> "" or $vipent['subnet_bits'] <> "" or (isset($vipent['range']['from']) && $vipent['range']['from'] <> "")):
?>
<tr>
<td class="listlr" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
<?php
if (($vipent['type'] == "single") || ($vipent['type'] == "network")) {
- if($vipent['subnet_bits']) {
+ if ($vipent['subnet_bits']) {
echo "{$vipent['subnet']}/{$vipent['subnet_bits']}";
}
}
if ($vipent['type'] == "range") {
echo "{$vipent['range']['from']}-{$vipent['range']['to']}";
}
- if($vipent['mode'] == "carp") {
+ if ($vipent['mode'] == "carp") {
echo " (vhid {$vipent['vhid']})";
}
?>
@@ -321,7 +321,7 @@ include("head.inc");
<?=htmlspecialchars($interfaces[$vipent['interface']]);?>&nbsp;
</td>
<td class="listr" align="center" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
- <?php if($vipent['mode'] == "proxyarp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_parp.gif' title='Proxy ARP' alt='proxy arp' />"; elseif($vipent['mode'] == "carp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_carp.gif' title='CARP' alt='carp' />"; elseif($vipent['mode'] == "other") echo "<img src='./themes/".$g['theme']."/images/icons/icon_other.gif' title='Other' alt='other' />"; elseif($vipent['mode'] == "ipalias") echo "<img src='./themes/".$g['theme']."/images/icons/icon_ifalias.gif' title='IP Alias' alt='ip alias' />";?>
+ <?php if ($vipent['mode'] == "proxyarp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_parp.gif' title='Proxy ARP' alt='proxy arp' />"; elseif ($vipent['mode'] == "carp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_carp.gif' title='CARP' alt='carp' />"; elseif ($vipent['mode'] == "other") echo "<img src='./themes/".$g['theme']."/images/icons/icon_other.gif' title='Other' alt='other' />"; elseif ($vipent['mode'] == "ipalias") echo "<img src='./themes/".$g['theme']."/images/icons/icon_ifalias.gif' title='IP Alias' alt='ip alias' />";?>
</td>
<td class="listbg" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
<?=htmlspecialchars($vipent['descr']);?>&nbsp;
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index 174f6ee..709f10c 100644
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -186,7 +186,7 @@ if ($_POST) {
$idtracker = 0;
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['vhid'] == $_POST['vhid'] && $vip['interface'] == $_POST['interface'] && $idtracker <> $id) {
- $input_errors[] = sprintf(gettext("VHID %s is already in use on interface %s. Pick a unique number on this interface."),$_POST['vhid'], convert_friendly_interface_to_friendly_descr($_POST['interface']));
+ $input_errors[] = sprintf(gettext("VHID %s is already in use on interface %s. Pick a unique number on this interface."), $_POST['vhid'], convert_friendly_interface_to_friendly_descr($_POST['interface']));
}
$idtracker++;
}
@@ -214,7 +214,7 @@ if ($_POST) {
if (isset($parent_ip) && !ip_in_subnet($_POST['subnet'], "{$subnet}/{$parent_sn}") &&
!ip_in_interface_alias_subnet(link_carp_interface_to_parent($_POST['interface']), $_POST['subnet'])) {
$cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ;
- $input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."),$cannot_find);
+ $input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."), $cannot_find);
}
unset($parent_ip, $parent_sn, $subnet);
}
@@ -299,7 +299,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Firewall"),gettext("Virtual IP Address"),gettext("Edit"));
+$pgtitle = array(gettext("Firewall"), gettext("Virtual IP Address"), gettext("Edit"));
include("head.inc");
?>
@@ -337,9 +337,9 @@ function enable_change() {
document.iform.vhid.disabled = $mode != "carp";
document.iform.advskew.disabled = $mode != "carp";
document.iform.advbase.disabled = $mode != "carp";
- document.iform.type.disabled = $mode in {"carp":1,"ipalias":1};
+ document.iform.type.disabled = $mode in {"carp":1, "ipalias":1};
- if ($mode in {"carp":1,"ipalias":1}) {
+ if ($mode in {"carp":1, "ipalias":1}) {
document.iform.type.selectedIndex = 0;// single-adress
}
switch ($mode) {
@@ -357,13 +357,13 @@ function typesel_change() {
document.iform.subnet.disabled = 0;
document.iform.subnet_bits.disabled = (get_radio_value(document.iform.mode) == "proxyarp") || (get_radio_value(document.iform.mode) == "other");
document.iform.noexpand.disabled = 1;
- jQuery('#noexpandrow').css('display','none');
+ jQuery('#noexpandrow').css('display', 'none');
break;
case 1: // network
document.iform.subnet.disabled = 0;
document.iform.subnet_bits.disabled = 0;
document.iform.noexpand.disabled = 0;
- jQuery('#noexpandrow').css('display','');
+ jQuery('#noexpandrow').css('display', '');
//document.iform.range_from.disabled = 1;
//document.iform.range_to.disabled = 1;
break;
@@ -371,7 +371,7 @@ function typesel_change() {
document.iform.subnet.disabled = 1;
document.iform.subnet_bits.disabled = 1;
document.iform.noexpand.disabled = 1;
- jQuery('#noexpandrow').css('display','none');
+ jQuery('#noexpandrow').css('display', 'none');
//document.iform.range_from.disabled = 0;
//document.iform.range_to.disabled = 0;
break;
@@ -379,7 +379,7 @@ function typesel_change() {
document.iform.subnet.disabled = 1;
document.iform.subnet_bits.disabled = 0;
document.iform.noexpand.disabled = 1;
- jQuery('#noexpandrow').css('display','none');
+ jQuery('#noexpandrow').css('display', 'none');
//document.iform.range_from.disabled = 0;
//document.iform.range_to.disabled = 0;
break;
@@ -485,7 +485,7 @@ function typesel_change() {
</tr>
<tr valign="top">
<td width="22%" class="vncellreq"><?=gettext("Virtual IP Password");?></td>
- <td class="vtable"><input type='password' name='password' value="<?=htmlspecialchars($pconfig['password']);?>" />
+ <td class="vtable"><input type='password' name='password' value="<?=htmlspecialchars($pconfig['password']);?>" />
<br /><?=gettext("Enter the VHID group password.");?>
</td>
</tr>
diff --git a/usr/local/www/getserviceproviders.php b/usr/local/www/getserviceproviders.php
index 40365e6..cb456aa 100644
--- a/usr/local/www/getserviceproviders.php
+++ b/usr/local/www/getserviceproviders.php
@@ -41,7 +41,7 @@ require_once("pfsense-utils.inc");
$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml";
$serviceproviders_contents = file_get_contents($serviceproviders_xml);
-$serviceproviders_attr = xml2array($serviceproviders_contents,1,"attr");
+$serviceproviders_attr = xml2array($serviceproviders_contents, 1, "attr");
$serviceproviders = &$serviceproviders_attr['serviceproviders']['country'];
@@ -74,7 +74,7 @@ function providers_list($country) {
}
}
-function provider_plan_data($country,$provider,$connection) {
+function provider_plan_data($country, $provider, $connection) {
header("Content-type: application/xml;");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<connection>\n";
@@ -100,7 +100,7 @@ function provider_plan_data($country,$provider,$connection) {
echo "<username>" . $conndata['username']['value'] . "</username>\n";
echo "<password>" . $conndata['password']['value'] . "</password>\n";
- $dns_arr = is_array($conndata['dns'][0]) ? $conndata['dns'] : array( $conndata['dns'] );
+ $dns_arr = is_array($conndata['dns'][0]) ? $conndata['dns'] : array($conndata['dns']);
foreach ($dns_arr as $dns) {
echo '<dns>' . $dns['value'] . "</dns>\n";
}
@@ -111,12 +111,12 @@ function provider_plan_data($country,$provider,$connection) {
echo "</connection>";
}
-function provider_plans_list($country,$provider) {
+function provider_plans_list($country, $provider) {
$serviceproviders = get_country_providers($country);
foreach ($serviceproviders as $sp) {
if (strtolower($sp['name']['value']) == strtolower($provider)) {
- if (array_key_exists('gsm',$sp)) {
- if (array_key_exists('attr',$sp['gsm']['apn'])) {
+ if (array_key_exists('gsm', $sp)) {
+ if (array_key_exists('attr', $sp['gsm']['apn'])) {
$name = ($sp['gsm']['apn']['name'] ? $sp['gsm']['apn']['name'] : $sp['name']['value']);
echo $name . ":" . $sp['gsm']['apn']['attr']['value'];
} else {
@@ -126,7 +126,7 @@ function provider_plans_list($country,$provider) {
}
}
}
- if (array_key_exists('cdma',$sp)) {
+ if (array_key_exists('cdma', $sp)) {
$name = $sp['cdma']['name']['value'] ? $sp['cdma']['name']['value']:$sp['name']['value'];
echo $name . ":" . "CDMA";
}
@@ -140,9 +140,9 @@ if (isset($_GET_OR_POST['country']) && !isset($_GET_OR_POST['provider'])) {
providers_list($_GET_OR_POST['country']);
} elseif (isset($_GET_OR_POST['country']) && isset($_GET_OR_POST['provider'])) {
if (isset($_GET_OR_POST['plan'])) {
- provider_plan_data($_GET_OR_POST['country'],$_GET_OR_POST['provider'],$_GET_OR_POST['plan']);
+ provider_plan_data($_GET_OR_POST['country'], $_GET_OR_POST['provider'], $_GET_OR_POST['plan']);
} else {
- provider_plans_list($_GET_OR_POST['country'],$_GET_OR_POST['provider']);
+ provider_plans_list($_GET_OR_POST['country'], $_GET_OR_POST['provider']);
}
} else {
country_list();
diff --git a/usr/local/www/getstats.php b/usr/local/www/getstats.php
index bca6557..886114b 100644
--- a/usr/local/www/getstats.php
+++ b/usr/local/www/getstats.php
@@ -37,9 +37,9 @@
##|*MATCH=getstats.php*
##|-PRIV
-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
require_once("guiconfig.inc");
diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php
index cede7d9..d637836 100755
--- a/usr/local/www/graph.php
+++ b/usr/local/www/graph.php
@@ -43,16 +43,16 @@
require("globals.inc");
require("guiconfig.inc");
-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
header("Content-type: image/svg+xml");
/********** HTTP GET Based Conf ***********/
-$ifnum=@$_GET["ifnum"]; // BSD / SNMP interface name / number
+$ifnum = @$_GET["ifnum"]; // BSD / SNMP interface name / number
$ifnum = get_real_interface($ifnum);
-$ifname=@$_GET["ifname"]?$_GET["ifname"]:"Interface $ifnum"; //Interface name that will be showed on top right of graph
+$ifname = @$_GET["ifname"]?$_GET["ifname"]:"Interface $ifnum"; //Interface name that will be showed on top right of graph
/********* Other conf *******/
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) {
@@ -106,74 +106,78 @@ if (file_exists("/usr/local/www/themes/{$g['theme']}/graph.php")) {
/********* Graph DATA **************/
print('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?>
<svg width="100%" height="100%" viewBox="0 0 <?=$width?> <?=$height?>" preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt)">
- <g id="graph">
- <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/>
- <line id="axis_x" x1="0" y1="0" x2="0" y2="100%" <?=$attribs['axis']?>/>
- <line id="axis_y" x1="0" y1="100%" x2="100%" y2="100%" <?=$attribs['axis']?>/>
- <path id="graph_out" d="M0 <?=$height?> L 0 <?=$height?>" <?=$attribs['graph_out']?>/>
- <path id="graph_in" d="M0 <?=$height?> L 0 <?=$height?>" <?=$attribs['graph_in']?>/>
- <path id="grid" d="M0 <?=$height/4*1?> L <?=$width?> <?=$height/4*1?> M0 <?=$height/4*2?> L <?=$width?> <?=$height/4*2?> M0 <?=$height/4*3?> L <?=$width?> <?=$height/4*3?>" <?=$attribs['grid']?>/>
- <text id="grid_txt1" x="<?=$width?>" y="<?=$height/4*1?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
- <text id="grid_txt2" x="<?=$width?>" y="<?=$height/4*2?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
- <text id="grid_txt3" x="<?=$width?>" y="<?=$height/4*3?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
- <text id="graph_in_lbl" x="5" y="8" <?=$attribs['in']?>><?=gettext("In"); ?></text>
- <text id="graph_out_lbl" x="5" y="16" <?=$attribs['out']?>><?=gettext("Out"); ?></text>
- <text id="graph_in_txt" x="20" y="8" <?=$attribs['in']?>> </text>
- <text id="graph_out_txt" x="20" y="16" <?=$attribs['out']?>> </text>
- <text id="ifname" x="<?=$width?>" y="8" <?=$attribs['graphname']?> text-anchor="end"><?=htmlspecialchars($ifname)?></text>
- <text id="switch_unit" x="<?=$width*0.55?>" y="5" <?=$attribs['switch_unit']?>><?=gettext("Switch to bytes/s"); ?></text>
- <text id="switch_scale" x="<?=$width*0.55?>" y="11" <?=$attribs['switch_scale']?>><?=gettext("AutoScale"); ?> (<?=$scale_type?>)</text>
- <text id="date" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text>
- <text id="time" x="<?=$width*0.33?>" y="11" <?=$attribs['legend']?>> </text>
- <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=gettext("Graph shows last"); ?> <?=$time_interval*$nb_plot?> <?=gettext("seconds"); ?></text>
- <polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
- <text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=$error_text?></text>
- <text id="collect_initial" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text>
- </g>
- <script type="text/ecmascript">
- <![CDATA[
+ <g id="graph">
+ <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/>
+ <line id="axis_x" x1="0" y1="0" x2="0" y2="100%" <?=$attribs['axis']?>/>
+ <line id="axis_y" x1="0" y1="100%" x2="100%" y2="100%" <?=$attribs['axis']?>/>
+ <path id="graph_out" d="M0 <?=$height?> L 0 <?=$height?>" <?=$attribs['graph_out']?>/>
+ <path id="graph_in" d="M0 <?=$height?> L 0 <?=$height?>" <?=$attribs['graph_in']?>/>
+ <path id="grid" d="M0 <?=$height/4*1?> L <?=$width?> <?=$height/4*1?> M0 <?=$height/4*2?> L <?=$width?> <?=$height/4*2?> M0 <?=$height/4*3?> L <?=$width?> <?=$height/4*3?>" <?=$attribs['grid']?>/>
+ <text id="grid_txt1" x="<?=$width?>" y="<?=$height/4*1?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
+ <text id="grid_txt2" x="<?=$width?>" y="<?=$height/4*2?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
+ <text id="grid_txt3" x="<?=$width?>" y="<?=$height/4*3?>" <?=$attribs['grid_txt']?> text-anchor="end"> </text>
+ <text id="graph_in_lbl" x="5" y="8" <?=$attribs['in']?>><?=gettext("In"); ?></text>
+ <text id="graph_out_lbl" x="5" y="16" <?=$attribs['out']?>><?=gettext("Out"); ?></text>
+ <text id="graph_in_txt" x="20" y="8" <?=$attribs['in']?>> </text>
+ <text id="graph_out_txt" x="20" y="16" <?=$attribs['out']?>> </text>
+ <text id="ifname" x="<?=$width?>" y="8" <?=$attribs['graphname']?> text-anchor="end"><?=htmlspecialchars($ifname)?></text>
+ <text id="switch_unit" x="<?=$width*0.55?>" y="5" <?=$attribs['switch_unit']?>><?=gettext("Switch to bytes/s"); ?></text>
+ <text id="switch_scale" x="<?=$width*0.55?>" y="11" <?=$attribs['switch_scale']?>><?=gettext("AutoScale"); ?> (<?=$scale_type?>)</text>
+ <text id="date" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text>
+ <text id="time" x="<?=$width*0.33?>" y="11" <?=$attribs['legend']?>> </text>
+ <text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=gettext("Graph shows last"); ?> <?=$time_interval*$nb_plot?> <?=gettext("seconds"); ?></text>
+ <polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
+ <text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=$error_text?></text>
+ <text id="collect_initial" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text>
+ </g>
+ <script type="text/ecmascript">
+ <![CDATA[
/**
* getURL is a proprietary Adobe function, but it's simplicity has made it very
* popular. If getURL is undefined we spin our own by wrapping XMLHttpRequest.
*/
if (typeof getURL == 'undefined') {
- getURL = function(url, callback) {
- if (!url)
- throw '<?=gettext("No URL for getURL"); ?>';
-
- try {
- if (typeof callback.operationComplete == 'function')
- callback = callback.operationComplete;
- } catch (e) {}
- if (typeof callback != 'function')
- throw '<?=gettext("No callback function for getURL"); ?>';
-
- var http_request = null;
- if (typeof XMLHttpRequest != 'undefined') {
- http_request = new XMLHttpRequest();
- } else if (typeof ActiveXObject != 'undefined') {
- try {
- http_request = new ActiveXObject('Msxml2.XMLHTTP');
- } catch (e) {
- try {
- http_request = new ActiveXObject('Microsoft.XMLHTTP');
- } catch (e) {}
- }
- }
- if (!http_request)
- throw '<?=gettext("Both getURL and XMLHttpRequest are undefined"); ?>';
-
- http_request.onreadystatechange = function() {
- if (http_request.readyState == 4) {
- callback( { success : true,
- content : http_request.responseText,
- contentType : http_request.getResponseHeader("Content-Type") } );
- }
- }
- http_request.open('GET', url, true);
- http_request.send(null);
- }
+ getURL = function(url, callback) {
+ if (!url) {
+ throw '<?=gettext("No URL for getURL"); ?>';
+ }
+
+ try {
+ if (typeof callback.operationComplete == 'function') {
+ callback = callback.operationComplete;
+ }
+ } catch (e) {}
+ if (typeof callback != 'function') {
+ throw '<?=gettext("No callback function for getURL"); ?>';
+ }
+
+ var http_request = null;
+ if (typeof XMLHttpRequest != 'undefined') {
+ http_request = new XMLHttpRequest();
+ } else if (typeof ActiveXObject != 'undefined') {
+ try {
+ http_request = new ActiveXObject('Msxml2.XMLHTTP');
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject('Microsoft.XMLHTTP');
+ } catch (e) {}
+ }
+ }
+ if (!http_request) {
+ throw '<?=gettext("Both getURL and XMLHttpRequest are undefined"); ?>';
+ }
+
+ http_request.onreadystatechange = function() {
+ if (http_request.readyState == 4) {
+ callback( { success : true,
+ content : http_request.responseText,
+ contentType : http_request.getResponseHeader("Content-Type") } );
+ }
+ }
+ http_request.open('GET', url, true);
+ http_request.send(null);
+ }
}
var SVGDoc = null;
@@ -190,202 +194,215 @@ var unit = 'bits';
var scale_type = '<?=$scale_type?>';
function init(evt) {
- SVGDoc = evt.target.ownerDocument;
- SVGDoc.getElementById("switch_unit").addEventListener("mousedown", switch_unit, false);
- SVGDoc.getElementById("switch_scale").addEventListener("mousedown", switch_scale, false);
+ SVGDoc = evt.target.ownerDocument;
+ SVGDoc.getElementById("switch_unit").addEventListener("mousedown", switch_unit, false);
+ SVGDoc.getElementById("switch_scale").addEventListener("mousedown", switch_scale, false);
- fetch_data();
+ fetch_data();
}
-function switch_unit(event)
-{
- SVGDoc.getElementById('switch_unit').firstChild.data = '<?=gettext("Switch to"); ?> ' + unit + '/s';
- unit = (unit == 'bits') ? 'bytes' : 'bits';
+function switch_unit(event) {
+ SVGDoc.getElementById('switch_unit').firstChild.data = '<?=gettext("Switch to"); ?> ' + unit + '/s';
+ unit = (unit == 'bits') ? 'bytes' : 'bits';
}
-function switch_scale(event)
-{
- scale_type = (scale_type == 'up') ? '<?=gettext("follow"); ?>' : '<?=gettext("up"); ?>';
- SVGDoc.getElementById('switch_scale').firstChild.data = 'AutoScale (' + scale_type + ')';
+function switch_scale(event) {
+ scale_type = (scale_type == 'up') ? '<?=gettext("follow"); ?>' : '<?=gettext("up"); ?>';
+ SVGDoc.getElementById('switch_scale').firstChild.data = 'AutoScale (' + scale_type + ')';
}
function fetch_data() {
- getURL('<?=$fetch_link?>', plot_data);
+ getURL('<?=$fetch_link?>', plot_data);
}
function plot_data(obj) {
- // Show datetimelegend
- var now = new Date();
- var time = LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds());
- SVGDoc.getElementById('time').firstChild.data = time;
- var date = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear();
- SVGDoc.getElementById('date').firstChild.data = date;
-
- if (!obj.success)
- return handle_error(); // getURL failed to get data
-
- var t = obj.content.split("|");
- var ugmt = parseFloat(t[0]); // ugmt is an unixtimestamp style
- var ifin = parseInt(t[1], 10); // number of bytes received by the interface
- var ifout = parseInt(t[2], 10); // number of bytes sent by the interface
- var scale;
-
- if (!isNumber(ifin) || !isNumber(ifout))
- return handle_error();
-
- var diff_ugmt = ugmt - last_ugmt;
- var diff_ifin = ifin - last_ifin;
- var diff_ifout = ifout - last_ifout;
-
- if (diff_ugmt == 0)
- diff_ugmt = 1; /* avoid division by zero */
-
- last_ugmt = ugmt;
- last_ifin = ifin;
- last_ifout = ifout;
- var graphTimerId = 0;
- switch (plot_in.length) {
- case 0:
- SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
- plot_in[0] = diff_ifin / diff_ugmt;
- plot_out[0] = diff_ifout / diff_ugmt;
- setTimeout('fetch_data()',<?=1000*($time_interval + $init_delay)?>);
- return;
- case 1:
- SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
- break;
- case max_num_points:
- // shift plot to left if the maximum number of plot points has been reached
- var i = 0;
- while (i < max_num_points) {
- plot_in[i] = plot_in[i+1];
- plot_out[i] = plot_out[++i];
+ // Show datetimelegend
+ var now = new Date();
+ var time = LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds());
+ SVGDoc.getElementById('time').firstChild.data = time;
+ var date = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear();
+ SVGDoc.getElementById('date').firstChild.data = date;
+
+ if (!obj.success) {
+ return handle_error(); // getURL failed to get data
+ }
+
+ var t = obj.content.split("|");
+ var ugmt = parseFloat(t[0]); // ugmt is an unixtimestamp style
+ var ifin = parseInt(t[1], 10); // number of bytes received by the interface
+ var ifout = parseInt(t[2], 10); // number of bytes sent by the interface
+ var scale;
+
+ if (!isNumber(ifin) || !isNumber(ifout)) {
+ return handle_error();
+ }
+
+ var diff_ugmt = ugmt - last_ugmt;
+ var diff_ifin = ifin - last_ifin;
+ var diff_ifout = ifout - last_ifout;
+
+ if (diff_ugmt == 0) {
+ diff_ugmt = 1; /* avoid division by zero */
+ }
+
+ last_ugmt = ugmt;
+ last_ifin = ifin;
+ last_ifout = ifout;
+ var graphTimerId = 0;
+ switch (plot_in.length) {
+ case 0:
+ SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
+ plot_in[0] = diff_ifin / diff_ugmt;
+ plot_out[0] = diff_ifout / diff_ugmt;
+ setTimeout('fetch_data()', <?=1000*($time_interval + $init_delay)?>);
+ return;
+ case 1:
+ SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
+ break;
+ case max_num_points:
+ // shift plot to left if the maximum number of plot points has been reached
+ var i = 0;
+ while (i < max_num_points) {
+ plot_in[i] = plot_in[i+1];
+ plot_out[i] = plot_out[++i];
+ }
+ plot_in.length--;
+ plot_out.length--;
+ }
+
+ plot_in[plot_in.length] = diff_ifin / diff_ugmt;
+ plot_out[plot_out.length]= diff_ifout / diff_ugmt;
+ var index_plot = plot_in.length - 1;
+
+ SVGDoc.getElementById('graph_in_txt').firstChild.data = formatSpeed(plot_in[index_plot], unit);
+ SVGDoc.getElementById('graph_out_txt').firstChild.data = formatSpeed(plot_out[index_plot], unit);
+
+ /* determine peak for sensible scaling */
+ if (scale_type == 'up') {
+ if (plot_in[index_plot] > max) {
+ max = plot_in[index_plot];
+ }
+ if (plot_out[index_plot] > max) {
+ max = plot_out[index_plot];
+ }
+ } else if (scale_type == 'follow') {
+ i = 0;
+ max = 0;
+ while (i < plot_in.length) {
+ if (plot_in[i] > max) {
+ max = plot_in[i];
+ }
+ if (plot_out[i] > max) {
+ max = plot_out[i];
+ }
+ i++;
+ }
+ }
+
+ var rmax; // max, rounded up
+
+ if (unit == 'bits') {
+ /* round up max, such that
+ 100 kbps -> 200 kbps -> 400 kbps -> 800 kbps -> 1 Mbps -> 2 Mbps -> ... */
+ rmax = 12500;
+ i = 0;
+ while (max > rmax) {
+ i++;
+ if (i && (i % 4 == 0)) {
+ rmax *= 1.25;
+ } else {
+ rmax *= 2;
+ }
+ }
+ } else {
+ /* round up max, such that
+ 10 KB/s -> 20 KB/s -> 40 KB/s -> 80 KB/s -> 100 KB/s -> 200 KB/s -> 400 KB/s -> 800 KB/s -> 1 MB/s ... */
+ rmax = 10240;
+ i = 0;
+ while (max > rmax) {
+ i++;
+ if (i && (i % 4 == 0)) {
+ rmax *= 1.25;
+ } else {
+ rmax *= 2;
+ }
+
+ if (i == 8) {
+ rmax *= 1.024;
+ }
}
- plot_in.length--;
- plot_out.length--;
- }
-
- plot_in[plot_in.length] = diff_ifin / diff_ugmt;
- plot_out[plot_out.length]= diff_ifout / diff_ugmt;
- var index_plot = plot_in.length - 1;
-
- SVGDoc.getElementById('graph_in_txt').firstChild.data = formatSpeed(plot_in[index_plot], unit);
- SVGDoc.getElementById('graph_out_txt').firstChild.data = formatSpeed(plot_out[index_plot], unit);
-
- /* determine peak for sensible scaling */
- if (scale_type == 'up') {
- if (plot_in[index_plot] > max)
- max = plot_in[index_plot];
- if (plot_out[index_plot] > max)
- max = plot_out[index_plot];
- } else if (scale_type == 'follow') {
- i = 0;
- max = 0;
- while (i < plot_in.length) {
- if (plot_in[i] > max)
- max = plot_in[i];
- if (plot_out[i] > max)
- max = plot_out[i];
- i++;
- }
- }
-
- var rmax; // max, rounded up
-
- if (unit == 'bits') {
- /* round up max, such that
- 100 kbps -> 200 kbps -> 400 kbps -> 800 kbps -> 1 Mbps -> 2 Mbps -> ... */
- rmax = 12500;
- i = 0;
- while (max > rmax) {
- i++;
- if (i && (i % 4 == 0))
- rmax *= 1.25;
- else
- rmax *= 2;
- }
- } else {
- /* round up max, such that
- 10 KB/s -> 20 KB/s -> 40 KB/s -> 80 KB/s -> 100 KB/s -> 200 KB/s -> 400 KB/s -> 800 KB/s -> 1 MB/s ... */
- rmax = 10240;
- i = 0;
- while (max > rmax) {
- i++;
- if (i && (i % 4 == 0))
- rmax *= 1.25;
- else
- rmax *= 2;
-
- if (i == 8)
- rmax *= 1.024;
- }
- }
-
- scale = <?=$height?> / rmax;
-
- /* change labels accordingly */
- SVGDoc.getElementById('grid_txt1').firstChild.data = formatSpeed(3*rmax/4,unit);
- SVGDoc.getElementById('grid_txt2').firstChild.data = formatSpeed(2*rmax/4,unit);
- SVGDoc.getElementById('grid_txt3').firstChild.data = formatSpeed(rmax/4,unit);
-
- var path_in = "M 0 " + (<?=$height?> - (plot_in[0] * scale));
- var path_out = "M 0 " + (<?=$height?> - (plot_out[0] * scale));
- for (i = 1; i < plot_in.length; i++)
- {
- var x = step * i;
- var y_in = <?=$height?> - (plot_in[i] * scale);
- var y_out = <?=$height?> - (plot_out[i] * scale);
- path_in += " L" + x + " " + y_in;
- path_out += " L" + x + " " + y_out;
- }
-
- SVGDoc.getElementById('error').setAttributeNS(null, 'visibility', 'hidden');
- SVGDoc.getElementById('graph_in').setAttributeNS(null, 'd', path_in);
- SVGDoc.getElementById('graph_out').setAttributeNS(null, 'd', path_out);
-
- setTimeout('fetch_data()',<?=1000*$time_interval?>);
+ }
+
+ scale = <?=$height?> / rmax;
+
+ /* change labels accordingly */
+ SVGDoc.getElementById('grid_txt1').firstChild.data = formatSpeed(3*rmax/4, unit);
+ SVGDoc.getElementById('grid_txt2').firstChild.data = formatSpeed(2*rmax/4, unit);
+ SVGDoc.getElementById('grid_txt3').firstChild.data = formatSpeed(rmax/4, unit);
+
+ var path_in = "M 0 " + (<?=$height?> - (plot_in[0] * scale));
+ var path_out = "M 0 " + (<?=$height?> - (plot_out[0] * scale));
+ for (i = 1; i < plot_in.length; i++) {
+ var x = step * i;
+ var y_in = <?=$height?> - (plot_in[i] * scale);
+ var y_out = <?=$height?> - (plot_out[i] * scale);
+ path_in += " L" + x + " " + y_in;
+ path_out += " L" + x + " " + y_out;
+ }
+
+ SVGDoc.getElementById('error').setAttributeNS(null, 'visibility', 'hidden');
+ SVGDoc.getElementById('graph_in').setAttributeNS(null, 'd', path_in);
+ SVGDoc.getElementById('graph_out').setAttributeNS(null, 'd', path_out);
+
+ setTimeout('fetch_data()', <?=1000*$time_interval?>);
}
function handle_error() {
- SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'visible');
- setTimeout('fetch_data()',<?=1000*$time_interval?>);
+ SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'visible');
+ setTimeout('fetch_data()', <?=1000*$time_interval?>);
}
function isNumber(a) {
- return typeof a == 'number' && isFinite(a);
+ return typeof a == 'number' && isFinite(a);
}
function formatSpeed(speed, unit) {
- if (unit == 'bits')
- return formatSpeedBits(speed);
- if (unit == 'bytes')
- return formatSpeedBytes(speed);
+ if (unit == 'bits') {
+ return formatSpeedBits(speed);
+ }
+ if (unit == 'bytes') {
+ return formatSpeedBytes(speed);
+ }
}
function formatSpeedBits(speed) {
- // format speed in bits/sec, input: bytes/sec
- if (speed < 125000)
- return Math.round(speed / 125) + " <?=gettext("Kbps"); ?>";
- if (speed < 125000000)
- return Math.round(speed / 1250)/100 + " <?=gettext("Mbps"); ?>";
- // else
- return Math.round(speed / 1250000)/100 + " <?=gettext("Gbps"); ?>"; /* wow! */
+ // format speed in bits/sec, input: bytes/sec
+ if (speed < 125000) {
+ return Math.round(speed / 125) + " <?=gettext("Kbps"); ?>";
+ }
+ if (speed < 125000000) {
+ return Math.round(speed / 1250)/100 + " <?=gettext("Mbps"); ?>";
+ }
+ // else
+ return Math.round(speed / 1250000)/100 + " <?=gettext("Gbps"); ?>"; /* wow! */
}
function formatSpeedBytes(speed) {
- // format speed in bytes/sec, input: bytes/sec
- if (speed < 1048576)
- return Math.round(speed / 10.24)/100 + " <?=gettext("KB/s"); ?>";
- if (speed < 1073741824)
- return Math.round(speed / 10485.76)/100 + " <?=gettext("MB/s"); ?>";
- // else
- return Math.round(speed / 10737418.24)/100 + " <?=gettext("GB/s"); ?>"; /* wow! */
+ // format speed in bytes/sec, input: bytes/sec
+ if (speed < 1048576) {
+ return Math.round(speed / 10.24)/100 + " <?=gettext("KB/s"); ?>";
+ }
+ if (speed < 1073741824) {
+ return Math.round(speed / 10485.76)/100 + " <?=gettext("MB/s"); ?>";
+ }
+ // else
+ return Math.round(speed / 10737418.24)/100 + " <?=gettext("GB/s"); ?>"; /* wow! */
}
function LZ(x) {
- return (x < 0 || x > 9 ? "" : "0") + x;
+ return (x < 0 || x > 9 ? "" : "0") + x;
}
]]>
- </script>
+ </script>
</svg>
diff --git a/usr/local/www/graph_cpu.php b/usr/local/www/graph_cpu.php
index b92c953..80d97f1 100644
--- a/usr/local/www/graph_cpu.php
+++ b/usr/local/www/graph_cpu.php
@@ -42,9 +42,9 @@
require_once("guiconfig.inc");
-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
header("Content-type: image/svg+xml");
@@ -69,64 +69,68 @@ $width=200; // SVG internal width : do not modify
/********* Graph DATA **************/
print('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?>
<svg width="100%" height="100%" viewBox="0 0 <?=$width?> <?=$height?>" preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt);">
- <g id="graph">
- <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/>
- <line id="axis_x" x1="0" y1="0" x2="0" y2="100%" <?=$attribs['axis']?>/>
- <line id="axis_y" x1="0" y1="100%" x2="100%" y2="100%" <?=$attribs['axis']?>/>
- <polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
- <path id="graph_cpu" d="" <?=$attribs['graph_cpu']?>/>
- <path id="grid" d="M0 <?=$height/4*1?> L <?=$width?> <?=$height/4*1?> M0 <?=$height/4*2?> L <?=$width?> <?=$height/4*2?> M0 <?=$height/4*3?> L <?=$width?> <?=$height/4*3?>" <?=$attribs['grid']?>/>
- <text id="grid_txt1" x="100%" y="25%" <?=$attribs['grid_txt']?> text-anchor="end">75%</text>
- <text id="grid_txt2" x="100%" y="50%" <?=$attribs['grid_txt']?> text-anchor="end">50%</text>
- <text id="grid_txt3" x="100%" y="75%" <?=$attribs['grid_txt']?> text-anchor="end">25%</text>
- <text id="graph_cpu_txt" x="4" y="8" <?=$attribs['cpu']?>> </text>
- <text id="error" x="50%" y="50%" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=gettext("Cannot get CPU load"); ?></text>
- <text id="collect_initial" x="50%" y="50%" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text>
- </g>
- <script type="text/ecmascript">
- <![CDATA[
+ <g id="graph">
+ <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/>
+ <line id="axis_x" x1="0" y1="0" x2="0" y2="100%" <?=$attribs['axis']?>/>
+ <line id="axis_y" x1="0" y1="100%" x2="100%" y2="100%" <?=$attribs['axis']?>/>
+ <polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
+ <path id="graph_cpu" d="" <?=$attribs['graph_cpu']?>/>
+ <path id="grid" d="M0 <?=$height/4*1?> L <?=$width?> <?=$height/4*1?> M0 <?=$height/4*2?> L <?=$width?> <?=$height/4*2?> M0 <?=$height/4*3?> L <?=$width?> <?=$height/4*3?>" <?=$attribs['grid']?>/>
+ <text id="grid_txt1" x="100%" y="25%" <?=$attribs['grid_txt']?> text-anchor="end">75%</text>
+ <text id="grid_txt2" x="100%" y="50%" <?=$attribs['grid_txt']?> text-anchor="end">50%</text>
+ <text id="grid_txt3" x="100%" y="75%" <?=$attribs['grid_txt']?> text-anchor="end">25%</text>
+ <text id="graph_cpu_txt" x="4" y="8" <?=$attribs['cpu']?>> </text>
+ <text id="error" x="50%" y="50%" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=gettext("Cannot get CPU load"); ?></text>
+ <text id="collect_initial" x="50%" y="50%" visibility="hidden" <?=$attribs['collect_initial']?> text-anchor="middle"><?=gettext("Collecting initial data, please wait"); ?>...</text>
+ </g>
+ <script type="text/ecmascript">
+ <![CDATA[
/**
* getURL is a proprietary Adobe function, but it's simplicity has made it very
* popular. If getURL is undefined we spin our own by wrapping XMLHttpRequest.
*/
if (typeof getURL == 'undefined') {
- getURL = function(url, callback) {
- if (!url)
- throw '<?=gettext("No URL for getURL"); ?>';
-
- try {
- if (typeof callback.operationComplete == 'function')
- callback = callback.operationComplete;
- } catch (e) {}
- if (typeof callback != 'function')
- throw '<?=gettext("No callback function for getURL"); ?>';
-
- var http_request = null;
- if (typeof XMLHttpRequest != 'undefined') {
- http_request = new XMLHttpRequest();
- } else if (typeof ActiveXObject != 'undefined') {
- try {
- http_request = new ActiveXObject('Msxml2.XMLHTTP');
- } catch (e) {
- try {
- http_request = new ActiveXObject('Microsoft.XMLHTTP');
- } catch (e) {}
- }
- }
- if (!http_request)
- throw '<?=gettext("Both getURL and XMLHttpRequest are undefined"); ?>';
-
- http_request.onreadystatechange = function() {
- if (http_request.readyState == 4) {
- callback( { success : true,
- content : http_request.responseText,
- contentType : http_request.getResponseHeader("Content-Type") } );
- }
- }
- http_request.open('GET', url, true);
- http_request.send(null);
- }
+ getURL = function(url, callback) {
+ if (!url) {
+ throw '<?=gettext("No URL for getURL"); ?>';
+ }
+
+ try {
+ if (typeof callback.operationComplete == 'function') {
+ callback = callback.operationComplete;
+ }
+ } catch (e) {}
+ if (typeof callback != 'function') {
+ throw '<?=gettext("No callback function for getURL"); ?>';
+ }
+
+ var http_request = null;
+ if (typeof XMLHttpRequest != 'undefined') {
+ http_request = new XMLHttpRequest();
+ } else if (typeof ActiveXObject != 'undefined') {
+ try {
+ http_request = new ActiveXObject('Msxml2.XMLHTTP');
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject('Microsoft.XMLHTTP');
+ } catch (e) {}
+ }
+ }
+ if (!http_request) {
+ throw '<?=gettext("Both getURL and XMLHttpRequest are undefined"); ?>';
+ }
+
+ http_request.onreadystatechange = function() {
+ if (http_request.readyState == 4) {
+ callback( { success : true,
+ content : http_request.responseText,
+ contentType : http_request.getResponseHeader("Content-Type") } );
+ }
+ }
+ http_request.open('GET', url, true);
+ http_request.send(null);
+ }
}
var SVGDoc = null;
@@ -141,65 +145,67 @@ var step = <?=$width?> / max_num_points; // plot X division size
var scale = <?=$height?> / 100;
function init(evt) {
- SVGDoc = evt.target.ownerDocument;
- fetch_data();
+ SVGDoc = evt.target.ownerDocument;
+ fetch_data();
}
function fetch_data() {
- getURL('<?=$fetch_link?>', plot_cpu_data);
+ getURL('<?=$fetch_link?>', plot_cpu_data);
}
function plot_cpu_data(obj) {
- if (!obj.success)
- return handle_error(); // getURL failed to get current CPU load data
-
- var cpu = parseInt(obj.content);
- if (!isNumber(cpu))
- return handle_error();
-
- switch (cpu_data.length) {
- case 0:
- SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
- cpu_data[0] = cpu;
- fetch_data();
- return;
- case 1:
- SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
- break;
- case max_num_points:
- // shift plot to left if the maximum number of plot points has been reached
- var i = 0;
- while (i < max_num_points) {
- cpu_data[i] = cpu_data[++i];
- }
- --cpu_data.length;
- }
-
- cpu_data[cpu_data.length] = cpu;
-
- var path_data = "M 0 " + (<?=$height?> - (cpu_data[0] * scale));
- for (var i = 1; i < cpu_data.length; ++i) {
- var x = step * i;
- var y_cpu = <?=$height?> - (cpu_data[i] * scale);
- path_data += " L" + x + " " + y_cpu;
- }
-
- SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'hidden');
- SVGDoc.getElementById('graph_cpu_txt').firstChild.data = cpu + '%';
- SVGDoc.getElementById('graph_cpu').setAttributeNS(null, "d", path_data);
-
- fetch_data();
+ if (!obj.success) {
+ return handle_error(); // getURL failed to get current CPU load data
+ }
+
+ var cpu = parseInt(obj.content);
+ if (!isNumber(cpu)) {
+ return handle_error();
+ }
+
+ switch (cpu_data.length) {
+ case 0:
+ SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
+ cpu_data[0] = cpu;
+ fetch_data();
+ return;
+ case 1:
+ SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
+ break;
+ case max_num_points:
+ // shift plot to left if the maximum number of plot points has been reached
+ var i = 0;
+ while (i < max_num_points) {
+ cpu_data[i] = cpu_data[++i];
+ }
+ --cpu_data.length;
+ }
+
+ cpu_data[cpu_data.length] = cpu;
+
+ var path_data = "M 0 " + (<?=$height?> - (cpu_data[0] * scale));
+ for (var i = 1; i < cpu_data.length; ++i) {
+ var x = step * i;
+ var y_cpu = <?=$height?> - (cpu_data[i] * scale);
+ path_data += " L" + x + " " + y_cpu;
+ }
+
+ SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'hidden');
+ SVGDoc.getElementById('graph_cpu_txt').firstChild.data = cpu + '%';
+ SVGDoc.getElementById('graph_cpu').setAttributeNS(null, "d", path_data);
+
+ fetch_data();
}
function handle_error() {
- SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'visible');
- fetch_data();
+ SVGDoc.getElementById("error").setAttributeNS(null, 'visibility', 'visible');
+ fetch_data();
}
function isNumber(a) {
- return typeof a == 'number' && isFinite(a);
+ return typeof a == 'number' && isFinite(a);
}
- ]]>
- </script>
+ ]]>
+ </script>
</svg>
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 8ad9e92..a2e17bd 100644
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -37,7 +37,7 @@
if (!$nocsrf) {
function csrf_startup() {
csrf_conf('rewrite-js', '/csrf/csrf-magic.js');
- $timeout_minutes = isset($config['system']['webgui']['session_timeout']) ? $config['system']['webgui']['session_timeout'] : 240;
+ $timeout_minutes = isset($config['system']['webgui']['session_timeout']) ? $config['system']['webgui']['session_timeout'] : 240;
csrf_conf('expires', $timeout_minutes * 60);
}
require_once("csrf/csrf-magic.php");
@@ -152,22 +152,22 @@ $ldap_protvers = array(
$ldap_templates = array(
'open' => array(
- 'desc' => "OpenLDAP",
- 'attr_user' => "cn",
- 'attr_group' => "cn",
- 'attr_member' => "member"),
+ 'desc' => "OpenLDAP",
+ 'attr_user' => "cn",
+ 'attr_group' => "cn",
+ 'attr_member' => "member"),
'msad' => array(
- 'desc' => "Microsoft AD",
- 'attr_user' => "samAccountName",
- 'attr_group' => "cn",
- 'attr_member' => "memberOf"),
+ 'desc' => "Microsoft AD",
+ 'attr_user' => "samAccountName",
+ 'attr_group' => "cn",
+ 'attr_member' => "memberOf"),
'edir' => array(
- 'desc' => "Novell eDirectory",
- 'attr_user' => "cn",
- 'attr_group' => "cn",
- 'attr_member' => "uniqueMember"));
+ 'desc' => "Novell eDirectory",
+ 'attr_user' => "cn",
+ 'attr_group' => "cn",
+ 'attr_member' => "uniqueMember"));
$radius_srvcs = array(
'both' => "Authentication and Accounting",
@@ -307,7 +307,7 @@ function verify_gzip_file($fname) {
}
}
-function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
+function print_info_box_np($msg, $name = "apply", $value = "", $showapply = false) {
global $g, $nifty_redbox, $nifty_blackbox, $nifty_background;
if (empty($value)) {
@@ -325,7 +325,7 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
if ($_POST['if']) {
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
}
- $savebutton.="</td>";
+ $savebutton .= "</td>";
}
$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 "<tr valign=\"top\">\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 "<td class=\"listlr nowrap\">{$entry_date_time}</td>\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 "<div id=\"tabs\">";
$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 .= "['<b>$name</b>'] {<div style=\"margin-left:10px;\">\n";
- $return .= echo_array($value,true);
+ $return .= echo_array($value, true);
$return .= "</div>}";
$return .= "\n\n";
} else {
@@ -1073,7 +1073,7 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
echo gettext("Currently viewing: ");
echo "<select name=\"TabSelect\" onchange=\"tabs_will_go(this)\">\n";
foreach ($tab_array as $ta) {
- if ($ta[1]=="true") {
+ if ($ta[1] == "true") {
$selected = " selected=\"selected\"";
} else {
$selected = "";
@@ -1120,7 +1120,7 @@ function add_package_tabs($pkgname, &$tab_array) {
return;
}
- foreach($pkg_config['tabs']['tab'] as $tab) {
+ foreach ($pkg_config['tabs']['tab'] as $tab) {
$tab_entry = array();
if ($tab['name']) {
$tab_entry[] = $tab['name'];
@@ -1136,13 +1136,13 @@ function alias_info_popup($alias_id) {
$maxlength = 60;
$close_title="title='".gettext('move mouse out of this alias to hide')."'";
if (is_array($config['aliases']['alias'][$alias_id])) {
- $alias_name=$config['aliases']['alias'][$alias_id];
+ $alias_name = $config['aliases']['alias'][$alias_id];
$alias_objects_with_details = "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" summary=\"alias info popup\">";
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 .= "<tr><td colspan=\"3\" $close_title class=\"vncell\">{$alias_name['url']}</td></tr>";
- $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 .= "<td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td>";
break;
default:
- $x=0;
- $alias_objects_with_details .= "<td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td><tr>";
+ $x = 0;
+ $alias_objects_with_details .= "<td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td><tr>";
break;
}
}
@@ -1182,7 +1182,7 @@ function alias_info_popup($alias_id) {
$counter = 0;
foreach ($alias_addresses as $alias_ports_address) {
$alias_objects_with_details .= "<tr><td $close_title width=\"5%\" class=\"vncell\" style=\"background: #FFFFFF;color: #000000;\">{$alias_addresses[$counter]}</td>";
- $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 .="<td $close_title width=\"95%\" class=\"vncell\" style=\"background: #FFFFFF;color: #000000;\">{$alias_details[$counter]}</td>";
} else {
@@ -1204,8 +1204,8 @@ function alias_info_popup($alias_id) {
print "<h1>{$alias_caption}</h1>" . $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');
<?php if ($_POST['Submit'] == " " . gettext("Yes") . " "):
print_info_box(gettext("The system is halting now. This may take one minute.")); ?>
<pre>
-<?php system_halt(); ?>
+<?php system_halt(); ?>
</pre>
<?php else: ?>
<form action="halt.php" method="post">
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 "<center>\n";
echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\" alt=\"logo\" /><p>\n";
echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n";
- echo sprintf(gettext("Welcome to %s!\n"),$g['product_name']) . "<p>";
+ echo sprintf(gettext("Welcome to %s!\n"), $g['product_name']) . "<p>";
echo gettext("One moment while we start the initial setup wizard.") . "<p>\n";
echo gettext("Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.") . "<p>\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 "</div>\n";
echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n";
echo "<script type=\"text/javascript\">\n";
@@ -239,7 +239,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
$colpos = array();
$savedwidgetfiles = array();
$widgetname = "";
- $widgetlist = explode(",",$widgetlist);
+ $widgetlist = explode(",", $widgetlist);
##read the widget position and display information
foreach ($widgetlist as $widget) {
@@ -247,8 +247,8 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
$widgetname = substr($widget, 0, $dashpos);
$colposition = strpos($widget, ":");
$displayposition = strrpos($widget, ":");
- $colpos[] = substr($widget,$colposition+1, $displayposition - $colposition-1);
- $displayarray[] = substr($widget,$displayposition+1);
+ $colpos[] = substr($widget, $colposition + 1, $displayposition - $colposition - 1);
+ $displayarray[] = substr($widget, $displayposition + 1);
$savedwidgetfiles[] = $widgetname . ".widget.php";
}
@@ -275,7 +275,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
##build list of php include files
$phpincludefiles = array();
$directory = "/usr/local/www/widgets/include/";
-$dirhandle = opendir($directory);
+$dirhandle = opendir($directory);
$filename = "";
while (false !== ($filename = readdir($dirhandle))) {
$phpincludefiles[] = $filename;
@@ -345,7 +345,7 @@ function configureWidget(selectedDiv) {
}
}
-function showWidget(selectedDiv,swapButtons) {
+function showWidget(selectedDiv, swapButtons) {
//appear element
jQuery('#' + selectedDiv).show('blind');
showSave();
@@ -367,7 +367,7 @@ function showWidget(selectedDiv,swapButtons) {
}
-function minimizeWidget(selectedDiv,swapButtons) {
+function minimizeWidget(selectedDiv, swapButtons) {
//fade element
jQuery('#' + selectedDiv).hide('blind');
showSave();
@@ -407,7 +407,7 @@ function updatePref() {
var widgetSequence = "";
var firstprint = false;
d = document;
- for (i=0; i<widgets.length; i++) {
+ for (i = 0; i < widgets.length; i++) {
if (firstprint) {
widgetSequence += ",";
}
@@ -425,31 +425,31 @@ function updatePref() {
}
function hideAllWidgets() {
- jQuery('#niftyOutter').fadeTo('slow',0.2);
+ jQuery('#niftyOutter').fadeTo('slow', 0.2);
}
function showAllWidgets() {
- jQuery('#niftyOutter').fadeTo('slow',1.0);
+ jQuery('#niftyOutter').fadeTo('slow', 1.0);
}
function changeTabDIV(selectedDiv) {
var dashpos = selectedDiv.indexOf("-");
- var tabclass = selectedDiv.substring(0,dashpos);
+ var tabclass = selectedDiv.substring(0, dashpos);
d = document;
//get deactive tabs first
tabclass = tabclass + "-class-tabdeactive";
var tabs = document.getElementsByClassName(tabclass);
var incTabSelected = selectedDiv + "-deactive";
- for (i=0; i<tabs.length; i++) {
+ for (i = 0; i < tabs.length; i++) {
var tab = tabs[i].id;
dashpos = tab.lastIndexOf("-");
- var tab2 = tab.substring(0,dashpos) + "-deactive";
+ var tab2 = tab.substring(0, dashpos) + "-deactive";
if (tab2 == incTabSelected) {
tablink = d.getElementById(tab2);
tablink.style.display = "none";
- tab2 = tab.substring(0,dashpos) + "-active";
+ tab2 = tab.substring(0, dashpos) + "-active";
tablink = d.getElementById(tab2);
tablink.style.display = "table-cell";
@@ -459,15 +459,15 @@ function changeTabDIV(selectedDiv) {
}
else
{
- tab2 = tab.substring(0,dashpos) + "-deactive";
+ tab2 = tab.substring(0, dashpos) + "-deactive";
tablink = d.getElementById(tab2);
tablink.style.display = "table-cell";
- tab2 = tab.substring(0,dashpos) + "-active";
+ tab2 = tab.substring(0, dashpos) + "-active";
tablink = d.getElementById(tab2);
tablink.style.display = "none";
//hide sections we don't want to see
- tab2 = tab.substring(0,dashpos);
+ tab2 = tab.substring(0, dashpos);
tabmain = d.getElementById(tab2);
tabmain.style.display = "none";
@@ -489,7 +489,7 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
-columns = ['col1','col2','col3','col4', 'col5','col6','col7','col8','col9','col10'];
+columns = ['col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7', 'col8', 'col9', 'col10'];
//]]>
</script>
@@ -570,7 +570,7 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard");
<input type="hidden" value="" name="sequence" id="sequence" />
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="<?=gettext("Click here to add widgets"); ?>" style="cursor: pointer;" onmouseup="domTT_activate(this, event, 'content', document.getElementById('content1'), 'type', 'velcro', 'delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" />
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" alt="<?=gettext("Click here for help"); ?>" 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');" />
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" alt="<?=gettext("Click here for help"); ?>" 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');" />
&nbsp;&nbsp;&nbsp;
<input id="submit" name="submit" type="submit" style="display:none" onclick="return updatePref();" class="formbtn" value="<?=gettext("Save Settings");?>" />
@@ -731,9 +731,9 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard");
</div>
<div align="right" style="float:right;">
<div id="<?php echo $widgetname;?>-configure" onclick='return configureWidget("<?php echo $widgetname;?>")' style="display:none; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_configure.gif" alt="configure" /></div>
- <div id="<?php echo $widgetname;?>-open" onclick='return showWidget("<?php echo $widgetname;?>",true)' style="display:<?php echo $showWidget;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_open.gif" alt="open" /></div>
- <div id="<?php echo $widgetname;?>-min" onclick='return minimizeWidget("<?php echo $widgetname;?>",true)' style="display:<?php echo $mindiv;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_minus.gif" alt="minimize" /></div>
- <div id="<?php echo $widgetname;?>-close" onclick='return closeWidget("<?php echo $widgetname;?>",true)' style="display:inline; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" alt="close" /></div>
+ <div id="<?php echo $widgetname;?>-open" onclick='return showWidget("<?php echo $widgetname;?>", true)' style="display:<?php echo $showWidget;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_open.gif" alt="open" /></div>
+ <div id="<?php echo $widgetname;?>-min" onclick='return minimizeWidget("<?php echo $widgetname;?>", true)' style="display:<?php echo $mindiv;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_minus.gif" alt="minimize" /></div>
+ <div id="<?php echo $widgetname;?>-close" onclick='return closeWidget("<?php echo $widgetname;?>", true)' style="display:inline; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" alt="close" /></div>
</div>
<div style="clear:both;"></div>
</div>
@@ -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});
- <?php if (!$config['widgets'] && $pconfig['sequence'] != "") { ?>
+ <?php if (!$config['widgets'] && $pconfig['sequence'] != "") { ?>
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');
<?php } ?>
});
//]]>
@@ -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"),
<form action="interfaces.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (is_subsystem_dirty('interfaces')): ?><p>
- <?php print_info_box_np(sprintf(gettext("The %s configuration has been changed."),$wancfg['descr'])."</p><p>".gettext("You must apply the changes in order for them to take effect.")."</p><p>".gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?></p><br />
+ <?php print_info_box_np(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "</p><p>" . gettext("You must apply the changes in order for them to take effect.") . "</p><p>" . gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?></p><br />
<?php endif; ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces">
@@ -2039,7 +2040,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<?php
if (count($a_gateways) > 0) {
foreach ($a_gateways as $gateway) {
- if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) {
+ if (($gateway['interface'] == $if) && (is_ipaddrv4($gateway['gateway']))) {
?>
<option value="<?=$gateway['name'];?>" <?php if ($gateway['name'] == $pconfig['gateway']) echo "selected=\"selected\""; ?>>
<?=htmlspecialchars($gateway['name']) . " - " . htmlspecialchars($gateway['gateway']);?>
@@ -2081,7 +2082,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
}
?>
<tr>
- <td width="45%" align="right"><font color="white"><?=gettext("Default gateway:"); ?></font></td><td><input type="checkbox" id="defaultgw" name="defaultgw"<?=$checked?> /></td>
+ <td width="45%" align="right"><font color="white"><?=gettext("Default gateway:"); ?></font></td><td><input type="checkbox" id="defaultgw" name="defaultgw"<?=$checked?> /></td>
</tr>
<tr>
<td align="right"><font color="white"><?=gettext("Gateway Name:"); ?></font></td><td><input id="name" name="name" value="<?=$wancfg['descr'] . "GW"?>" /></td>
@@ -2307,7 +2308,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
&nbsp; &nbsp; &nbsp; &nbsp;
Presets: &nbsp;
<input name="adv_dhcp_pt_values" type="radio" value="DHCP" id="customdhcpptdhcpdefaults" onclick="customdhcpptsetvalues(this, iform);" />FreeBSD Default &nbsp;
- <input name="adv_dhcp_pt_values" type="radio" value="Clear" id="customdhcpptclear" onclick="customdhcpptsetvalues(this, iform);" />Clear
+ <input name="adv_dhcp_pt_values" type="radio" value="Clear" id="customdhcpptclear" onclick="customdhcpptsetvalues(this, iform);" />Clear
<br />
Reboot: <input name="adv_dhcp_pt_reboot" type="text" class="formfld unknown" id="adv_dhcp_pt_reboot" size="2" value="<?=htmlspecialchars($pconfig['adv_dhcp_pt_reboot']);?>" onchange="customdhcpptcheckradiobuton(document.iform.adv_dhcp_pt_values, '');" />
@@ -2315,8 +2316,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
Initial Interval: <input name="adv_dhcp_pt_initial_interval" type="text" class="formfld unknown" id="adv_dhcp_pt_initial_interval" size="2" value="<?=htmlspecialchars($pconfig['adv_dhcp_pt_initial_interval']);?>" onchange="customdhcpptcheckradiobuton(document.iform.adv_dhcp_pt_values, '');" />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
- <input name="adv_dhcp_pt_values" type="radio" value="pfSense" id="customdhcpptpfsensedefaults" onclick="customdhcpptsetvalues(this, iform);" />pfSense Default &nbsp;
- <input name="adv_dhcp_pt_values" type="radio" value="SavedCfg" checked="checked" id="customdhcpptsavedcfg" onclick="customdhcpptsetvalues(this, iform);" />Saved Cfg
+ <input name="adv_dhcp_pt_values" type="radio" value="pfSense" id="customdhcpptpfsensedefaults" onclick="customdhcpptsetvalues(this, iform);" />pfSense Default &nbsp;
+ <input name="adv_dhcp_pt_values" type="radio" value="SavedCfg" checked="checked" id="customdhcpptsavedcfg" onclick="customdhcpptsetvalues(this, iform);" />Saved Cfg
<br />
<?=gettext("The values in these fields are DHCP protocol timings used when requesting a lease. <br /> "); ?>
@@ -2396,7 +2397,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr style='display:none' id="show_adv_dhcp_config_file_override">
<td width="22%" valign="top" class="vncell"><?=gettext("<a target=\"FreeBSD_DHCP\" href=\"http://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&amp;sektion=5\">Configuration File</a> Override"); ?></td>
<td width="78%" class="vtable">
- <input name="adv_dhcp_config_file_override_path" type="text" class="formfld unknown" id="adv_dhcp_config_file_override_path" size="86" value="<?=htmlspecialchars($pconfig['adv_dhcp_config_file_override_path']);?>" />
+ <input name="adv_dhcp_config_file_override_path" type="text" class="formfld unknown" id="adv_dhcp_config_file_override_path" size="86" value="<?=htmlspecialchars($pconfig['adv_dhcp_config_file_override_path']);?>" />
<br />
<?=gettext("The value in this field is the full absolute path to a DHCP client configuration file. [/[dirname/[.../]]filename[.ext]] <br /> " .
"Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} <br />" .
@@ -2481,7 +2482,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<?php if (is_readable("/var/db/dhcp6c_duid")) {
// $current_duid = file_get_contents("/var/db/dhcp6c_duid");
}
- printf(gettext("The current DUID is: '%s'"),$current_duid);
+ printf(gettext("The current DUID is: '%s'"), $current_duid);
// hexdump -e '"%07.7_ax " 1/2 "%04x" " " 14/1 "%02x:" "\n"'
?>
</td>
@@ -2568,7 +2569,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<input name="adv_dhcp6_id_assoc_statement_address_enable" type="checkbox" id="adv_dhcp6_id_assoc_statement_address_enable" value="" onclick="show_adv_dhcp6_config(this);" />
<?=gettext("Non-Temporary Address Allocation"); ?>
- <div style='display:none' id="show_adv_dhcp6_id_assoc_statement_address">
+ <div style='display:none' id="show_adv_dhcp6_id_assoc_statement_address">
<?=gettext("id-assoc na"); ?>
<?=gettext("<i>ID</i>"); ?>
<input name="adv_dhcp6_id_assoc_statement_address_id" type="text" class="formfld unknown" id="adv_dhcp6_id_assoc_statement_address_id" size="3" value="<?=htmlspecialchars($pconfig['adv_dhcp6_id_assoc_statement_address_id']);?>" />
@@ -2585,7 +2586,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<input name="adv_dhcp6_id_assoc_statement_prefix_enable" type="checkbox" id="adv_dhcp6_id_assoc_statement_prefix_enable" value="" onclick="show_adv_dhcp6_config(this)" />
<?=gettext("Prefix Delegation"); ?>
- <div style='display:none' id="show_adv_dhcp6_id_assoc_statement_prefix">
+ <div style='display:none' id="show_adv_dhcp6_id_assoc_statement_prefix">
<?=gettext("id-assoc pd"); ?>
<?=gettext("<i>ID</i>"); ?>
<input name="adv_dhcp6_id_assoc_statement_prefix_id" type="text" class="formfld unknown" id="adv_dhcp6_id_assoc_statement_prefix_id" size="3" value="<?=htmlspecialchars($pconfig['adv_dhcp6_id_assoc_statement_prefix_id']);?>" />
@@ -2654,7 +2655,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<?=gettext("<a target=\"FreeBSD_DHCP\" href=\"http://www.freebsd.org/cgi/man.cgi?query=dhcp6c.conf&amp;sektion=5&amp;apropos=0&amp;manpath=FreeBSD+10.1-RELEASE+and+Ports\">Configuration File</a> Override"); ?>
</td>
<td width="78%" class="vtable">
- <input name="adv_dhcp6_config_file_override_path" type="text" class="formfld unknown" id="adv_dhcp6_config_file_override_path" size="86" value="<?=htmlspecialchars($pconfig['adv_dhcp6_config_file_override_path']);?>" />
+ <input name="adv_dhcp6_config_file_override_path" type="text" class="formfld unknown" id="adv_dhcp6_config_file_override_path" size="86" value="<?=htmlspecialchars($pconfig['adv_dhcp6_config_file_override_path']);?>" />
<br />
<?=gettext("The value in this field is the full absolute path to a DHCP client configuration file. [/[dirname/[.../]]filename[.ext]] <br /> " .
"Value Substitutions in Config File: {interface}, {hostname}, {mac_addr_asciiCD}, {mac_addr_hexCD} <br />" .
@@ -2699,13 +2700,13 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
document.getElementById("show_adv_dhcp6_id_assoc_statement").style.display = advanced;
document.getElementById("show_adv_dhcp6_id_assoc_statement_address").style.display = 'none';
- if (document.iform.adv_dhcp6_id_assoc_statement_address_enable.checked) {
+ if (document.iform.adv_dhcp6_id_assoc_statement_address_enable.checked) {
document.getElementById("show_adv_dhcp6_id_assoc_statement_address").style.display = advanced;
}
document.getElementById("show_adv_dhcp6_id_assoc_statement_prefix").style.display = 'none';
document.getElementById("show_adv_dhcp6_prefix_interface_statement").style.display = 'none';
- if (document.iform.adv_dhcp6_id_assoc_statement_prefix_enable.checked) {
+ if (document.iform.adv_dhcp6_id_assoc_statement_prefix_enable.checked) {
document.getElementById("show_adv_dhcp6_id_assoc_statement_prefix").style.display = advanced;
document.getElementById("show_adv_dhcp6_prefix_interface_statement").style.display = advanced;
}
@@ -3109,7 +3110,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Local IP address"); ?></td>
<td width="78%" class="vtable">
- <input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local'][0]);?>" />
+ <input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local'][0]);?>" />
/
<select name="pptp_subnet" class="formselect" id="pptp_subnet">
<?php for ($i = 31; $i > 0; $i--): ?>
@@ -3170,7 +3171,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr>
<td valign="top" class="vncell"><?=gettext("Persist common settings");?></td>
<td class="vtable">
- <input name="persistcommonwireless" type="checkbox" value="yes" class="formfld" id="persistcommonwireless" <?php if ($pconfig['persistcommonwireless']) echo "checked=\"checked\"";?> />
+ <input name="persistcommonwireless" type="checkbox" value="yes" class="formfld" id="persistcommonwireless" <?php if ($pconfig['persistcommonwireless']) echo "checked=\"checked\"";?> />
<br /><?=gettext("Enabling this preserves the common wireless configuration through interface deletions and reassignments.");?>
</td>
</tr>
@@ -3229,10 +3230,11 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<select name="txpower" class="formselect" id="txpower">
<?
for ($x = 99; $x > 0; $x--) {
- if ($pconfig["txpower"] == $x)
+ if ($pconfig["txpower"] == $x) {
$SELECTED = " selected=\"selected\"";
- else
+ } else {
$SELECTED = "";
+ }
echo "<option {$SELECTED}>{$x}</option>\n";
}
?>
@@ -3424,7 +3426,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr>
<td valign="top" class="vncell"><?=gettext("802.11g only"); ?></td>
<td class="vtable">
- <input name="puremode" type="checkbox" value="11g" class="formfld" id="puremode" <?php if ($pconfig['puremode'] == '11g') echo "checked=\"checked\"";?> />
+ <input name="puremode" type="checkbox" value="11g" class="formfld" id="puremode" <?php if ($pconfig['puremode'] == '11g') echo "checked=\"checked\"";?> />
<br /><?=gettext("When operating as an access point in 802.11g mode, allow only 11g-capable stations to associate (11b-only stations are not permitted to associate)."); ?>
</td>
</tr>
@@ -3432,7 +3434,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr>
<td valign="top" class="vncell"><?=gettext("Allow intra-BSS communication"); ?></td>
<td class="vtable">
- <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <?php if ($pconfig['apbridge_enable']) echo "checked=\"checked\"";?> />
+ <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <?php if ($pconfig['apbridge_enable']) echo "checked=\"checked\"";?> />
<br />
<?=gettext("When operating as an access point, enable this if you want to pass packets between wireless clients directly."); ?>
<br />
@@ -3588,14 +3590,14 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<tr>
<td valign="top" class="vncell"><?=gettext("Strict Key Regeneration"); ?></td>
<td class="vtable">
- <input name="wpa_strict_rekey" type="checkbox" value="yes" class="formfld" id="wpa_strict_rekey" <?php if ($pconfig['wpa_strict_rekey']) echo "checked=\"checked\""; ?> />
+ <input name="wpa_strict_rekey" type="checkbox" value="yes" class="formfld" id="wpa_strict_rekey" <?php if ($pconfig['wpa_strict_rekey']) echo "checked=\"checked\""; ?> />
<br /><?=gettext("Setting this option will force the AP to rekey whenever a client disassociates."); ?>
</td>
</tr>
<tr>
<td valign="top" class="vncell"><?=gettext("Enable IEEE802.1X Authentication"); ?></td>
<td class="vtable">
- <input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <?php if ($pconfig['ieee8021x']) echo "checked=\"checked\"";?> />
+ <input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <?php if ($pconfig['ieee8021x']) echo "checked=\"checked\"";?> />
<br /><?=gettext("Setting this option will enable 802.1X authentication."); ?>
<br /><span class="red"><strong><?=gettext("NOTE"); ?>:</strong></span> <?=gettext("this option requires checking the \"Enable WPA box\"."); ?>
</td>
@@ -3663,7 +3665,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv']) echo "checked=\"checked\""; ?> />
<strong><?=gettext("Block private networks"); ?></strong><br />
<?=gettext("When set, this option blocks traffic from IP addresses that are reserved " .
- "for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as"); ?>
+ "for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as"); ?>
<?=gettext("well as loopback addresses (127/8)."); ?>&nbsp;&nbsp; <?=gettext("You should generally " .
"leave this option turned on, unless your WAN network lies in such " .
"a private address space, too."); ?>
@@ -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("<p><strong><?=gettext("NOTE:"); ?><\/strong> <?=gettext("You can manage Gateways"); ?> <a target='_blank' href='system_gateways.php'><?=gettext("here"); ?><\/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("<p><strong><?=gettext("NOTE:"); ?><\/strong> <?=gettext("You can manage Gateways"); ?> <a target='_blank' href='system_gateways.php'><?=gettext("here"); ?><\/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) {
<?php
foreach ($portlist as $portname => $portinfo):
?>
- <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
+ <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
<?=interface_assign_description($portinfo, $portname);?>
</option>
<?php
@@ -565,7 +565,7 @@ if ($input_errors) {
<?php
foreach ($unused_portlist as $portname => $portinfo):
?>
- <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
+ <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
<?=interface_assign_description($portinfo, $portname);?>
</option>
<?php
diff --git a/usr/local/www/interfaces_bridge.php b/usr/local/www/interfaces_bridge.php
index 7856a2a..b7e557f 100644
--- a/usr/local/www/interfaces_bridge.php
+++ b/usr/local/www/interfaces_bridge.php
@@ -86,7 +86,7 @@ if ($_GET['act'] == "del") {
}
-$pgtitle = array(gettext("Interfaces"),gettext("Bridge"));
+$pgtitle = array(gettext("Interfaces"), gettext("Bridge"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_bridge_edit.php b/usr/local/www/interfaces_bridge_edit.php
index 59d9072..cef2493 100644
--- a/usr/local/www/interfaces_bridge_edit.php
+++ b/usr/local/www/interfaces_bridge_edit.php
@@ -89,7 +89,7 @@ if (isset($id) && $a_bridges[$id]) {
$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']);
$ifpriority = array();
foreach ($pconfig['ifpriority'] as $cfg) {
- list ($key, $value) = explode(":", $cfg);
+ list ($key, $value) = explode(":", $cfg);
$embprioritycfg[$key] = $value;
foreach ($embprioritycfg as $key => $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() {
</td>
</tr>
<tr style="display:none" id="sprtable1">
- <td valign="top" class="vncell" align="center"><?=gettext("RSTP/STP"); ?> </td>
+ <td valign="top" class="vncell" align="center"><?=gettext("RSTP/STP"); ?> </td>
<td class="vtable">
<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked=\"checked\"";?> />
<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span>
@@ -447,8 +447,10 @@ function show_source_port_range() {
<td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
<td class="vtable" width="80%">
<table summary="priority">
- <?php foreach ($ifacelist as $ifn => $ifdescr)
- echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unknown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\" /></td></tr>";
+ <?php
+ foreach ($ifacelist as $ifn => $ifdescr) {
+ echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unknown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\" /></td></tr>";
+ }
?>
<tr>
<td></td>
diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php
index 10c1548..0730090 100644
--- a/usr/local/www/interfaces_gif.php
+++ b/usr/local/www/interfaces_gif.php
@@ -80,7 +80,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("GIF"));
+$pgtitle = array(gettext("Interfaces"), gettext("GIF"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -120,7 +120,7 @@ include("head.inc");
$i = 0;
foreach ($a_gifs as $gif):
?>
- <tr ondblclick="document.location='interfaces_gif_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='interfaces_gif_edit.php?id=<?=$i;?>'">
<td class="listlr">
<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gif['if']));?>
</td>
diff --git a/usr/local/www/interfaces_gif_edit.php b/usr/local/www/interfaces_gif_edit.php
index 74ba136..76a24ed 100644
--- a/usr/local/www/interfaces_gif_edit.php
+++ b/usr/local/www/interfaces_gif_edit.php
@@ -88,7 +88,7 @@ if ($_POST) {
$input_errors[] = gettext("The tunnel local and tunnel remote fields must have valid IP addresses.");
}
- $alias = strstr($_POST['if'],'|');
+ $alias = strstr($_POST['if'], '|');
if ((is_ipaddrv4($alias) && !is_ipaddrv4($_POST['remote-addr'])) ||
(is_ipaddrv6($alias) && !is_ipaddrv6($_POST['remote-addr']))) {
$input_errors[] = gettext("The alias IP address family has to match the family of the remote peer address.");
@@ -108,7 +108,7 @@ if ($_POST) {
if (!$input_errors) {
$gif = array();
- list($gif['if'], $gif['ipaddr']) = explode("|",$_POST['if']);
+ list($gif['if'], $gif['ipaddr']) = explode("|", $_POST['if']);
$gif['tunnel-local-addr'] = $_POST['tunnel-local-addr'];
$gif['tunnel-remote-addr'] = $_POST['tunnel-remote-addr'];
$gif['tunnel-remote-net'] = $_POST['tunnel-remote-net'];
@@ -141,7 +141,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("GIF"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("GIF"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_gre.php b/usr/local/www/interfaces_gre.php
index 29313d6..3431987 100644
--- a/usr/local/www/interfaces_gre.php
+++ b/usr/local/www/interfaces_gre.php
@@ -81,7 +81,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("GRE"));
+$pgtitle = array(gettext("Interfaces"), gettext("GRE"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -121,7 +121,7 @@ include("head.inc");
$i = 0;
foreach ($a_gres as $gre):
?>
- <tr ondblclick="document.location='interfaces_gre_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='interfaces_gre_edit.php?id=<?=$i;?>'">
<td class="listlr">
<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($gre['if']));?>
</td>
diff --git a/usr/local/www/interfaces_gre_edit.php b/usr/local/www/interfaces_gre_edit.php
index 64dea83..474e57b 100644
--- a/usr/local/www/interfaces_gre_edit.php
+++ b/usr/local/www/interfaces_gre_edit.php
@@ -77,7 +77,7 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr");
- $reqdfieldsn = array(gettext("Parent interface"),gettext("Local address"),gettext("Remote tunnel address"),gettext("Remote tunnel network"), gettext("Local tunnel address"));
+ $reqdfieldsn = array(gettext("Parent interface"), gettext("Local address"), gettext("Remote tunnel address"), gettext("Remote tunnel network"), gettext("Local tunnel address"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -93,7 +93,7 @@ if ($_POST) {
}
if (($gre['if'] == $_POST['if']) && ($gre['tunnel-remote-addr'] == $_POST['tunnel-remote-addr'])) {
- $input_errors[] = sprintf(gettext("A GRE tunnel with the network %s is already defined."),$gre['remote-network']);
+ $input_errors[] = sprintf(gettext("A GRE tunnel with the network %s is already defined."), $gre['remote-network']);
break;
}
}
@@ -134,7 +134,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("GRE"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("GRE"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_groups.php b/usr/local/www/interfaces_groups.php
index defb01f..6342bcf 100644
--- a/usr/local/www/interfaces_groups.php
+++ b/usr/local/www/interfaces_groups.php
@@ -55,7 +55,7 @@ if ($_GET['act'] == "del") {
foreach ($members as $ifs) {
$realif = get_real_interface($ifs);
if ($realif) {
- mwexec("/sbin/ifconfig {$realif} -group " . $a_ifgroups[$_GET['id']]['ifname']);
+ mwexec("/sbin/ifconfig {$realif} -group " . $a_ifgroups[$_GET['id']]['ifname']);
}
}
unset($a_ifgroups[$_GET['id']]);
@@ -65,7 +65,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("Groups"));
+$pgtitle = array(gettext("Interfaces"), gettext("Groups"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_groups_edit.php b/usr/local/www/interfaces_groups_edit.php
index 916b7c1..22b8567 100644
--- a/usr/local/www/interfaces_groups_edit.php
+++ b/usr/local/www/interfaces_groups_edit.php
@@ -44,7 +44,7 @@
require("guiconfig.inc");
require_once("functions.inc");
-$pgtitle = array(gettext("Interfaces"),gettext("Groups"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("Groups"), gettext("Edit"));
$shortcut_section = "interfaces";
if (!is_array($config['ifgroups']['ifgroupentry'])) {
@@ -93,7 +93,7 @@ if ($_POST) {
$members = "";
$isfirst = 0;
/* item is a normal ifgroupentry type */
- for ($x=0; $x<9999; $x++) {
+ for ($x = 0; $x < 9999; $x++) {
if ($_POST["members{$x}"] <> "") {
if ($isfirst > 0) {
$members .= " ";
@@ -318,10 +318,11 @@ function removeRow(el) {
}
if ($found === false) {
- foreach ($iflist_disabled as $ifnam => $ifdescr)
+ foreach ($iflist_disabled as $ifnam => $ifdescr) {
if ($ifnam == $members) {
echo "<option value=\"{$ifnam}\" selected=\"selected\">{$ifdescr}</option>";
}
+ }
}
?>
</select>
diff --git a/usr/local/www/interfaces_lagg.php b/usr/local/www/interfaces_lagg.php
index 60870c3..32b2a21 100644
--- a/usr/local/www/interfaces_lagg.php
+++ b/usr/local/www/interfaces_lagg.php
@@ -87,7 +87,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("LAGG"));
+$pgtitle = array(gettext("Interfaces"), gettext("LAGG"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -127,7 +127,7 @@ include("head.inc");
$i = 0;
foreach ($a_laggs as $lagg):
?>
- <tr ondblclick="document.location='interfaces_lagg_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='interfaces_lagg_edit.php?id=<?=$i;?>'">
<td class="listlr">
<?=htmlspecialchars(strtoupper($lagg['laggif']));?>
</td>
diff --git a/usr/local/www/interfaces_lagg_edit.php b/usr/local/www/interfaces_lagg_edit.php
index cfd24d4..c7894a6 100644
--- a/usr/local/www/interfaces_lagg_edit.php
+++ b/usr/local/www/interfaces_lagg_edit.php
@@ -146,7 +146,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("LAGG"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("LAGG"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php
index fb44fc9..85b5181 100644
--- a/usr/local/www/interfaces_ppps.php
+++ b/usr/local/www/interfaces_ppps.php
@@ -119,7 +119,7 @@ include("head.inc");
$i = 0;
foreach ($a_ppps as $id => $ppp):
?>
- <tr ondblclick="document.location='interfaces_ppps_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='interfaces_ppps_edit.php?id=<?=$i;?>'">
<td class="listr">
<?=htmlspecialchars($ppp['if']);?>
</td>
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
index 69e2959..4edcd73 100644
--- a/usr/local/www/interfaces_ppps_edit.php
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -89,10 +89,10 @@ if (isset($id) && $a_ppps[$id]) {
$pconfig['idletimeout'] = $a_ppps[$id]['idletimeout'];
$pconfig['uptime'] = $a_ppps[$id]['uptime'];
$pconfig['descr'] = $a_ppps[$id]['descr'];
- $pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']);
- $pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']);
- $pconfig['mru'] = explode(",",$a_ppps[$id]['mru']);
- $pconfig['mrru'] = explode(",",$a_ppps[$id]['mrru']);
+ $pconfig['bandwidth'] = explode(",", $a_ppps[$id]['bandwidth']);
+ $pconfig['mtu'] = explode(",", $a_ppps[$id]['mtu']);
+ $pconfig['mru'] = explode(",", $a_ppps[$id]['mru']);
+ $pconfig['mrru'] = explode(",", $a_ppps[$id]['mrru']);
if (isset($a_ppps[$id]['shortseq'])) {
$pconfig['shortseq'] = true;
}
@@ -117,14 +117,14 @@ if (isset($id) && $a_ppps[$id]) {
$pconfig['apnum'] = $a_ppps[$id]['apnum'];
$pconfig['phone'] = $a_ppps[$id]['phone'];
$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
- $pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
- $pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
+ $pconfig['localip'] = explode(",", $a_ppps[$id]['localip']);
+ $pconfig['gateway'] = explode(",", $a_ppps[$id]['gateway']);
break;
case "l2tp":
case "pptp":
- $pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
- $pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']);
- $pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
+ $pconfig['localip'] = explode(",", $a_ppps[$id]['localip']);
+ $pconfig['subnet'] = explode(",", $a_ppps[$id]['subnet']);
+ $pconfig['gateway'] = explode(",", $a_ppps[$id]['gateway']);
case "pppoe":
$pconfig['provider'] = $a_ppps[$id]['provider'];
if (isset($a_ppps[$id]['provider']) and empty($a_ppps[$id]['provider'])) {
@@ -202,16 +202,16 @@ if ($_POST) {
switch ($_POST['type']) {
case "ppp":
$reqdfields = explode(" ", "interfaces phone");
- $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Phone Number"));
+ $reqdfieldsn = array(gettext("Link Interface(s)"), gettext("Phone Number"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
break;
case "pppoe":
if ($_POST['ondemand']) {
$reqdfields = explode(" ", "interfaces username passwordfld ondemand idletimeout");
- $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Dial on demand"),gettext("Idle timeout value"));
+ $reqdfieldsn = array(gettext("Link Interface(s)"), gettext("Username"), gettext("Password"), gettext("Dial on demand"), gettext("Idle timeout value"));
} else {
$reqdfields = explode(" ", "interfaces username passwordfld");
- $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"));
+ $reqdfieldsn = array(gettext("Link Interface(s)"), gettext("Username"), gettext("Password"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
break;
@@ -219,10 +219,10 @@ if ($_POST) {
case "pptp":
if ($_POST['ondemand']) {
$reqdfields = explode(" ", "interfaces username passwordfld localip subnet gateway ondemand idletimeout");
- $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value"));
+ $reqdfieldsn = array(gettext("Link Interface(s)"), gettext("Username"), gettext("Password"), gettext("Local IP address"), gettext("Subnet"), gettext("Remote IP address"), gettext("Dial on demand"), gettext("Idle timeout value"));
} else {
$reqdfields = explode(" ", "interfaces username passwordfld localip subnet gateway");
- $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"));
+ $reqdfieldsn = array(gettext("Link Interface(s)"), gettext("Username"), gettext("Password"), gettext("Local IP address"), gettext("Subnet"), gettext("Remote IP address"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
break;
@@ -254,7 +254,7 @@ if ($_POST) {
$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
}
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) {
- $date_nums = explode("/",$_POST['pppoe_resetdate']);
+ $date_nums = explode("/", $_POST['pppoe_resetdate']);
if ($date_nums[0] < 1 || $date_nums[0] > 12) {
$input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
}
@@ -268,19 +268,19 @@ if ($_POST) {
foreach ($_POST['interfaces'] as $iface) {
if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) {
- $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface);
+ $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface);
}
if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) {
- $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface);
+ $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface);
}
if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) {
- $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface);
+ $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface);
}
if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) {
- $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface);
+ $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface);
}
if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) {
- $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface);
+ $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface);
}
}
@@ -302,7 +302,7 @@ if ($_POST) {
$ppp['ptpid'] = $_POST['ptpid'];
$ppp['type'] = $_POST['type'];
$ppp['if'] = $ppp['type'].$ppp['ptpid'];
- $ppp['ports'] = implode(',',$_POST['interfaces']);
+ $ppp['ports'] = implode(',', $_POST['interfaces']);
$ppp['username'] = $_POST['username'];
$ppp['password'] = base64_encode($_POST['passwordfld']);
$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
@@ -351,8 +351,8 @@ if ($_POST) {
unset($ppp['apnum']);
}
$ppp['phone'] = $_POST['phone'];
- $ppp['localip'] = implode(',',$port_data['localip']);
- $ppp['gateway'] = implode(',',$port_data['gateway']);
+ $ppp['localip'] = implode(',', $port_data['localip']);
+ $ppp['gateway'] = implode(',', $port_data['gateway']);
if (!empty($_POST['connect-timeout'])) {
$ppp['connect-timeout'] = $_POST['connect-timeout'];
} else {
@@ -375,9 +375,9 @@ if ($_POST) {
break;
case "pptp":
case "l2tp":
- $ppp['localip'] = implode(',',$port_data['localip']);
- $ppp['subnet'] = implode(',',$port_data['subnet']);
- $ppp['gateway'] = implode(',',$port_data['gateway']);
+ $ppp['localip'] = implode(',', $port_data['localip']);
+ $ppp['subnet'] = implode(',', $port_data['subnet']);
+ $ppp['gateway'] = implode(',', $port_data['gateway']);
break;
default:
break;
@@ -425,11 +425,11 @@ if ($_POST) {
} // end if ($_POST)
$closehead = false;
-$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("PPPs"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
-$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/);
+$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/);
?>
<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
@@ -479,7 +479,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
<tr style="display:none" name="portlists" id="portlists">
<td id="serialports">
<?php
- $selected_ports = explode(',',$pconfig['interfaces']);
+ $selected_ports = explode(',', $pconfig['interfaces']);
if (!is_dir("/var/spool/lock")) {
mwexec("/bin/mkdir -p /var/spool/lock");
}
@@ -488,7 +488,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
$serport_count = 0;
foreach ($serialports as $port) {
$serport_count++;
- echo $port.",".trim($port);
+ echo $port . "," . trim($port);
if (in_array($port, $selected_ports)) {
echo ",1|";
} else {
@@ -538,7 +538,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
</tr>
<tr style="display:none" name="select" id="select"><td style="display:none"></td></tr>
<?php
- $k=0;
+ $k = 0;
?>
<tr style="display:none" name="ppp_provider" id="ppp_provider">
<td width="22%" valign="top" class="vncell">
@@ -722,13 +722,13 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
</tr>
<?php
- for ($j=0; $j < $port_count; $j++) :
+ for ($j = 0; $j < $port_count; $j++) :
?>
<tr style="display:none" id="gw_fields<?=$j;?>">
<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
<td width="78%" class="vtable">
- <input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
+ <input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
/
<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="disabled">
<?php for ($i = 31; $i > 0; $i--): ?>
@@ -828,7 +828,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
<td style="display:none" id="adv_show" name="adv_show">0</td>
</tr>
<?php
- for ($i=0; $i < $port_count; $i++) :
+ for ($i = 0; $i < $port_count; $i++) :
?>
<tr style="display:none" id="link<?=$i;?>">
<td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> <?=gettext("Link Parameters");?></td>
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php
index 9be532c..f088862 100644
--- a/usr/local/www/interfaces_qinq.php
+++ b/usr/local/www/interfaces_qinq.php
@@ -90,7 +90,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("QinQ"));
+$pgtitle = array(gettext("Interfaces"), gettext("QinQ"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -131,7 +131,7 @@ include("head.inc");
$i = 0;
foreach ($a_qinqs as $qinq):
?>
- <tr ondblclick="document.location='interfaces_qinq_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='interfaces_qinq_edit.php?id=<?=$i;?>'">
<td class="listlr">
<?=htmlspecialchars($qinq['if']);?>
</td>
diff --git a/usr/local/www/interfaces_qinq_edit.php b/usr/local/www/interfaces_qinq_edit.php
index 4efe42b..9a4a4c5 100644
--- a/usr/local/www/interfaces_qinq_edit.php
+++ b/usr/local/www/interfaces_qinq_edit.php
@@ -39,7 +39,7 @@
##|*MATCH=interfaces_qinq_edit.php*
##|-PRIV
-$pgtitle = array(gettext("Interfaces"),gettext("QinQ"), gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("QinQ"), gettext("Edit"));
$shortcut_section = "interfaces";
require("guiconfig.inc");
@@ -134,11 +134,11 @@ if ($_POST) {
$members = "";
$isfirst = 0;
/* item is a normal qinqentry type */
- for ($x=0; $x<9999; $x++) {
+ for ($x = 0; $x < 9999; $x++) {
if ($_POST["members{$x}"] <> "") {
$member = explode("-", $_POST["members{$x}"]);
if (count($member) > 1) {
- if (preg_match("/([^0-9])+/", $member[0], $match) ||
+ if (preg_match("/([^0-9])+/", $member[0], $match) ||
preg_match("/([^0-9])+/", $member[1], $match)) {
$input_errors[] = gettext("Tags can contain only numbers or a range in format #-#.");
}
diff --git a/usr/local/www/interfaces_vlan.php b/usr/local/www/interfaces_vlan.php
index a3f481e..20453b4 100644
--- a/usr/local/www/interfaces_vlan.php
+++ b/usr/local/www/interfaces_vlan.php
@@ -84,7 +84,7 @@ if ($_GET['act'] == "del") {
}
-$pgtitle = array(gettext("Interfaces"),gettext("VLAN"));
+$pgtitle = array(gettext("Interfaces"), gettext("VLAN"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -151,7 +151,7 @@ include("head.inc");
<span class="red"><strong>
<?=gettext("Note:");?><br />
</strong></span>
- <?php printf(gettext("Not all drivers/NICs support 802.1Q VLAN tagging properly. On cards that do not explicitly support it, VLAN tagging will still work, but the reduced MTU may cause problems. See the %s handbook for information on supported cards."),$g['product_name']);?> </p>
+ <?php printf(gettext("Not all drivers/NICs support 802.1Q VLAN tagging properly. On cards that do not explicitly support it, VLAN tagging will still work, but the reduced MTU may cause problems. See the %s handbook for information on supported cards."), $g['product_name']);?> </p>
</td>
<td class="list">&nbsp;</td>
</tr>
diff --git a/usr/local/www/interfaces_vlan_edit.php b/usr/local/www/interfaces_vlan_edit.php
index eeb3c47..05940ad 100644
--- a/usr/local/www/interfaces_vlan_edit.php
+++ b/usr/local/www/interfaces_vlan_edit.php
@@ -80,7 +80,7 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "if tag");
- $reqdfieldsn = array(gettext("Parent interface"),gettext("VLAN tag"));
+ $reqdfieldsn = array(gettext("Parent interface"), gettext("VLAN tag"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -105,7 +105,7 @@ if ($_POST) {
}
if (($vlan['if'] == $_POST['if']) && ($vlan['tag'] == $_POST['tag'])) {
- $input_errors[] = sprintf(gettext("A VLAN with the tag %s is already defined on this interface."),$vlan['tag']);
+ $input_errors[] = sprintf(gettext("A VLAN with the tag %s is already defined on this interface."), $vlan['tag']);
break;
}
}
@@ -161,7 +161,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("VLAN"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("VLAN"), gettext("Edit"));
$shortcut_section = "interfaces";
include("head.inc");
diff --git a/usr/local/www/interfaces_wireless.php b/usr/local/www/interfaces_wireless.php
index a1fd5fe..86fc077 100644
--- a/usr/local/www/interfaces_wireless.php
+++ b/usr/local/www/interfaces_wireless.php
@@ -79,7 +79,7 @@ if ($_GET['act'] == "del") {
}
-$pgtitle = array(gettext("Interfaces"),gettext("Wireless"));
+$pgtitle = array(gettext("Interfaces"), gettext("Wireless"));
$shortcut_section = "wireless";
include("head.inc");
diff --git a/usr/local/www/interfaces_wireless_edit.php b/usr/local/www/interfaces_wireless_edit.php
index cceca00..ab206f0 100644
--- a/usr/local/www/interfaces_wireless_edit.php
+++ b/usr/local/www/interfaces_wireless_edit.php
@@ -92,7 +92,7 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "if mode");
- $reqdfieldsn = array(gettext("Parent interface"),gettext("Mode"));
+ $reqdfieldsn = array(gettext("Parent interface"), gettext("Mode"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -156,7 +156,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Interfaces"),gettext("Wireless"),gettext("Edit"));
+$pgtitle = array(gettext("Interfaces"), gettext("Wireless"), gettext("Edit"));
include("head.inc");
?>
diff --git a/usr/local/www/license.php b/usr/local/www/license.php
index a93901d..2247d6a 100644
--- a/usr/local/www/license.php
+++ b/usr/local/www/license.php
@@ -74,7 +74,7 @@ include("head.inc");
<?=gettext("POSSIBILITY OF SUCH DAMAGE");?></strong>.</p>
<hr size="1">
<p><?= "{$g['product_name']} " . gettext("is based upon/includes various free software packages, listed below.");?><br />
- <?php printf(gettext("The authors of %s would like to thank the authors of these software packages for their efforts"),$g['product_name']);?>.</p>
+ <?php printf(gettext("The authors of %s would like to thank the authors of these software packages for their efforts"), $g['product_name']);?>.</p>
<p>FreeBSD (<a href="http://www.freebsd.org" target="_blank">http://www.freebsd.org</a>)<br />
<?=gettext("Copyright");?> &copy;<?=gettext("1992-2015 The FreeBSD Project. All rights reserved");?>.<br />
<br />
diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php
index 3fdf0d5..87884e5 100644
--- a/usr/local/www/load_balancer_monitor.php
+++ b/usr/local/www/load_balancer_monitor.php
@@ -86,7 +86,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Monitor"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Monitor"));
$shortcut_section = "relayd";
include("head.inc");
@@ -119,9 +119,9 @@ include("head.inc");
$t = new MainTable();
$t->edit_uri('load_balancer_monitor_edit.php');
$t->my_uri('load_balancer_monitor.php');
- $t->add_column(gettext('Name'),'name',20);
- $t->add_column(gettext('Type'),'type',10);
- $t->add_column(gettext('Description'),'descr',30);
+ $t->add_column(gettext('Name'), 'name', 20);
+ $t->add_column(gettext('Type'), 'type', 10);
+ $t->add_column(gettext('Description'), 'descr', 30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_monitor_edit.php b/usr/local/www/load_balancer_monitor_edit.php
index b8806e1..45a5dab 100644
--- a/usr/local/www/load_balancer_monitor_edit.php
+++ b/usr/local/www/load_balancer_monitor_edit.php
@@ -81,7 +81,7 @@ if ($_POST) {
foreach ($_POST as $key => $val) {
if (stristr($key, 'options') !== false) {
if (stristr($key, $pconfig['type'].'_') !== false) {
- $opt = explode('_',$key);
+ $opt = explode('_', $key);
$pconfig['options'][$opt[2]] = $val;
}
unset($pconfig[$key]);
@@ -90,12 +90,12 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "name type descr");
- $reqdfieldsn = array(gettext("Name"),gettext("Type"),gettext("Description"));
+ $reqdfieldsn = array(gettext("Name"), gettext("Type"), gettext("Description"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
/* Ensure that our monitor names are unique */
- for ($i=0; isset($config['load_balancer']['monitor_type'][$i]); $i++) {
+ for ($i = 0; isset($config['load_balancer']['monitor_type'][$i]); $i++) {
if (($_POST['name'] == $config['load_balancer']['monitor_type'][$i]['name']) && ($i != $id)) {
$input_errors[] = gettext("This monitor name has already been used. Monitor names must be unique.");
}
@@ -206,7 +206,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Monitor"),gettext("Edit"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Monitor"), gettext("Edit"));
$shortcut_section = "relayd";
include("head.inc");
@@ -292,13 +292,13 @@ function updateType(t) {
</td>
</tr>
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("Host"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("Host"); ?></td>
<td class="vtable" colspan="2">
<input name="http_options_host" type="text" <?if (isset($pconfig['options']['host'])) echo "value=\"" . htmlspecialchars($pconfig['options']['host']) . "\"";?> size="64" /><br /><?=gettext("Hostname for Host: header if needed."); ?>
</td>
</tr>
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("HTTP Code"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("HTTP Code"); ?></td>
<td class="vtable" colspan="2">
<?= print_rfc2616_select("http_options_code", $pconfig['options']['code']); ?>
</td>
@@ -319,19 +319,19 @@ function updateType(t) {
<td width="78%" class="vtable" colspan="2">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="https">
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("Path"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("Path"); ?></td>
<td class="vtable" colspan="2">
<input name="https_options_path" type="text" <?if (isset($pconfig['options']['path'])) echo "value=\"" . htmlspecialchars($pconfig['options']['path']) ."\"";?> size="64" />
</td>
</tr>
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("Host"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("Host"); ?></td>
<td class="vtable" colspan="2">
<input name="https_options_host" type="text" <?if (isset($pconfig['options']['host'])) echo "value=\"" . htmlspecialchars($pconfig['options']['host']) . "\"";?> size="64" /><br /><?=gettext("Hostname for Host: header if needed."); ?>
</td>
</tr>
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("HTTP Code"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("HTTP Code"); ?></td>
<td class="vtable" colspan="2">
<?= print_rfc2616_select("https_options_code", $pconfig['options']['code']); ?>
</td>
@@ -353,13 +353,13 @@ function updateType(t) {
<td width="78%" class="vtable" colspan="2">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="send expect">
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("Send string"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("Send string"); ?></td>
<td class="vtable" colspan="2">
<input name="send_options_send" type="text" <?if (isset($pconfig['options']['send'])) echo "value=\"" . htmlspecialchars($pconfig['options']['send']) . "\"";?> size="64" />
</td>
</tr>
<tr align="left">
- <td valign="top" align="right" class="vtable"><?=gettext("Expect string"); ?></td>
+ <td valign="top" align="right" class="vtable"><?=gettext("Expect string"); ?></td>
<td class="vtable" colspan="2">
<input name="send_options_expect" type="text" <?if (isset($pconfig['options']['expect'])) echo "value=\"" . htmlspecialchars($pconfig['options']['expect']) . "\"";?> size="64" />
</td>
diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php
index a2e8c54..47f3a89 100644
--- a/usr/local/www/load_balancer_pool.php
+++ b/usr/local/www/load_balancer_pool.php
@@ -95,7 +95,7 @@ for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
$a_pool[$i]['monitor'] = "<a href=\"/load_balancer_monitor_edit.php?id={$mondex[$a_pool[$i]['monitor']]}\">" . htmlspecialchars($a_pool[$i]['monitor']) . "</a>";
}
-$pgtitle = array(gettext("Services"), gettext("Load Balancer"),gettext("Pool"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Pool"));
$shortcut_section = "relayd";
include("head.inc");
@@ -128,12 +128,12 @@ include("head.inc");
$t = new MainTable();
$t->edit_uri('load_balancer_pool_edit.php');
$t->my_uri('load_balancer_pool.php');
- $t->add_column(gettext('Name'),'name',10);
- $t->add_column(gettext('Mode'),'mode',10);
- $t->add_column(gettext('Servers'),'servers',15);
- $t->add_column(gettext('Port'),'port',10);
- $t->add_column(gettext('Monitor'),'monitor',10);
- $t->add_column(gettext('Description'),'descr',25);
+ $t->add_column(gettext('Name'), 'name', 10);
+ $t->add_column(gettext('Mode'), 'mode', 10);
+ $t->add_column(gettext('Servers'), 'servers', 15);
+ $t->add_column(gettext('Port'), 'port', 10);
+ $t->add_column(gettext('Monitor'), 'monitor', 10);
+ $t->add_column(gettext('Description'), 'descr', 25);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php
index ec90aee..8cf385b 100644
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -80,12 +80,12 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "name mode port monitor servers");
- $reqdfieldsn = array(gettext("Name"),gettext("Mode"),gettext("Port"),gettext("Monitor"),gettext("Server List"));
+ $reqdfieldsn = array(gettext("Name"), gettext("Mode"), gettext("Port"), gettext("Monitor"), gettext("Server List"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
/* Ensure that our pool names are unique */
- for ($i=0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
+ for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
if (($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name']) && ($i != $id)) {
$input_errors[] = gettext("This pool name has already been used. Pool names must be unique.");
}
@@ -135,7 +135,7 @@ if ($_POST) {
}
}
$m = array();
- for ($i=0; isset($config['load_balancer']['monitor_type'][$i]); $i++) {
+ for ($i = 0; isset($config['load_balancer']['monitor_type'][$i]); $i++) {
$m[$config['load_balancer']['monitor_type'][$i]['name']] = $config['load_balancer']['monitor_type'][$i];
}
@@ -184,7 +184,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Services"), gettext("Load Balancer"),gettext("Pool"),gettext("Edit"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Pool"), gettext("Edit"));
$shortcut_section = "relayd";
include("head.inc");
@@ -196,7 +196,7 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
function clearcombo() {
- for (var i=document.iform.serversSelect.options.length-1; i>=0; i--) {
+ for (var i = document.iform.serversSelect.options.length - 1; i >= 0; i--) {
document.iform.serversSelect.options[i] = null;
}
document.iform.serversSelect.selectedIndex = -1;
@@ -225,7 +225,7 @@ function clearcombo() {
<td width="78%" class="vtable" colspan="2">
<select id="mode" name="mode" onchange="enforceFailover(); checkPoolControls();">
<option value="loadbalance" <?if (!isset($pconfig['mode']) || ($pconfig['mode'] == "loadbalance")) echo "selected=\"selected\"";?>><?=gettext("Load Balance");?></option>
- <option value="failover" <?if ($pconfig['mode'] == "failover") echo "selected=\"selected\"";?>><?=gettext("Manual Failover");?></option>
+ <option value="failover" <?if ($pconfig['mode'] == "failover") echo "selected=\"selected\"";?>><?=gettext("Manual Failover");?></option>
</select>
</td>
</tr>
diff --git a/usr/local/www/load_balancer_setting.php b/usr/local/www/load_balancer_setting.php
index e48e38e..d82f341 100644
--- a/usr/local/www/load_balancer_setting.php
+++ b/usr/local/www/load_balancer_setting.php
@@ -79,7 +79,7 @@ if ($_POST) {
if (!is_numeric($_POST['prefork'])) {
$input_errors[] = gettext("Prefork must be a numeric value");
} else {
- if (($_POST['prefork']<=0) || ($_POST['prefork']>32)) {
+ if (($_POST['prefork'] <= 0) || ($_POST['prefork'] > 32)) {
$input_errors[] = gettext("Prefork value must be between 1 and 32");
}
}
@@ -97,7 +97,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Settings"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Settings"));
$shortcut_section = "relayd";
include("head.inc");
diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php
index e68c32c..dec55f1 100644
--- a/usr/local/www/load_balancer_virtual_server.php
+++ b/usr/local/www/load_balancer_virtual_server.php
@@ -96,7 +96,7 @@ for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) {
}
}
-$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Virtual Servers"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Virtual Servers"));
$shortcut_section = "relayd-virtualservers";
include("head.inc");
@@ -129,13 +129,13 @@ include("head.inc");
$t = new MainTable();
$t->edit_uri('load_balancer_virtual_server_edit.php');
$t->my_uri('load_balancer_virtual_server.php');
- $t->add_column(gettext('Name'),'name',10);
- $t->add_column(gettext('Protocol'),'relay_protocol',10);
- $t->add_column(gettext('IP Address'),'ipaddr',15);
- $t->add_column(gettext('Port'),'port',10);
- $t->add_column(gettext('Pool'),'poolname',15);
- $t->add_column(gettext('Fall Back Pool'),'sitedown',15);
- $t->add_column(gettext('Description'),'descr',30);
+ $t->add_column(gettext('Name'), 'name', 10);
+ $t->add_column(gettext('Protocol'), 'relay_protocol', 10);
+ $t->add_column(gettext('IP Address'), 'ipaddr', 15);
+ $t->add_column(gettext('Port'), 'port', 10);
+ $t->add_column(gettext('Pool'), 'poolname', 15);
+ $t->add_column(gettext('Fall Back Pool'), 'sitedown', 15);
+ $t->add_column(gettext('Description'), 'descr', 30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php
index a6cea52..5326b99 100644
--- a/usr/local/www/load_balancer_virtual_server_edit.php
+++ b/usr/local/www/load_balancer_virtual_server_edit.php
@@ -75,19 +75,19 @@ if ($_POST) {
switch ($pconfig['mode']) {
case "redirect": {
$reqdfields = explode(" ", "ipaddr name mode");
- $reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Mode"));
+ $reqdfieldsn = array(gettext("IP Address"), gettext("Name"), gettext("Mode"));
break;
}
case "relay": {
$reqdfields = explode(" ", "ipaddr name mode relay_protocol");
- $reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Relay Protocol"));
+ $reqdfieldsn = array(gettext("IP Address"), gettext("Name"), gettext("Relay Protocol"));
break;
}
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- for ($i=0; isset($config['load_balancer']['virtual_server'][$i]); $i++) {
+ for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) {
if (($_POST['name'] == $config['load_balancer']['virtual_server'][$i]['name']) && ($i != $id)) {
$input_errors[] = gettext("This virtual server name has already been used. Virtual server names must be unique.");
}
@@ -160,7 +160,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Virtual Server"),gettext("Edit"));
+$pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Virtual Server"), gettext("Edit"));
$shortcut_section = "relayd-virtualservers";
include("head.inc");
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php
index 9b0ae61..c56ece5 100755
--- a/usr/local/www/pkg.php
+++ b/usr/local/www/pkg.php
@@ -181,7 +181,7 @@ include("head.inc");
cursor: 'move',
distance: 10,
opacity: 0.8,
- helper: function(e,ui) {
+ helper: function(e, ui) {
ui.children().each(function() {
jQuery(this).width(jQuery(this).width());
});
@@ -190,8 +190,8 @@ include("head.inc");
});
});
function save_changes_to_xml(xml) {
- var ids=jQuery('#mainarea table tbody').sortable('serialize',{key:"ids[]"});
- var strloading="<img src='/themes/<?= $g['theme']; ?>/images/misc/loader.gif' alt='loader' /> " + "<?=gettext('Saving changes...');?>";
+ var ids=jQuery('#mainarea table tbody').sortable('serialize', {key:"ids[]"});
+ var strloading="<img src='/themes/<?= $g['theme']; ?>/images/misc/loader.gif' alt='loader' /> " + "<?=gettext('Saving changes...');?>";
if (confirm("<?=gettext("Do you really want to save changes?");?>")) {
jQuery.ajax({
type: 'get',
@@ -332,7 +332,7 @@ include("head.inc");
<tr>
<?php
if ($display_maximum_rows) {
- $totalpages = ceil(round((count($evaledvar) / $display_maximum_rows),9));
+ $totalpages = ceil(round((count($evaledvar) / $display_maximum_rows), 9));
$page = 1;
$tmpcount = 0;
$tmppp = 0;
@@ -354,7 +354,7 @@ include("head.inc");
echo "<tr>";
echo "<td align='left'>Displaying page $page of $totalpages</b></td>";
echo "<td align='right'>Rows per page: <select onchange='document.pkgform.submit();' name='display_maximum_rows'>";
- for ($x=0; $x<250; $x++) {
+ for ($x = 0; $x < 250; $x++) {
if ($x == $display_maximum_rows) {
$SELECTED = "selected=\"selected\"";
} else {
@@ -378,8 +378,8 @@ include("head.inc");
</tr>
<?php
$i = 0;
- $pagination_startingrow=0;
- $pagination_counter=0;
+ $pagination_startingrow = 0;
+ $pagination_counter = 0;
if ($evaledvar) {
foreach ($evaledvar as $ip) {
if ($startdisplayingat) {
@@ -453,11 +453,11 @@ include("head.inc");
echo gettext("Yes");
}
} else if ($column['type'] == "interface") {
- echo $column['prefix'] . $iflist[$fieldname] . $column['suffix'];
+ echo $column['prefix'] . $iflist[$fieldname] . $column['suffix'];
} else {
#Check if columnitem has an encoding field declared
if ($column['encoding'] == "base64") {
- echo $column['prefix'] . base64_decode($fieldname) . $column['suffix'];
+ echo $column['prefix'] . base64_decode($fieldname) . $column['suffix'];
#Check if there is a custom info to show when $fieldname is not empty
} else if ($column['listmodeon'] && $fieldname != "") {
echo $column['prefix'] . gettext($column['listmodeon']). $column['suffix'];
@@ -499,29 +499,29 @@ include("head.inc");
$colcount = count($pkg['adddeleteeditpagefields']['columnitem']);
$final_footer = "";
$final_footer .= "<tr><td colspan='$colcount'>";
- $final_footer .= "<table width='100%' summary=''><tr>";
- $final_footer .= "<td align='left'>";
+ $final_footer .= "<table width='100%' summary=''><tr>";
+ $final_footer .= "<td align='left'>";
$startingat = $startdisplayingat - $display_maximum_rows;
if ($startingat > -1) {
- $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat={$startingat}&amp;display_maximum_rows={$display_maximum_rows}'>";
+ $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat={$startingat}&amp;display_maximum_rows={$display_maximum_rows}'>";
} else if ($startdisplayingat > 1) {
- $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=0&amp;display_maximum_rows={$display_maximum_rows}'>";
+ $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=0&amp;display_maximum_rows={$display_maximum_rows}'>";
}
- $final_footer .= "<font size='2'><< Previous page</font></a>";
+ $final_footer .= "<font size='2'><< Previous page</font></a>";
if ($tmppp + $display_maximum_rows > count($evaledvar)) {
$endingrecord = count($evaledvar);
} else {
$endingrecord = $tmppp + $display_maximum_rows;
}
- $final_footer .= "</td><td align='center'>";
+ $final_footer .= "</td><td align='center'>";
$tmppp++;
- $final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records";
- $final_footer .= "</font></td><td align='right'>&nbsp;";
+ $final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records";
+ $final_footer .= "</font></td><td align='right'>&nbsp;";
if (($i+1) < count($evaledvar)) {
- $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&amp;display_maximum_rows={$display_maximum_rows}'>";
+ $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&amp;startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&amp;display_maximum_rows={$display_maximum_rows}'>";
}
- $final_footer .= "<font size='2'>Next page >></font></a>";
- $final_footer .= "</td></tr></table></td></tr>";
+ $final_footer .= "<font size='2'>Next page >></font></a>";
+ $final_footer .= "</td></tr></table></td></tr>";
$i = count($evaledvar);
break;
}
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index f6827df..0b01a28 100644
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -59,9 +59,9 @@ function gentitle_pkg($pgname) {
function domTT_title($title_msg) {
if (!empty($title_msg)) {
- $title_msg=preg_replace("/\s+/"," ",$title_msg);
- $title_msg=preg_replace("/'/","\'",$title_msg);
- return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'delay',300,'styleClass', 'niceTitle');\"";
+ $title_msg = preg_replace("/\s+/", " ", $title_msg);
+ $title_msg = preg_replace("/'/", "\'", $title_msg);
+ return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'delay', 300, 'styleClass', 'niceTitle');\"";
}
}
@@ -210,13 +210,14 @@ if ($_POST) {
$rowhelpername="row";
foreach ($fields['rowhelper']['rowhelperfield'] as $rowhelperfield) {
foreach ($_POST as $key => $value) {
- if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/",$key,$matches))
- $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']]=$value;
+ if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/", $key, $matches)) {
+ $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = $value;
+ }
}
}
break;
default:
- $fieldname = $fields['fieldname'];
+ $fieldname = $fields['fieldname'];
if ($fieldname == "interface_array") {
$fieldvalue = $_POST[$fieldname];
} elseif (is_array($_POST[$fieldname])) {
@@ -283,7 +284,7 @@ if ($_POST) {
}
if ($pkg['title'] <> "") {
- $edit = ($only_edit ? '' : ": " . gettext("Edit"));
+ $edit = ($only_edit ? '' : ": " . gettext("Edit"));
$title = $pkg['title'] . $edit;
} else {
$title = gettext("Package Editor");
@@ -321,7 +322,7 @@ if ($pkg['custom_php_after_head_command']) {
cursor: 'move',
distance: 10,
opacity: 0.8,
- helper: function(e,ui) {
+ helper: function(e, ui) {
ui.children().each(function() {
jQuery(this).width(jQuery(this).width());
});
@@ -497,7 +498,7 @@ if ($pkg['tabs'] <> "") {
continue;
}
- if ($pkga['combinefields']=="begin") {
+ if ($pkga['combinefields'] == "begin") {
$input="<tr valign='top' id='tr_{$pkga['fieldname']}'>";
if (isset($pkga['advancedfield']) && isset($adv_filed_count)) {
$advanced .= $input;
@@ -553,7 +554,7 @@ if ($pkg['tabs'] <> "") {
echo $input;
}
}
- if ($pkga['combinefields']=="begin") {
+ if ($pkga['combinefields'] == "begin") {
$input="<td class=\"vncell\"><table summary=\"advanced\"><tr>";
if (isset($pkga['advancedfield']) && isset($adv_filed_count)) {
$advanced .= $input;
@@ -682,7 +683,7 @@ if ($pkg['tabs'] <> "") {
$source_name =($pkga['source_name']? $opt[$pkga['source_name']] : $opt[$pkga['name']]);
$source_value =($pkga['source_value'] ? $opt[$pkga['source_value']] : $opt[$pkga['value']]);
$selected = (in_array($source_value, $items)? 'selected="selected"' : '');
- $input .= "\t<option value=\"{$source_value}\" $selected>{$source_name}</option>\n";
+ $input .= "\t<option value=\"{$source_value}\" $selected>{$source_name}</option>\n";
}
$input .= "</select>\n<br />\n" . fixup_string($pkga['description']) . "\n";
if (isset($pkga['advancedfield']) && isset($adv_filed_count)) {
@@ -762,7 +763,7 @@ if ($pkg['tabs'] <> "") {
if (!empty($pkga['typealiases'])) {
foreach ($a_aliases as $alias) {
if ($alias['type'] == $pkga['typealiases']) {
- if ($addrisfirst == 1) {
+ if ($addrisfirst == 1) {
$aliasesaddr .= ",";
}
$aliasesaddr .= "'" . $alias['name'] . "'";
@@ -795,39 +796,39 @@ if ($pkg['tabs'] <> "") {
break;
case "interfaces_selection":
- $ips=array();
+ $ips = array();
$interface_regex=(isset($pkga['hideinterfaceregex']) ? $pkga['hideinterfaceregex'] : "nointerfacestohide");
if (is_array($config['interfaces'])) {
foreach ($config['interfaces'] as $iface_key=>$iface_value) {
- if (isset($iface_value['enable']) && !preg_match("/$interface_regex/",$iface_key)) {
+ if (isset($iface_value['enable']) && !preg_match("/$interface_regex/", $iface_key)) {
$iface_description=($iface_value['descr'] !="" ? strtoupper($iface_value['descr']) : strtoupper($iface_key));
if (isset($pkga['showips'])) {
$iface_description .= " address";
}
- $ips[]=array('ip'=> $iface_key, 'description'=> $iface_description);
+ $ips[] = array('ip'=> $iface_key, 'description'=> $iface_description);
}
}
}
if (is_array($config['virtualip']) && isset($pkga['showvirtualips'])) {
foreach ($config['virtualip']['vip'] as $vip) {
- if (!preg_match("/$interface_regex/",$vip['interface'])) {
+ if (!preg_match("/$interface_regex/", $vip['interface'])) {
$vip_description=($vip['descr'] !="" ? " ({$vip['descr']}) " : " ");
}
switch ($vip['mode']) {
case "ipalias":
case "carp":
- $ips[]=array('ip'=> $vip['subnet'],'description' => "{$vip['subnet']} $vip_description");
+ $ips[] = array('ip' => $vip['subnet'], 'description' => "{$vip['subnet']} $vip_description");
break;
case "proxyarp":
- if ($vip['type']=="network") {
+ if ($vip['type'] == "network") {
$start = ip2long32(gen_subnet($vip['subnet'], $vip['subnet_bits']));
$end = ip2long32(gen_subnet_max($vip['subnet'], $vip['subnet_bits']));
$len = $end - $start;
for ($i = 0; $i <= $len; $i++) {
- $ips[]= array('ip'=>long2ip32($start+$i),'description'=> long2ip32($start+$i)." from {$vip['subnet']}/{$vip['subnet_bits']} {$vip_description}");
+ $ips[]= array('ip' => long2ip32($start+$i), 'description' => long2ip32($start+$i)." from {$vip['subnet']}/{$vip['subnet_bits']} {$vip_description}");
}
} else {
- $ips[]= array('ip'=>$vip['subnet'],'description'=> "{$vip['subnet']} $vip_description");
+ $ips[]= array('ip' => $vip['subnet'], 'description' => "{$vip['subnet']} $vip_description");
}
break;
}
@@ -835,11 +836,11 @@ if ($pkg['tabs'] <> "") {
}
sort($ips);
if (isset($pkga['showlistenall'])) {
- array_unshift($ips,array('ip'=> 'All', 'description'=> 'Listen on All interfaces/ip addresses '));
+ array_unshift($ips, array('ip' => 'All', 'description' => 'Listen on All interfaces/ip addresses '));
}
- if (!preg_match("/$interface_regex/","loopback")) {
+ if (!preg_match("/$interface_regex/", "loopback")) {
$iface_description=(isset($pkga['showips']) ? "127.0.0.1 (loopback)" : "loopback");
- array_push($ips,array('ip'=> 'lo0', 'description'=> $iface_description));
+ array_push($ips, array('ip' => 'lo0', 'description' => $iface_description));
}
#show interfaces array on gui
@@ -854,7 +855,7 @@ if ($pkg['tabs'] <> "") {
if (is_array($value)) {
$values = $value;
} else {
- $values = explode(',', $value);
+ $values = explode(',', $value);
}
foreach ($ips as $iface) {
$selected = (in_array($iface['ip'], $values) ? 'selected="selected"' : '');
@@ -947,7 +948,7 @@ if ($pkg['tabs'] <> "") {
if (isset($a_pkg[$id][$rowhelpername])) {
$saved_rows=$a_pkg[$id][$rowhelpername];
} else {
- $saved_rows[]=array();
+ $saved_rows[] = array();
}
foreach ($saved_rows as $row) {
@@ -1019,16 +1020,16 @@ if ($pkg['tabs'] <> "") {
// The tr tag end is used to end the whole set of combined fields,
// but also if usecolspan2 is not in effect then we also put each combined field in its own tr.
if (($pkga['combinefields'] == "end") || (!isset($pkga['usecolspan2']))) {
- $input.="</tr>";
+ $input .= "</tr>";
}
// At the end of the combined fields we finish up the table that encloses the combined fields...
if ($pkga['combinefields'] == "end") {
- $input.="</table></td></tr>";
+ $input .= "</table></td></tr>";
}
} else {
$input = "</td></tr>";
if ($pkga['usecolspan2']) {
- $input.= "</tr><br />";
+ $input .= "</tr><br />";
}
}
if (isset($pkga['advancedfield']) && isset($adv_filed_count)) {
@@ -1115,7 +1116,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) {
case "textarea":
echo "<textarea rows='2' cols='12' id='{$fieldname}{$trc}' class='formfld unknown' name='{$fieldname}{$trc}'>{$value}</textarea>\n";
case "select":
- echo "<select style='height:22px;' id='{$fieldname}{$trc}' name='{$fieldname}{$trc}' {$title}>\n";
+ echo "<select style='height:22px;' id='{$fieldname}{$trc}' name='{$fieldname}{$trc}' {$title}>\n";
foreach ($rowhelper['options']['option'] as $rowopt) {
$text .= "<option value='{$rowopt['value']}'>{$rowopt['name']}</option>";
echo "<option value='{$rowopt['value']}'".($rowopt['value'] == $value?" selected=\"selected\"":"").">{$rowopt['name']}</option>\n";
@@ -1138,7 +1139,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) {
if (is_array($value)) {
$values = $value;
} else {
- $values = explode(',', $value);
+ $values = explode(',', $value);
}
$ifaces["lo0"] = "loopback";
echo "<option><name></name><value></value></option>/n";
@@ -1218,7 +1219,7 @@ function parse_package_templates() {
$row_helper_data = "";
foreach ($fields['rowhelper']['rowhelperfield'] as $rowhelperfield) {
foreach ($_POST as $key => $value) {
- if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/",$key,$matches)) {
+ if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/", $key, $matches)) {
$row_helper_total_rows++;
$row_helper_data .= $value;
$sep = "";
@@ -1236,7 +1237,7 @@ function parse_package_templates() {
}
break;
default:
- $fieldname = $fields['fieldname'];
+ $fieldname = $fields['fieldname'];
$fieldvalue = $_POST[$fieldname];
$template_text = str_replace($fieldname . "_fieldvalue", $fieldvalue, $template_text);
}
@@ -1248,7 +1249,7 @@ function parse_package_templates() {
$template_text = str_replace("\\n", "\n", $template_text);
/* write out new template file */
- $fout = fopen($filename,"w");
+ $fout = fopen($filename, "w");
fwrite($fout, $template_text);
fclose($fout);
}
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php
index 8979a08..ed4d717 100644
--- a/usr/local/www/pkg_mgr.php
+++ b/usr/local/www/pkg_mgr.php
@@ -56,7 +56,7 @@ date_default_timezone_set($timezone);
/* if upgrade in progress, alert user */
if (is_subsystem_dirty('packagelock')) {
- $pgtitle = array(gettext("System"),gettext("Package Manager"));
+ $pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n";
include("fbegin.inc");
@@ -68,8 +68,8 @@ if (is_subsystem_dirty('packagelock')) {
}
function domTT_title($title_msg) {
if (!empty($title_msg)) {
- $title_msg=preg_replace("/\s+/"," ",$title_msg);
- $title_msg=preg_replace("/'/","\'",$title_msg);
+ $title_msg = preg_replace("/\s+/", " ", $title_msg);
+ $title_msg = preg_replace("/'/", "\'", $title_msg);
echo "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\"";
}
}
@@ -104,7 +104,7 @@ if (!empty($_GET)) {
}
$closehead = false;
-$pgtitle = array(gettext("System"),gettext("Package Manager"));
+$pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
?>
@@ -152,18 +152,18 @@ include("head.inc");
natcasesort($pkg_keys);
//Check categories
- $categories=array();
+ $categories = array();
if (is_array($pkg_keys)) {
foreach ($pkg_keys as $key) {
$categories[$pkg_info[$key]['category']]++;
}
}
ksort($categories);
- $cm_count=0;
+ $cm_count = 0;
$tab_array = array();
- $visible_categories=array();
- $categories_min_count=($g['pkg_categories_min_count'] ? $g['pkg_categories_min_count'] : 3);
- $categories_max_display=($g['pkg_categories_max_display'] ? $g['pkg_categories_max_display'] : 6);
+ $visible_categories = array();
+ $categories_min_count = ($g['pkg_categories_min_count'] ? $g['pkg_categories_min_count'] : 3);
+ $categories_max_display = ($g['pkg_categories_max_display'] ? $g['pkg_categories_max_display'] : 6);
/* check selected category or define default category to show */
if (isset($_REQUEST['category'])) {
@@ -177,15 +177,15 @@ include("head.inc");
$menu_category = (isset($_REQUEST['category']) ? $_REQUEST['category'] : "All");
$show_category = ($menu_category == "Other" || $menu_category == "All");
- $tab_array[] = array(gettext("All"), $menu_category=="All" ? true : false, "pkg_mgr.php?category=All");
+ $tab_array[] = array(gettext("All"), $menu_category == "All" ? true : false, "pkg_mgr.php?category=All");
foreach ($categories as $category => $c_count) {
if ($c_count >= $categories_min_count && $cm_count <= $categories_max_display) {
- $tab_array[] = array(gettext($category) , $menu_category==$category ? true : false, "pkg_mgr.php?category={$category}");
+ $tab_array[] = array(gettext($category) , $menu_category == $category ? true : false, "pkg_mgr.php?category={$category}");
$visible_categories[]=$category;
$cm_count++;
}
}
- $tab_array[] = array(gettext("Other Categories"), $menu_category=="Other" ? true : false, "pkg_mgr.php?category=Other");
+ $tab_array[] = array(gettext("Other Categories"), $menu_category == "Other" ? true : false, "pkg_mgr.php?category=Other");
if (count($categories) > 1) {
display_top_tabs($tab_array);
}
@@ -219,7 +219,7 @@ include("head.inc");
}
/* get history/changelog git dir */
- $commit_dir=explode("/",$index['config_file']);
+ $commit_dir = explode("/", $index['config_file']);
$changeloglink = "https://github.com/pfsense/pfsense-packages/commits/master/config/";
if ($commit_dir[(count($commit_dir)-2)] == "config") {
$changeloglink .= $commit_dir[(count($commit_dir)-1)];
@@ -236,7 +236,7 @@ include("head.inc");
$pkginfo=gettext("No package info, check the forum");
}
- if ($menu_category == "All" || $index['category'] == $menu_category || ($menu_category == "Other" && !in_array($index['category'],$visible_categories))):
+ if ($menu_category == "All" || $index['category'] == $menu_category || ($menu_category == "Other" && !in_array($index['category'], $visible_categories))):
?>
<tr valign="top" class="<?= $index['category'] ?>">
<td class="listlr" <?=domTT_title(gettext("Click on package name to access its website."))?>>
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index ceb4f75..8a57555 100644
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -55,7 +55,7 @@ $static_output = "";
$static_status = "";
$sendto = "output";
-$pgtitle = array(gettext("System"),gettext("Package Manager"),gettext("Install Package"));
+$pgtitle = array(gettext("System"), gettext("Package Manager"), gettext("Install Package"));
include("head.inc");
if ($_POST) {
diff --git a/usr/local/www/pkg_mgr_installed.php b/usr/local/www/pkg_mgr_installed.php
index 119df9c..e190fec 100644
--- a/usr/local/www/pkg_mgr_installed.php
+++ b/usr/local/www/pkg_mgr_installed.php
@@ -50,7 +50,7 @@ date_default_timezone_set($timezone);
/* if upgrade in progress, alert user */
if (is_subsystem_dirty('packagelock')) {
- $pgtitle = array(gettext("System"),gettext("Package Manager"));
+ $pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n";
include("fbegin.inc");
@@ -63,8 +63,8 @@ if (is_subsystem_dirty('packagelock')) {
function domTT_title($title_msg, $return="echo") {
if (!empty($title_msg)) {
- $title_msg=preg_replace("/\s+/"," ",$title_msg);
- $title_msg=preg_replace("/'/","\'",$title_msg);
+ $title_msg = preg_replace("/\s+/", " ", $title_msg);
+ $title_msg = preg_replace("/'/", "\'", $title_msg);
$title= "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\"";
if ($return =="echo") {
echo $title;
@@ -77,10 +77,10 @@ if (is_array($config['installedpackages']['package'])) {
foreach ($config['installedpackages']['package'] as $instpkg) {
$tocheck[] = $instpkg['name'];
}
- $currentvers = get_pkg_info($tocheck, array('version', 'xmlver', 'pkginfolink','descr'));
+ $currentvers = get_pkg_info($tocheck, array('version', 'xmlver', 'pkginfolink', 'descr'));
}
$closehead = false;
-$pgtitle = array(gettext("System"),gettext("Package Manager"));
+$pgtitle = array(gettext("System"), gettext("Package Manager"));
include("head.inc");
?>
@@ -148,8 +148,8 @@ include("head.inc");
}
// get history/changelog git dir
- $commit_dir=explode("/",$pkg['config_file']);
- $changeloglink ="https://github.com/pfsense/pfsense-packages/commits/master/config/".$commit_dir[(count($commit_dir)-2)];
+ $commit_dir = explode("/", $pkg['config_file']);
+ $changeloglink = "https://github.com/pfsense/pfsense-packages/commits/master/config/" . $commit_dir[(count($commit_dir)-2)];
#check package version
$latest_package = $currentvers[$pkg['name']]['version'];
if ($latest_package) {
@@ -157,21 +157,21 @@ include("head.inc");
if (strcmp($pkg['version'], $latest_package) > 0) {
$tdclass = "listbggrey";
if ($g['disablepackagehistory']) {
- $pkgver = "<a>".gettext("Available") .": ". $latest_package . "<br />";
+ $pkgver = "<a>" . gettext("Available") . ": " . $latest_package . "<br />";
} else {
- $pkgver = "<a target='_blank' href='$changeloglink'>".gettext("Available") .": ". $latest_package . "<br />";
+ $pkgver = "<a target='_blank' href='$changeloglink'>" . gettext("Available") . ": " . $latest_package . "<br />";
}
- $pkgver .= gettext("Installed") .": ". $pkg['version']. "</a>";
+ $pkgver .= gettext("Installed") . ": " . $pkg['version'] . "</a>";
}
// we're running an older version of the package
if (strcmp($pkg['version'], $latest_package) < 0) {
$tdclass = "listbg";
if ($g['disablepackagehistory']) {
- $pkgver = "<a><font color='#ffffff'>" . gettext("Available") .": ". $latest_package . "</font><br />";
+ $pkgver = "<a><font color='#ffffff'>" . gettext("Available") . ": " . $latest_package . "</font><br />";
} else {
- $pkgver = "<a target='_blank' href='$changeloglink'><font color='#ffffff'>" . gettext("Available") .": ". $latest_package . "<br />";
+ $pkgver = "<a target='_blank' href='$changeloglink'><font color='#ffffff'>" . gettext("Available") . ": " . $latest_package . "<br />";
}
- $pkgver .= gettext("Installed") .": ". $pkg['version']."</font></a>";
+ $pkgver .= gettext("Installed") . ": " . $pkg['version'] . "</font></a>";
}
// we're running the current version
if (!strcmp($pkg['version'], $latest_package)) {
@@ -187,11 +187,11 @@ include("head.inc");
// unknown available package version
$tdclass = "listbg";
if ($g['disablepackagehistory']) {
- $pkgver = "<a><font color='#ffffff'>" . gettext("Latest") .": ". gettext("N/A") . "</font><br />";
+ $pkgver = "<a><font color='#ffffff'>" . gettext("Latest") . ": " . gettext("N/A") . "</font><br />";
} else {
- $pkgver = "<a target='_blank' href='$changeloglink'><font color='#ffffff'>" . gettext("Latest") .": ". gettext("N/A") . "<br />";
+ $pkgver = "<a target='_blank' href='$changeloglink'><font color='#ffffff'>" . gettext("Latest") . ": " . gettext("N/A") . "<br />";
}
- $pkgver .= gettext("Installed") .": ". $pkg['version']."</font></a>";
+ $pkgver .= gettext("Installed") . ": " . $pkg['version'] . "</font></a>";
$pkgdescr = $pkg['descr'];
}
/* Check package info link */
@@ -215,10 +215,10 @@ include("head.inc");
if (isset($g['disablepackagehistory'])) {
echo "<td class='{$tdclass}'>{$pkgver}</td>";
} else {
- echo "<td class='{$tdclass}' ".domTT_title(gettext("Click on ".ucfirst($pkg['name'])." version to check its change log."),"return").">{$pkgver}</td>";
+ echo "<td class='{$tdclass}' " . domTT_title(gettext("Click on " . ucfirst($pkg['name']) . " version to check its change log."), "return").">{$pkgver}</td>";
}
?>
- <td class="listbg" style="overflow:hidden; text-align:justify;" <?=domTT_title(gettext("Click package info for more details about ".ucfirst($pkg['name'])." package."))?>>
+ <td class="listbg" style="overflow:hidden; text-align:justify;" <?=domTT_title(gettext("Click package info for more details about " . ucfirst($pkg['name']) . " package."))?>>
<?=$pkgdescr;?>
<?php if (!$g['disablepackageinfo']): ?>
<br /><br />
@@ -227,14 +227,14 @@ include("head.inc");
</td>
<td valign="middle" class="list nowrap">
<a href="pkg_mgr_install.php?mode=delete&amp;pkg=<?= $pkg['name']; ?>">
- <img <?=domTT_title(gettext("Remove ".ucfirst($pkg['name'])." package."))?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
+ <img <?=domTT_title(gettext("Remove " . ucfirst($pkg['name']) . " package."))?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
</a>
<br />
<a href="pkg_mgr_install.php?mode=reinstallpkg&amp;pkg=<?= $pkg['name']; ?>">
- <img <?=domTT_title(gettext("Reinstall ".ucfirst($pkg['name'])." package."));?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_pkg.gif" width="17" height="17" border="0" alt="reinstall" />
+ <img <?=domTT_title(gettext("Reinstall " . ucfirst($pkg['name']) . " package."));?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_pkg.gif" width="17" height="17" border="0" alt="reinstall" />
</a>
<a href="pkg_mgr_install.php?mode=reinstallxml&amp;pkg=<?= $pkg['name']; ?>">
- <img <?=domTT_title(gettext("Reinstall ".ucfirst($pkg['name'])."'s GUI components."));?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_xml.gif" width="17" height="17" border="0" alt="reinstall" />
+ <img <?=domTT_title(gettext("Reinstall " . ucfirst($pkg['name']) . "'s GUI components."));?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_xml.gif" width="17" height="17" border="0" alt="reinstall" />
</a>
</td>
</tr>
diff --git a/usr/local/www/pkg_mgr_settings.php b/usr/local/www/pkg_mgr_settings.php
index 39ef58c..040f789 100644
--- a/usr/local/www/pkg_mgr_settings.php
+++ b/usr/local/www/pkg_mgr_settings.php
@@ -60,7 +60,7 @@ if ($_POST) {
$curcfg = $config['system']['altpkgrepo'];
$closehead = false;
-$pgtitle = array(gettext("System"),gettext("Package Settings"));
+$pgtitle = array(gettext("System"), gettext("Package Settings"));
include("head.inc");
?>
<script type="text/javascript">
@@ -138,7 +138,7 @@ function enable_altpkgrepourl(enable_over) {
</tr>
</table>
<span class="vexpl">
- <?php printf(gettext("This is where %s will check for packages when the"),$g['product_name']);?> <a href="pkg_mgr.php"><?=gettext("System: Packages");?></a> <?=gettext("page is viewed.");?>
+ <?php printf(gettext("This is where %s will check for packages when the"), $g['product_name']);?> <a href="pkg_mgr.php"><?=gettext("System: Packages");?></a> <?=gettext("page is viewed.");?>
</span>
</td>
</tr>
diff --git a/usr/local/www/reboot.php b/usr/local/www/reboot.php
index 6025648..3a986ac 100755
--- a/usr/local/www/reboot.php
+++ b/usr/local/www/reboot.php
@@ -46,7 +46,7 @@ if ($_POST['Submit'] == " " . gettext("No") . " ") {
exit;
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Reboot System"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Reboot System"));
include("head.inc");
?>
@@ -56,7 +56,7 @@ include("head.inc");
<meta http-equiv=\"refresh\" content=\"70;url=/\">
<?php print_info_box(gettext("The system is rebooting now. This may take one minute.")); ?>
<pre>
-<?php system_reboot(); ?>
+<?php system_reboot(); ?>
</pre>
<?php else: ?>
<form action="reboot.php" method="post">
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 4c3874e..58da087 100644
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -1063,9 +1063,9 @@ function enable_change(enable_change) {
$macformats = array("singledash", "ietf", "cisco", "unformatted");
foreach ($macformats as $macformat) {
if ($pconfig['radmac_format'] == $macformat) {
- echo "<option selected=\"selected\" value=\"$macformat\">",gettext($macformat),"</option>\n";
+ echo "<option selected=\"selected\" value=\"$macformat\">", gettext($macformat), "</option>\n";
} else {
- echo "<option value=\"$macformat\">",gettext($macformat),"</option>\n";
+ echo "<option value=\"$macformat\">", gettext($macformat), "</option>\n";
}
}
?>
@@ -1136,7 +1136,7 @@ function enable_change(enable_change) {
$port = $pconfig['listenporthttps'] ? $pconfig['listenporthttps'] : ($zoneid + 8001);
$href = "https://{$host}:{$port}";
} else {
- $port = $pconfig['listenporthttp'] ? $pconfig['listenporthttp'] : ($zoneid + 8000);
+ $port = $pconfig['listenporthttp'] ? $pconfig['listenporthttp'] : ($zoneid + 8000);
$href = "http://{$host}:{$port}";
}
?>
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index d6fe66a..d6c1af3 100644
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -129,7 +129,7 @@ if ($_POST) {
write_config();
echo gettext("The entry was successfully deleted") . "\n";
} else {
- echo gettext("No entry exists for this mac address:") . " " . $_POST['delmac'] . "\n";
+ echo gettext("No entry exists for this mac address:") . " " . $_POST['delmac'] . "\n";
}
}
exit;
@@ -182,7 +182,7 @@ include("head.inc");
<td class="tabcont">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main">
<tr>
- <td width="3%" class="list"></td>
+ <td width="3%" class="list"></td>
<td width="37%" class="listhdrr"><?=gettext("MAC address"); ?></td>
<td width="50%" class="listhdr"><?=gettext("Description"); ?></td>
<td width="10%" class="list"></td>
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index 82477b5..decea80 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -241,10 +241,10 @@ if ($_POST) {
if ($_POST['charset'] && (strlen($_POST['charset'] < 2))) {
$input_errors[] = gettext("Need at least 2 characters to create vouchers.");
}
- if ($_POST['charset'] && (strpos($_POST['charset'], "\"")>0)) {
+ if ($_POST['charset'] && (strpos($_POST['charset'], "\"") > 0)) {
$input_errors[] = gettext("Double quotes aren't allowed.");
}
- if ($_POST['charset'] && (strpos($_POST['charset'], ",")>0)) {
+ if ($_POST['charset'] && (strpos($_POST['charset'], ",") > 0)) {
$input_errors[] = "',' " . gettext("aren't allowed.");
}
if ($_POST['rollbits'] && (!is_numeric($_POST['rollbits']) || ($_POST['rollbits'] < 1) || ($_POST['rollbits'] > 31))) {
@@ -317,7 +317,7 @@ if ($_POST) {
$url = "http://{$newvoucher['vouchersyncdbip']}";
}
- $execcmd = <<<EOF
+ $execcmd = <<<EOF
\$toreturn = array();
\$toreturn['voucher'] = \$config['voucher']['$cpzone'];
unset(\$toreturn['vouchersyncport'], \$toreturn['vouchersyncpass'], \$toreturn['vouchersyncusername'], \$toreturn['vouchersyncdbip']);
@@ -351,7 +351,7 @@ EOF;
log_error("The Captive Portal voucher database has been synchronized with {$url}:{$port} (pfsense.exec_php).");
}
if (!$input_errors) {
- $toreturn = XML_RPC_Decode($resp->value());
+ $toreturn = XML_RPC_Decode($resp->value());
if (!is_array($toreturn)) {
if ($toreturn == "Authentication failed") {
$input_errors[] = "Could not synchronize the voucher database: Authentication Failed.";
@@ -428,7 +428,7 @@ function before_save() {
document.iform.privatekey.disabled = false;
document.iform.msgnoaccess.disabled = false;
document.iform.msgexpired.disabled = false;
- for (var x=0; x < <?php echo count($a_roll); ?>; x++) {
+ for (var x = 0; x < <?php echo count($a_roll); ?>; x++) {
jQuery('#addeditdelete' + x).show();
}
jQuery('#addnewroll').show();
@@ -459,12 +459,12 @@ function enable_change(enable_change) {
document.iform.privatekey.disabled = true;
document.iform.msgnoaccess.disabled = true;
document.iform.msgexpired.disabled = true;
- for (var x=0; x < <?php echo count($a_roll); ?>; x++) {
+ for (var x = 0; x < <?php echo count($a_roll); ?>; x++) {
jQuery('#addeditdelete' + x).hide();
}
jQuery('#addnewroll').hide();
} else {
- for (var x=0; x < <?php echo count($a_roll); ?>; x++) {
+ for (var x = 0; x < <?php echo count($a_roll); ?>; x++) {
jQuery('#addeditdelete' + x).show();
}
jQuery('#addnewroll').show();
diff --git a/usr/local/www/services_captiveportal_vouchers_edit.php b/usr/local/www/services_captiveportal_vouchers_edit.php
index 5b1afbe..0aa6a45 100644
--- a/usr/local/www/services_captiveportal_vouchers_edit.php
+++ b/usr/local/www/services_captiveportal_vouchers_edit.php
@@ -127,8 +127,8 @@ if ($_POST) {
$rollent = $a_roll[$id];
}
- $rollent['zone'] = $_POST['zone'];
- $rollent['number'] = $_POST['number'];
+ $rollent['zone'] = $_POST['zone'];
+ $rollent['number'] = $_POST['number'];
$rollent['minutes'] = $_POST['minutes'];
$rollent['descr'] = $_POST['descr'];
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index e6bdd8d..3747104 100644
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -195,7 +195,7 @@ if (isset($_POST['submit'])) {
$pconfig = $_POST;
$numberoptions = array();
- for ($x=0; $x<99; $x++) {
+ for ($x = 0; $x < 99; $x++) {
if (isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) {
$numbervalue = array();
$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php
index f89952e..51a6ada 100644
--- a/usr/local/www/services_dhcpv6.php
+++ b/usr/local/www/services_dhcpv6.php
@@ -157,7 +157,7 @@ if ($_POST) {
$pconfig = $_POST;
$numberoptions = array();
- for ($x=0; $x<99; $x++) {
+ for ($x = 0; $x < 99; $x++) {
if (isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) {
$numbervalue = array();
$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
diff --git a/usr/local/www/services_dhcpv6_edit.php b/usr/local/www/services_dhcpv6_edit.php
index aea880d..e581f20 100644
--- a/usr/local/www/services_dhcpv6_edit.php
+++ b/usr/local/www/services_dhcpv6_edit.php
@@ -148,7 +148,7 @@ if ($_POST) {
continue;
}
- if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname']) || ($mapent['duid'] == $_POST['duid'])) {
+ if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname']) || ($mapent['duid'] == $_POST['duid'])) {
$input_errors[] = gettext("This Hostname, IP or DUID already exists.");
break;
}
diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php
index 638eeff..d89a896 100644
--- a/usr/local/www/services_dnsmasq.php
+++ b/usr/local/www/services_dnsmasq.php
@@ -222,7 +222,7 @@ function show_advanced_dns() {
" their hostname when requesting a DHCP lease will be registered".
" in the DNS forwarder, so that their name can be resolved.".
" You should also set the domain in %sSystem:".
- " General setup%s to the proper value."),'<a href="system.php">','</a>')?>
+ " General setup%s to the proper value."), '<a href="system.php">', '</a>')?>
</p>
</td>
</tr>
@@ -237,7 +237,7 @@ function show_advanced_dns() {
<?php printf(gettext("If this option is set, then DHCP static mappings will ".
"be registered in the DNS forwarder, so that their name can be ".
"resolved. You should also set the domain in %s".
- "System: General setup%s to the proper value."),'<a href="system.php">','</a>');?>
+ "System: General setup%s to the proper value."), '<a href="system.php">', '</a>');?>
</p>
</td>
</tr>
@@ -383,7 +383,7 @@ function show_advanced_dns() {
" is checked. If you don't use that option (or if you use".
" a static IP address on WAN), you must manually specify at".
" least one DNS server on the %sSystem:".
- "General setup%s page."),'<a href="system.php">','</a>','<a href="system.php">','</a>');?><br />
+ "General setup%s page."), '<a href="system.php">', '</a>', '<a href="system.php">', '</a>');?><br />
</span>
</p>
diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php
index 4bd1d1e..a619ce9 100644
--- a/usr/local/www/services_dyndns_edit.php
+++ b/usr/local/www/services_dyndns_edit.php
@@ -467,7 +467,7 @@ function _onTypeChange(type) {
</span>
<?php printf(gettext("You must configure a DNS server in %sSystem:
General setup%s or allow the DNS server list to be overridden
- by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system.php">','</a>');?>
+ by DHCP/PPP on WAN for dynamic DNS updates to work."), '<a href="system.php">', '</a>');?>
</span>
</td>
</tr>
diff --git a/usr/local/www/services_igmpproxy_edit.php b/usr/local/www/services_igmpproxy_edit.php
index 935bf49..2d299c0 100644
--- a/usr/local/www/services_igmpproxy_edit.php
+++ b/usr/local/www/services_igmpproxy_edit.php
@@ -92,7 +92,7 @@ if ($_POST) {
$address = "";
$isfirst = 0;
/* item is a normal igmpentry type */
- for ($x=0; $x<4999; $x++) {
+ for ($x = 0; $x < 4999; $x++) {
if ($_POST["address{$x}"] <> "") {
if ($isfirst > 0) {
$address .= " ";
@@ -203,15 +203,15 @@ include("head.inc");
</select>
<br />
<span class="vexpl">
- <?=gettext("The <b>upstream</b> network interface is the outgoing interface which is".
- " responsible for communicating to available multicast data sources.".
+ <?=gettext("The <b>upstream</b> network interface is the outgoing interface which is" .
+ " responsible for communicating to available multicast data sources." .
" There can only be one upstream interface.");?>
</span>
<br />
<span class="vexpl">
<b><?=gettext("Downstream"); ?></b>
- <?=gettext("network interfaces are the distribution interfaces to the".
- " destination networks, where multicast clients can join groups and".
+ <?=gettext("network interfaces are the distribution interfaces to the" .
+ " destination networks, where multicast clients can join groups and" .
" receive multicast data. One or more downstream interfaces must be configured.");?>
</span>
</td>
@@ -222,8 +222,8 @@ include("head.inc");
<input name="threshold" class="formfld unknown" id="threshold" value="<?php echo htmlspecialchars($pconfig['threshold']);?>" />
<br />
<span class="vexpl">
- <?=gettext("Defines the TTL threshold for the network interface. Packets".
- " with a lower TTL than the threshold value will be ignored. This".
+ <?=gettext("Defines the TTL threshold for the network interface. Packets" .
+ " with a lower TTL than the threshold value will be ignored. This" .
" setting is optional, and by default the threshold is 1.");?>
</span>
</td>
diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php
index 6c3a8c2..686ca27 100644
--- a/usr/local/www/services_rfc2136_edit.php
+++ b/usr/local/www/services_rfc2136_edit.php
@@ -265,7 +265,7 @@ include("head.inc");
</span>
<?php printf(gettext("You must configure a DNS server in %sSystem: " .
"General setup %sor allow the DNS server list to be overridden " .
- "by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system.php">', '</a>');?>
+ "by DHCP/PPP on WAN for dynamic DNS updates to work."), '<a href="system.php">', '</a>');?>
</span>
</td>
</tr>
diff --git a/usr/local/www/services_unbound_acls.php b/usr/local/www/services_unbound_acls.php
index b97a05f..092d641 100644
--- a/usr/local/www/services_unbound_acls.php
+++ b/usr/local/www/services_unbound_acls.php
@@ -91,7 +91,7 @@ if ($_POST) {
} else {
// input validation - only allow 50 entries in a single ACL
- for ($x=0; $x<50; $x++) {
+ for ($x = 0; $x < 50; $x++) {
if (isset($pconfig["acl_network{$x}"])) {
$networkacl[$x] = array();
$networkacl[$x]['acl_network'] = $pconfig["acl_network{$x}"];
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index 21bf790..66481bf 100644
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -148,7 +148,7 @@ include("head.inc");
<td width="78%" class="vtable">
<input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($pconfig['mac']);?>" />
<br />
- <span class="vexpl"><?=gettext("Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx");?></span>
+ <span class="vexpl"><?=gettext("Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx");?></span>
</td>
</tr>
<tr>
diff --git a/usr/local/www/shortcuts.inc b/usr/local/www/shortcuts.inc
index d1b1d2b..c4bf48e 100644
--- a/usr/local/www/shortcuts.inc
+++ b/usr/local/www/shortcuts.inc
@@ -145,14 +145,14 @@ function get_shortcut_log_link($shortcut_section, $addspace = true) {
// Load shortcuts
$dir_array = get_shortcut_files("/usr/local/www/shortcuts");
foreach ($dir_array as $file) {
- if (!is_dir("/usr/local/www/shortcuts/{$file}") && stristr($file,".inc")) {
+ if (!is_dir("/usr/local/www/shortcuts/{$file}") && stristr($file, ".inc")) {
include("/usr/local/www/shortcuts/{$file}");
}
}
if (is_dir("/usr/local/pkg/shortcuts")) {
$dir_array = get_shortcut_files("/usr/local/pkg/shortcuts");
foreach ($dir_array as $file) {
- if (!is_dir("/usr/local/pkg/shortcuts/{$file}") && stristr($file,".inc")) {
+ if (!is_dir("/usr/local/pkg/shortcuts/{$file}") && stristr($file, ".inc")) {
include("/usr/local/pkg/shortcuts/{$file}");
}
}
diff --git a/usr/local/www/status.php b/usr/local/www/status.php
index 5248659..b15edc3 100755
--- a/usr/local/www/status.php
+++ b/usr/local/www/status.php
@@ -67,7 +67,7 @@ function doCmdT($title, $command) {
/* Fixup output directory */
$rubbish = array('|', '-', '/', '.', ' '); /* fixes the <a> tag to be W3C compliant */
- echo "\n<a name=\"" . str_replace($rubbish,'',$title) . "\" id=\"" . str_replace($rubbish,'',$title) . "\"></a>\n";
+ echo "\n<a name=\"" . str_replace($rubbish, '', $title) . "\" id=\"" . str_replace($rubbish, '', $title) . "\"></a>\n";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"" . $title . "\">\n";
echo "\t<tr><td class=\"listtopic\">" . $title . "</td></tr>\n";
echo "\t<tr>\n\t\t<td class=\"listlr\">\n\t\t\t<pre>"; /* no newline after pre */
@@ -95,7 +95,7 @@ function doCmdT($title, $command) {
$line = preg_replace("/<crypto_password>.*?<\\/crypto_password>/", "<crypto_password>xxxxx</crypto_password>", $line);
$line = preg_replace("/<crypto_password2>.*?<\\/crypto_password2>/", "<crypto_password2>xxxxx</crypto_password2>", $line);
$line = str_replace("\t", " ", $line);
- echo htmlspecialchars($line,ENT_NOQUOTES);
+ echo htmlspecialchars($line, ENT_NOQUOTES);
fwrite($ofd, $line);
}
}
@@ -110,7 +110,7 @@ function doCmdT($title, $command) {
if ($i > 0) {
echo "\n";
}
- echo htmlspecialchars($execOutput[$i],ENT_NOQUOTES);
+ echo htmlspecialchars($execOutput[$i], ENT_NOQUOTES);
fwrite($ofd, $execOutput[$i] . "\n");
}
fclose($ofd);
@@ -122,7 +122,7 @@ function doCmdT($title, $command) {
/* Define a command, with a title, to be executed later. */
function defCmdT($title, $command) {
global $commands;
- $title = htmlspecialchars($title,ENT_NOQUOTES);
+ $title = htmlspecialchars($title, ENT_NOQUOTES);
$commands[] = array($title, $command);
}
@@ -132,8 +132,8 @@ function listCmds() {
$rubbish = array('|', '-', '/', '.', ' '); /* fixes the <a> tag to be W3C compliant */
echo "\n<p>" . gettext("This status page includes the following information") . ":\n";
echo "<ul>\n";
- for ($i = 0; isset($commands[$i]); $i++ ) {
- echo "\t<li><strong><a href=\"#" . str_replace($rubbish,'',$commands[$i][0]) . "\">" . $commands[$i][0] . "</a></strong></li>\n";
+ for ($i = 0; isset($commands[$i]); $i++) {
+ echo "\t<li><strong><a href=\"#" . str_replace($rubbish, '', $commands[$i][0]) . "\">" . $commands[$i][0] . "</a></strong></li>\n";
}
echo "</ul>\n";
}
@@ -141,7 +141,7 @@ function listCmds() {
/* Execute all of the commands which were defined by a call to defCmd. */
function execCmds() {
global $commands;
- for ($i = 0; isset($commands[$i]); $i++ ) {
+ for ($i = 0; isset($commands[$i]); $i++) {
doCmdT($commands[$i][0], $commands[$i][1]);
}
}
@@ -151,35 +151,35 @@ global $g, $config;
/* Set up all of the commands we want to execute. */
/* System stats/info */
-defCmdT("System uptime","/usr/bin/uptime");
-defCmdT("Interfaces","/sbin/ifconfig -a");
+defCmdT("System uptime", "/usr/bin/uptime");
+defCmdT("Interfaces", "/sbin/ifconfig -a");
defCmdT("Top Process Info", "/usr/bin/top | /usr/bin/head -n5");
-defCmdT("Processes","/bin/ps xauww");
+defCmdT("Processes", "/bin/ps xauww");
defCmdT("Mounted Filesystems", "/sbin/mount");
-defCmdT("Free Disk Space","/bin/df -hi");
-defCmdT("Routing tables","/usr/bin/netstat -nWr");
-defCmdT("Mbuf Usage","/usr/bin/netstat -mb");
+defCmdT("Free Disk Space", "/bin/df -hi");
+defCmdT("Routing tables", "/usr/bin/netstat -nWr");
+defCmdT("Mbuf Usage", "/usr/bin/netstat -mb");
defCmdT("VMStat", "/usr/bin/vmstat -afimsz");
/* Firewall rules and info */
-defCmdT("Generated Ruleset","/bin/cat {$g['tmp_path']}/rules.debug");
-defCmdT("Generated Ruleset Limiters","/bin/cat {$g['tmp_path']}/rules.limiter");
-defCmdT("Generated Ruleset Limits","/bin/cat {$g['tmp_path']}/rules.limits");
+defCmdT("Generated Ruleset", "/bin/cat {$g['tmp_path']}/rules.debug");
+defCmdT("Generated Ruleset Limiters", "/bin/cat {$g['tmp_path']}/rules.limiter");
+defCmdT("Generated Ruleset Limits", "/bin/cat {$g['tmp_path']}/rules.limits");
defCmdT("pf NAT Rules", "/sbin/pfctl -vvsn");
defCmdT("pf Firewall Rules", "/sbin/pfctl -vvsr");
-defCmdT("pf Tables","/sbin/pfctl -vs Tables");
+defCmdT("pf Tables", "/sbin/pfctl -vs Tables");
defCmdT("pf State Table Contents", "/sbin/pfctl -ss");
defCmdT("pf Info", "/sbin/pfctl -si");
defCmdT("pf Show All", "/sbin/pfctl -sa");
-defCmdT("pf Queues","/sbin/pfctl -s queue -v");
-defCmdT("pf OSFP","/sbin/pfctl -s osfp");
-defCmdT("pfsync stats","/usr/bin/netstat -s -ppfsync");
-defCmdT("pftop Default","/usr/local/sbin/pftop -a -b");
-defCmdT("pftop Long","/usr/local/sbin/pftop -w 150 -a -b -v long");
-defCmdT("pftop Queue","/usr/local/sbin/pftop -w 150 -a -b -v queue");
-defCmdT("pftop Rules","/usr/local/sbin/pftop -w 150 -a -b -v rules");
-defCmdT("pftop Size","/usr/local/sbin/pftop -w 150 -a -b -v size");
-defCmdT("pftop Speed","/usr/local/sbin/pftop -w 150 -a -b -v speed");
+defCmdT("pf Queues", "/sbin/pfctl -s queue -v");
+defCmdT("pf OSFP", "/sbin/pfctl -s osfp");
+defCmdT("pfsync stats", "/usr/bin/netstat -s -ppfsync");
+defCmdT("pftop Default", "/usr/local/sbin/pftop -a -b");
+defCmdT("pftop Long", "/usr/local/sbin/pftop -w 150 -a -b -v long");
+defCmdT("pftop Queue", "/usr/local/sbin/pftop -w 150 -a -b -v queue");
+defCmdT("pftop Rules", "/usr/local/sbin/pftop -w 150 -a -b -v rules");
+defCmdT("pftop Size", "/usr/local/sbin/pftop -w 150 -a -b -v size");
+defCmdT("pftop Speed", "/usr/local/sbin/pftop -w 150 -a -b -v speed");
if (isset($config['captiveportal']) && is_array($config['captiveportal'])) {
foreach ($config['captiveportal'] as $cpZone => $cpdata) {
if (isset($cpdata['enable'])) {
@@ -191,14 +191,14 @@ if (isset($config['captiveportal']) && is_array($config['captiveportal'])) {
/* Configuration Files */
defCmdT("Contents of /var/run", "/bin/ls /var/run");
defCmdT("Contents of /conf", "/bin/ls /conf");
-defCmdT("config.xml","dumpconfigxml");
-defCmdT("resolv.conf","/bin/cat /etc/resolv.conf");
-defCmdT("DHCP Configuration","/bin/cat /var/dhcpd/etc/dhcpd.conf");
-defCmdT("DHCPv6 Configuration","/bin/cat /var/dhcpd/etc/dhcpdv6.conf");
-defCmdT("strongSwan config","/bin/cat /var/etc/ipsec/strongswan.conf");
-defCmdT("IPsec config","/bin/cat /var/etc/ipsec/ipsec.conf");
-defCmdT("SPD","/sbin/setkey -DP");
-defCmdT("SAD","/sbin/setkey -D");
+defCmdT("config.xml", "dumpconfigxml");
+defCmdT("resolv.conf", "/bin/cat /etc/resolv.conf");
+defCmdT("DHCP Configuration", "/bin/cat /var/dhcpd/etc/dhcpd.conf");
+defCmdT("DHCPv6 Configuration", "/bin/cat /var/dhcpd/etc/dhcpdv6.conf");
+defCmdT("strongSwan config", "/bin/cat /var/etc/ipsec/strongswan.conf");
+defCmdT("IPsec config", "/bin/cat /var/etc/ipsec/ipsec.conf");
+defCmdT("SPD", "/sbin/setkey -DP");
+defCmdT("SAD", "/sbin/setkey -D");
if (file_exists("/cf/conf/upgrade_log.txt")) {
defCmdT("Upgrade Log", "/bin/cat /cf/conf/upgrade_log.txt");
}
@@ -217,24 +217,24 @@ if (file_exists("/var/etc/apinger.conf")) {
if (file_exists("/var/etc/filterdns.conf")) {
defCmdT("Filter DNS Daemon Config", "/bin/cat /var/etc/filterdns.conf");
}
-if(isset($config['system']['usefifolog'])) {
- defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
- defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
+if (isset($config['system']['usefifolog'])) {
+ defCmdT("last 200 system log entries", "/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
+ defCmdT("last 50 filter log entries", "/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
} else {
- defCmdT("last 200 system log entries","/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
- defCmdT("last 50 filter log entries","/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
+ defCmdT("last 200 system log entries", "/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
+ defCmdT("last 50 filter log entries", "/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
}
if (file_exists("/tmp/PHP_errors.log")) {
defCmdT("PHP Error Log", "/bin/cat /tmp/PHP_errors.log");
}
-defCmdT("System Message Buffer","/sbin/dmesg -a");
-defCmdT("System Message Buffer (Boot)","/bin/cat /var/log/dmesg.boot");
-defCmdT("sysctl values","/sbin/sysctl -a");
+defCmdT("System Message Buffer", "/sbin/dmesg -a");
+defCmdT("System Message Buffer (Boot)", "/bin/cat /var/log/dmesg.boot");
+defCmdT("sysctl values", "/sbin/sysctl -a");
exec("/bin/date", $dateOutput, $dateStatus);
$currentDate = $dateOutput[0];
-$pgtitle = array("{$g['product_name']}","status");
+$pgtitle = array("{$g['product_name']}", "status");
include("head.inc");
?>
@@ -267,7 +267,7 @@ pre {
<?=gettext("Saving output to archive...");?>
<?php
if (is_dir($output_path)) {
- mwexec("/usr/bin/tar czpf " . escapeshellarg($output_file) . " -C " . escapeshellarg(dirname($output_path)) . " " . escapeshellarg(basename($output_path)));
+ mwexec("/usr/bin/tar czpf " . escapeshellarg($output_file) . " -C " . escapeshellarg(dirname($output_path)) . " " . escapeshellarg(basename($output_path)));
unlink_if_exists("{$output_path}/*");
@rmdir($output_path);
}
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php
index 769b755..d88a452 100644
--- a/usr/local/www/status_captiveportal.php
+++ b/usr/local/www/status_captiveportal.php
@@ -141,7 +141,7 @@ $mac_man = load_mac_manufacturer_table();
</td>
<td class="vncell" width="30%" align="center">
<?php
- if (count($a_cp) > 1) {
+ if (count($a_cp) > 1) {
?>
<form action="status_captiveportal.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<select name="zone" class="formselect" onchange="document.form1.submit()">
diff --git a/usr/local/www/status_captiveportal_expire.php b/usr/local/www/status_captiveportal_expire.php
index c4233d9..7d786b4 100644
--- a/usr/local/www/status_captiveportal_expire.php
+++ b/usr/local/www/status_captiveportal_expire.php
@@ -109,7 +109,7 @@ if ($_POST) {
if ($_POST['vouchers']) {
$result = voucher_expire($_POST['vouchers']);
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" summary=\"results\">\n";
- if ( $result) {
+ if ($result) {
echo "<tr><td bgcolor=\"#D9DEE8\"><img src=\"/themes/{$g['theme']}/images/icons/icon_pass.gif\" alt=\"pass\" /></td>";
echo "<td bgcolor=\"#D9DEE8\">Success</td></tr>";
} else {
diff --git a/usr/local/www/status_captiveportal_test.php b/usr/local/www/status_captiveportal_test.php
index d13578d..2a3dfc3 100644
--- a/usr/local/www/status_captiveportal_test.php
+++ b/usr/local/www/status_captiveportal_test.php
@@ -45,8 +45,9 @@ require("captiveportal.inc");
require_once("voucher.inc");
$cpzone = $_GET['zone'];
-if (isset($_POST['zone']))
+if (isset($_POST['zone'])) {
$cpzone = $_POST['zone'];
+}
if (empty($cpzone)) {
header("Location: services_captiveportal_zones.php");
diff --git a/usr/local/www/status_captiveportal_voucher_rolls.php b/usr/local/www/status_captiveportal_voucher_rolls.php
index feada71..512356b 100644
--- a/usr/local/www/status_captiveportal_voucher_rolls.php
+++ b/usr/local/www/status_captiveportal_voucher_rolls.php
@@ -102,9 +102,9 @@ include("head.inc");
<?php
$voucherlck = lock("vouche{$cpzone}r");
$i = 0;
- foreach($a_roll as $rollent):
+ foreach ($a_roll as $rollent):
$used = voucher_used_count($rollent['number']);
- $active = count(voucher_read_active_db($rollent['number']),$rollent['minutes']);
+ $active = count(voucher_read_active_db($rollent['number']), $rollent['minutes']);
$ready = $rollent['count'] - $used;
/* used also count active vouchers, remove them */
$used = $used - $active;
diff --git a/usr/local/www/status_captiveportal_vouchers.php b/usr/local/www/status_captiveportal_vouchers.php
index e8cf0a8..a7ab959 100644
--- a/usr/local/www/status_captiveportal_vouchers.php
+++ b/usr/local/www/status_captiveportal_vouchers.php
@@ -73,7 +73,7 @@ $a_roll = $config['voucher'][$cpzone]['roll'];
$db = array();
-foreach($a_roll as $rollent) {
+foreach ($a_roll as $rollent) {
$roll = $rollent['number'];
$minutes = $rollent['minutes'];
@@ -83,7 +83,7 @@ foreach($a_roll as $rollent) {
$active_vouchers = file("{$g['vardb_path']}/voucher_{$cpzone}_active_$roll.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($active_vouchers as $voucher => $line) {
- list($voucher,$timestamp, $minutes) = explode(",", $line);
+ list($voucher, $timestamp, $minutes) = explode(",", $line);
$remaining = (($timestamp + 60*$minutes) - time());
if ($remaining > 0) {
$dbent[0] = $voucher;
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index 7755dc5..4c37f21 100644
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -47,7 +47,7 @@
require("guiconfig.inc");
require_once("config.inc");
-$pgtitle = array(gettext("Status"),gettext("DHCP leases"));
+$pgtitle = array(gettext("Status"), gettext("DHCP leases"));
$shortcut_section = "dhcp";
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
@@ -60,7 +60,7 @@ if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
/* $leases_contents has the lines of the file, including the newline char at the end of each line. */
$leases_contents = file($leasesfile);
$newleases_contents = array();
- $i=0;
+ $i = 0;
while ($i < count($leases_contents)) {
/* Find the lease(s) we want to delete */
if ($leases_contents[$i] == "lease {$_GET['deleteip']} {\n") {
@@ -116,12 +116,11 @@ function adjust_gmt($dt) {
return $dt;
}
-function remove_duplicate($array, $field)
-{
+function remove_duplicate($array, $field) {
foreach ($array as $sub) {
$cmp[] = $sub[$field];
}
- $unique = array_unique(array_reverse($cmp,true));
+ $unique = array_unique(array_reverse($cmp, true));
foreach ($unique as $k => $rien) {
$new[] = $array[$k];
}
@@ -141,10 +140,10 @@ exec("/usr/sbin/arp -an", $rawdata);
$arpdata_ip = array();
$arpdata_mac = array();
foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
+ $elements = explode(' ', $line);
if ($elements[3] != "(incomplete)") {
$arpent = array();
- $arpdata_ip[] = trim(str_replace(array('(',')'),'',$elements[1]));
+ $arpdata_ip[] = trim(str_replace(array('(', ')'), '', $elements[1]));
$arpdata_mac[] = strtolower(trim($elements[3]));
}
}
@@ -167,7 +166,7 @@ foreach ($leases_content as $lease) {
$i++;
continue;
}
- while($f < $fcount) {
+ while ($f < $fcount) {
switch ($data[$f]) {
case "failover":
$pools[$p]['name'] = trim($data[$f+2], '"');
@@ -251,7 +250,7 @@ foreach ($leases_content as $lease) {
break;
case "client-hostname":
if ($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
+ $leases[$l]['hostname'] = preg_replace('/"/', '', $data[$f+1]);
} else {
$hostname = gethostbyaddr($leases[$l]['ip']);
if ($hostname <> "") {
@@ -276,11 +275,11 @@ unset($lease_content);
/* remove duplicate items by mac address */
if (count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
+ $leases = remove_duplicate($leases, "ip");
}
if (count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
+ $pools = remove_duplicate($pools, "name");
asort($pools);
}
@@ -405,7 +404,7 @@ foreach ($leases as $data) {
echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}</td>\n";
}
}
- echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}</td>\n";
+ echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}</td>\n";
if ($data['type'] != "static") {
echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}</td>\n";
echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}</td>\n";
diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php
index c82a93a..63f1946 100644
--- a/usr/local/www/status_dhcpv6_leases.php
+++ b/usr/local/www/status_dhcpv6_leases.php
@@ -48,7 +48,7 @@
require("guiconfig.inc");
require_once("config.inc");
-$pgtitle = array(gettext("Status"),gettext("DHCPv6 leases"));
+$pgtitle = array(gettext("Status"), gettext("DHCPv6 leases"));
$shortcut_section = "dhcp6";
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd6.leases";
@@ -60,7 +60,7 @@ if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
/* Read existing leases */
$leases_contents = explode("\n", file_get_contents($leasesfile));
$newleases_contents = array();
- $i=0;
+ $i = 0;
while ($i < count($leases_contents)) {
/* Find the lease(s) we want to delete */
if ($leases_contents[$i] == " iaaddr {$_GET['deleteip']} {") {
@@ -134,7 +134,7 @@ function remove_duplicate($array, $field) {
foreach ($array as $sub) {
$cmp[] = $sub[$field];
}
- $unique = array_unique(array_reverse($cmp,true));
+ $unique = array_unique(array_reverse($cmp, true));
foreach ($unique as $k => $rien) {
$new[] = $array[$k];
}
@@ -143,7 +143,7 @@ function remove_duplicate($array, $field) {
function parse_duid($duid_string) {
$parsed_duid = array();
- for ($i=0; $i < strlen($duid_string); $i++) {
+ for ($i = 0; $i < strlen($duid_string); $i++) {
$s = substr($duid_string, $i, 1);
if ($s == '\\') {
$n = substr($duid_string, $i+1, 1);
@@ -175,10 +175,10 @@ $leases_count = count($leases_content);
exec("/usr/sbin/ndp -an", $rawdata);
$ndpdata = array();
foreach ($rawdata as $line) {
- $elements = preg_split('/\s+/ ',$line);
+ $elements = preg_split('/\s+/ ', $line);
if ($elements[1] != "(incomplete)") {
$ndpent = array();
- $ip = trim(str_replace(array('(',')'),'',$elements[0]));
+ $ip = trim(str_replace(array('(', ')'), '', $elements[0]));
$ndpent['mac'] = trim($elements[1]);
$ndpent['interface'] = trim($elements[2]);
$ndpdata[$ip] = $ndpent;
@@ -194,7 +194,7 @@ $l = 0;
$p = 0;
// Put everything together again
-while($i < $leases_count) {
+while ($i < $leases_count) {
$entry = array();
/* split the line by space */
$duid_split = array();
@@ -215,7 +215,7 @@ while($i < $leases_count) {
$i++;
continue;
}
- while($f < $fcount) {
+ while ($f < $fcount) {
switch ($data[$f]) {
case "failover":
$pools[$p]['name'] = $data[$f+2];
@@ -315,7 +315,7 @@ while($i < $leases_count) {
break;
case "client-hostname":
if ($data[$f+1] <> "") {
- $entry['hostname'] = preg_replace('/"/','',$data[$f+1]);
+ $entry['hostname'] = preg_replace('/"/', '', $data[$f+1]);
} else {
$hostname = gethostbyaddr($entry['ip']);
if ($hostname <> "") {
@@ -342,15 +342,15 @@ while($i < $leases_count) {
}
if (count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
+ $leases = remove_duplicate($leases, "ip");
}
if (count($prefixes) > 0) {
- $prefixes = remove_duplicate($prefixes,"prefix");
+ $prefixes = remove_duplicate($prefixes, "prefix");
}
if (count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
+ $pools = remove_duplicate($pools, "name");
asort($pools);
}
diff --git a/usr/local/www/status_filter_reload.php b/usr/local/www/status_filter_reload.php
index bd8a573..8844a48 100644
--- a/usr/local/www/status_filter_reload.php
+++ b/usr/local/www/status_filter_reload.php
@@ -42,7 +42,7 @@ require_once("globals.inc");
require_once("guiconfig.inc");
require_once("functions.inc");
-$pgtitle = array(gettext("Status"),gettext("Filter Reload Status"));
+$pgtitle = array(gettext("Status"), gettext("Filter Reload Status"));
$shortcut_section = "firewall";
if (file_exists("{$g['varrun_path']}/filter_reload_status")) {
@@ -100,8 +100,8 @@ function update_data(obj) {
var result_text = obj.content;
var result_text_split = result_text.split("|");
result_text = result_text_split[1];
- result_text = result_text.replace("\n","");
- result_text = result_text.replace("\r","");
+ result_text = result_text.replace("\n", "");
+ result_text = result_text.replace("\r", "");
if (result_text) {
jQuery('#status').html('<img src="/themes/<?=$g['theme'];?>/images/misc/loader.gif" alt="loader" /> ' + result_text + '...');
} else {
@@ -112,8 +112,8 @@ function update_data(obj) {
} else if (result_text == "Done") {
jQuery('#status').effect('highlight');
jQuery('#status').html('Done. The filter rules have been reloaded.');
- jQuery('#reloadinfo').css("visibility","hidden");
- jQuery('#doneurl').css("visibility","visible");
+ jQuery('#reloadinfo').css("visibility", "hidden");
+ jQuery('#doneurl').css("visibility", "visible");
jQuery('#doneurl').html("<p><a href='status_queues.php'>Queue Status<\/a><\/p>");
}
window.setTimeout('update_status_thread()', 2500);
diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php
index 1d6e9b5..e9011c8 100755
--- a/usr/local/www/status_gateway_groups.php
+++ b/usr/local/www/status_gateway_groups.php
@@ -51,7 +51,7 @@ $changedesc = gettext("Gateway Groups") . ": ";
$gateways_status = return_gateways_status();
-$pgtitle = array(gettext("Status"),gettext("Gateway Groups"));
+$pgtitle = array(gettext("Status"), gettext("Gateway Groups"));
$shortcut_section = "gateway-groups";
include("head.inc");
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index 1d77689..e6fcf9d 100644
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -49,7 +49,7 @@ $gateways_status = return_gateways_status(true);
$now = time();
$year = date("Y");
-$pgtitle = array(gettext("Status"),gettext("Gateways"));
+$pgtitle = array(gettext("Status"), gettext("Gateways"));
$shortcut_section = "gateways";
include("head.inc");
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php
index 28d13c1..2e78faf 100644
--- a/usr/local/www/status_graph.php
+++ b/usr/local/www/status_graph.php
@@ -78,7 +78,7 @@ foreach (array('server', 'client') as $mode) {
if ($_GET['if']) {
$curif = $_GET['if'];
$found = false;
- foreach($ifdescrs as $descr => $ifdescr) {
+ foreach ($ifdescrs as $descr => $ifdescr) {
if ($descr == $curif) {
$found = true;
break;
@@ -113,7 +113,7 @@ if ($_GET['hostipformat']) {
$curhostipformat = "";
}
-$pgtitle = array(gettext("Status"),gettext("Traffic Graph"));
+$pgtitle = array(gettext("Status"), gettext("Traffic Graph"));
include("head.inc");
@@ -158,7 +158,7 @@ function updateBandwidthHosts(data) {
var hosts_split = data.split("|");
d = document;
//parse top ten bandwidth abuser hosts
- for (var y=0; y<10; y++) {
+ for (var y = 0; y < 10; y++) {
if ((y < hosts_split.length) && (hosts_split[y] != "") && (hosts_split[y] != "no info")) {
hostinfo = hosts_split[y].split(";");
@@ -250,7 +250,7 @@ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enabl
<div id="col2" style="float: right; width: 48%; padding: 5px; position: relative;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="status">
<tr>
- <td class="listtopic" valign="top"><?=(($curhostipformat=="") ? gettext("Host IP") : gettext("Host Name or IP")); ?></td>
+ <td class="listtopic" valign="top"><?=(($curhostipformat == "") ? gettext("Host IP") : gettext("Host Name or IP")); ?></td>
<td class="listtopic" valign="top"><?=gettext("Bandwidth In"); ?></td>
<td class="listtopic" valign="top"><?=gettext("Bandwidth Out"); ?></td>
</tr>
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index 190765f..67ab96f 100644
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -58,7 +58,7 @@ if ($_POST['if'] && $_POST['submit']) {
exit;
}
-$pgtitle = array(gettext("Status"),gettext("Interfaces"));
+$pgtitle = array(gettext("Status"), gettext("Interfaces"));
$shortcut_section = "interfaces";
include("head.inc");
@@ -556,7 +556,7 @@ include("head.inc");
if ($ifinfo['bridge']):
?>
<tr>
- <td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"),$ifinfo['bridgeint']);?></td>
+ <td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"), $ifinfo['bridgeint']);?></td>
<td width="78%" class="listr">
<?=$ifinfo['bridge'];?>
</td>
@@ -600,7 +600,7 @@ include("head.inc");
"triggers it. To substantiate this point: disconnecting manually ".
"will %snot%s prevent dial-on-demand from making connections ".
"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
-"is kept disconnected."),'<strong>','</strong>')?>
+"is kept disconnected."), '<strong>', '</strong>')?>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php
index d5b277d..984ab9e 100644
--- a/usr/local/www/status_lb_pool.php
+++ b/usr/local/www/status_lb_pool.php
@@ -56,7 +56,7 @@ $lb_logfile = "{$g['varlog_path']}/relayd.log";
$now = time();
$year = date("Y");
-$pgtitle = array(gettext("Status"),gettext("Load Balancer"),gettext("Pool"));
+$pgtitle = array(gettext("Status"), gettext("Load Balancer"), gettext("Pool"));
$shortcut_section = "relayd";
include("head.inc");
@@ -154,23 +154,23 @@ if ($_POST) {
<td class="listr" align="center">
<table border="0" cellpadding="2" cellspacing="0" summary="status">
<?php
- $pool_hosts=array();
+ $pool_hosts = array();
foreach ((array) $pool['servers'] as $server) {
- $svr['ip']['addr']=$server;
- $svr['ip']['state']=$relay_hosts[$pool['name'].":".$pool['port']][$server]['state'];
- $svr['ip']['avail']=$relay_hosts[$pool['name'].":".$pool['port']][$server]['avail'];
+ $svr['ip']['addr'] = $server;
+ $svr['ip']['state'] = $relay_hosts[$pool['name'] . ":" . $pool['port']][$server]['state'];
+ $svr['ip']['avail'] = $relay_hosts[$pool['name'] . ":" . $pool['port']][$server]['avail'];
$pool_hosts[]=$svr;
}
foreach ((array) $pool['serversdisabled'] as $server) {
- $svr['ip']['addr']="$server";
- $svr['ip']['state']='disabled';
- $svr['ip']['avail']='disabled';
+ $svr['ip']['addr'] = "$server";
+ $svr['ip']['state'] = 'disabled';
+ $svr['ip']['avail'] = 'disabled';
$pool_hosts[]=$svr;
}
asort($pool_hosts);
foreach ((array) $pool_hosts as $server) {
- if ($server['ip']['addr']!="") {
+ if ($server['ip']['addr'] != "") {
switch ($server['ip']['state']) {
case 'up':
$bgcolor = "#90EE90"; // lightgreen
diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php
index 07c1736..0d0bd60 100644
--- a/usr/local/www/status_lb_vs.php
+++ b/usr/local/www/status_lb_vs.php
@@ -54,7 +54,7 @@ $a_vs = &$config['load_balancer']['virtual_server'];
$a_pool = &$config['load_balancer']['lbpool'];
$rdr_a = get_lb_redirects();
-$pgtitle = array(gettext("Status"),gettext("Load Balancer"),gettext("Virtual Server"));
+$pgtitle = array(gettext("Status"), gettext("Load Balancer"), gettext("Virtual Server"));
include("head.inc");
?>
diff --git a/usr/local/www/status_ntpd.php b/usr/local/www/status_ntpd.php
index 44c9733..329764b 100644
--- a/usr/local/www/status_ntpd.php
+++ b/usr/local/www/status_ntpd.php
@@ -108,7 +108,7 @@ if (!isset($config['ntpd']['noquery'])) {
$tmp = $tmp[1];
if (substr($tmp, 0, 6) == '$GPRMC') {
$gps_vars = explode(",", $tmp);
- $gps_ok = ($gps_vars[2] == "A");
+ $gps_ok = ($gps_vars[2] == "A");
$gps_lat_deg = substr($gps_vars[3], 0, 2);
$gps_lat_min = substr($gps_vars[3], 2) / 60.0;
$gps_lon_deg = substr($gps_vars[5], 0, 3);
@@ -119,7 +119,7 @@ if (!isset($config['ntpd']['noquery'])) {
$gps_lon = $gps_lon * (($gps_vars[6] == "E") ? 1 : -1);
} elseif (substr($tmp, 0, 6) == '$GPGGA') {
$gps_vars = explode(",", $tmp);
- $gps_ok = $gps_vars[6];
+ $gps_ok = $gps_vars[6];
$gps_lat_deg = substr($gps_vars[2], 0, 2);
$gps_lat_min = substr($gps_vars[2], 2) / 60.0;
$gps_lon_deg = substr($gps_vars[4], 0, 3);
@@ -133,7 +133,7 @@ if (!isset($config['ntpd']['noquery'])) {
$gps_sat = $gps_vars[7];
} elseif (substr($tmp, 0, 6) == '$GPGLL') {
$gps_vars = explode(",", $tmp);
- $gps_ok = ($gps_vars[6] == "A");
+ $gps_ok = ($gps_vars[6] == "A");
$gps_lat_deg = substr($gps_vars[1], 0, 2);
$gps_lat_min = substr($gps_vars[1], 2) / 60.0;
$gps_lon_deg = substr($gps_vars[3], 0, 3);
@@ -153,16 +153,16 @@ if (isset($config['ntpd']['gps']['type']) && ($config['ntpd']['gps']['type'] ==
$gpsport = fopen("/dev/gps0", "r+");
while ($gpsport) {
$buffer = fgets($gpsport);
- if (substr($buffer, 0, 6)=='$GPGSV') {
+ if (substr($buffer, 0, 6) == '$GPGSV') {
//echo $buffer."\n";
- $gpgsv = explode(',',$buffer);
+ $gpgsv = explode(',', $buffer);
$gps_satview = $gpgsv[3];
break;
}
}
}
-$pgtitle = array(gettext("Status"),gettext("NTP"));
+$pgtitle = array(gettext("Status"), gettext("NTP"));
$shortcut_section = "ntp";
include("head.inc");
?>
diff --git a/usr/local/www/status_openvpn.php b/usr/local/www/status_openvpn.php
index 0b0e92d..e9d2073 100644
--- a/usr/local/www/status_openvpn.php
+++ b/usr/local/www/status_openvpn.php
@@ -115,10 +115,10 @@ include("head.inc"); ?>
<script type="text/javascript">
//<![CDATA[
function killClient(mport, remipp) {
- var busy = function(index,icon) {
- jQuery(icon).bind("onclick","");
- jQuery(icon).attr('src',jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
- jQuery(icon).css("cursor","wait");
+ var busy = function(index, icon) {
+ jQuery(icon).bind("onclick", "");
+ jQuery(icon).attr('src', jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
+ jQuery(icon).css("cursor", "wait");
}
jQuery('img[name="i:' + mport + ":" + remipp + '"]').each(busy);
@@ -138,7 +138,7 @@ include("head.inc"); ?>
}
jQuery('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
- function(index,row) { jQuery(row).fadeOut(1000); }
+ function(index, row) { jQuery(row).fadeOut(1000); }
);
}
//]]>
@@ -219,7 +219,7 @@ include("head.inc"); ?>
if (is_array($server['routes']) && count($server['routes'])):
?>
<div id="shroutebut-<?= $i ?>">
- <input type="button" onClick="show_routes('tabroute-<?= $i ?>','shroutebut-<?= $i ?>')" value="<?php echo gettext("Show Routing Table"); ?>" /> - <?= gettext("Display OpenVPN's internal routing table for this server.") ?>
+ <input type="button" onClick="show_routes('tabroute-<?= $i ?>', 'shroutebut-<?= $i ?>')" value="<?php echo gettext("Show Routing Table"); ?>" /> - <?= gettext("Display OpenVPN's internal routing table for this server.") ?>
<br /><br />
</div>
<table style="display: none; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" id="tabroute-<?= $i ?>" summary="routing table">
diff --git a/usr/local/www/status_queues.php b/usr/local/www/status_queues.php
index 1f5e45d..fd953f8 100644
--- a/usr/local/www/status_queues.php
+++ b/usr/local/www/status_queues.php
@@ -68,7 +68,7 @@ if (!$fd) {
$error = "Something wrong happened during communication with stat gathering";
} else {
$stats = "";
- while(!feof($fd)) {
+ while (!feof($fd)) {
$stats .= fread($fd, 4096);
}
fclose($fd);
@@ -87,16 +87,13 @@ if ($_REQUEST['getactivity']) {
statsQueues($q);
}
/* calculate the bigger amount of packets or bandwidth being moved through all queues. */
- if ($stat_type == "0")
- {
+ if ($stat_type == "0") {
foreach ($statistics as $q) {
if ($bigger_stat < $q->pps) {
$bigger_stat = $q->pps;
}
}
- }
- else
- {
+ } else {
foreach ($statistics as $q) {
if ($bigger_stat < $q->bandwidth) {
$bigger_stat = $q->bandwidth;
@@ -115,7 +112,7 @@ if ($_REQUEST['getactivity']) {
}
$finscript .= "jQuery('#queue{$q->queuename}widthb').width('{$packet_s}');";
$finscript .= "jQuery('#queue{$q->queuename}widtha').width('" . (150 - $packet_s) . "');";
- $finscript .= "jQuery('#queue{$q->queuename}pps').val('" . number_format($q->pps,1) . "');";
+ $finscript .= "jQuery('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');";
$finscript .= "jQuery('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');";
$finscript .= "jQuery('#queue{$q->queuename}borrows').val('{$q->borrows}');";
$finscript .= "jQuery('#queue{$q->queuename}suspends').val('{$q->suspends}');";
@@ -127,7 +124,7 @@ if ($_REQUEST['getactivity']) {
echo $finscript;
exit;
}
-$pgtitle = array(gettext("Status"),gettext("Traffic shaper"),gettext("Queues"));
+$pgtitle = array(gettext("Status"), gettext("Traffic shaper"), gettext("Queues"));
$shortcut_section = "trafficshaper";
include("head.inc");
?>
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 94111bc..ae9c709 100644
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -47,7 +47,7 @@ require_once("rrd.inc");
unset($input_errors);
/* if the rrd graphs are not enabled redirect to settings page */
-if (! isset($config['rrd']['enable'])) {
+if (!isset($config['rrd']['enable'])) {
header("Location: status_rrd_graph_settings.php");
}
@@ -59,7 +59,7 @@ $databases = glob("*.rrd");
if ($_GET['cat']) {
$curcat = htmlspecialchars($_GET['cat']);
} else {
- if (! empty($config['rrd']['category'])) {
+ if (!empty($config['rrd']['category'])) {
$curcat = $config['rrd']['category'];
} else {
$curcat = "system";
@@ -75,7 +75,7 @@ if ($_GET['zone']) {
if ($_GET['period']) {
$curperiod = $_GET['period'];
} else {
- if (! empty($config['rrd']['period'])) {
+ if (!empty($config['rrd']['period'])) {
$curperiod = $config['rrd']['period'];
} else {
$curperiod = "absolute";
@@ -193,12 +193,13 @@ $styles = array('inverse' => gettext('Inverse'),
$curstyle = "inverse";
if ($_GET['style']) {
- foreach ($styles as $style)
+ foreach ($styles as $style) {
if (strtoupper($style) == strtoupper($_GET['style'])) {
$curstyle = $_GET['style'];
}
+ }
} else {
- if (! empty($config['rrd']['style'])) {
+ if (!empty($config['rrd']['style'])) {
$curstyle = $config['rrd']['style'];
} else {
$curstyle = "inverse";
@@ -259,7 +260,7 @@ $graph_length = array(
"year" => 31622400,
"fouryear" => 126230400);
-$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
+$pgtitle = array(gettext("Status"), gettext("RRD Graphs"));
$closehead = false;
@@ -558,7 +559,7 @@ function get_dates($curperiod, $graph) {
}
}
foreach ($ui_databases as $db => $database) {
- if (! preg_match("/($curcat)/i", $database)) {
+ if (!preg_match("/($curcat)/i", $database)) {
continue;
}
@@ -669,7 +670,7 @@ function get_dates($curperiod, $graph) {
foreach ($graphs as $graph) {
/* check which databases are valid for our category */
foreach ($ui_databases as $curdatabase) {
- if (! preg_match("/($curcat)/i", $curdatabase)) {
+ if (!preg_match("/($curcat)/i", $curdatabase)) {
continue;
}
@@ -707,7 +708,7 @@ function get_dates($curperiod, $graph) {
continue 2;
}
}
- if (! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
+ if (!preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
continue 2;
}
break;
@@ -719,7 +720,7 @@ function get_dates($curperiod, $graph) {
break;
default:
/* just use the name here */
- if (! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
+ if (!preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
continue 2;
}
}
@@ -752,7 +753,7 @@ function get_dates($curperiod, $graph) {
foreach ($graphs as $graph) {
/* check which databases are valid for our category */
foreach ($ui_databases as $curdatabase) {
- if (! stristr($curdatabase, $curcat)) {
+ if (!stristr($curdatabase, $curcat)) {
continue;
}
$optionc = explode("-", $curdatabase);
@@ -785,7 +786,7 @@ function get_dates($curperiod, $graph) {
continue 2;
}
}
- if (! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
+ if (!preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
continue 2;
}
break;
@@ -797,7 +798,7 @@ function get_dates($curperiod, $graph) {
break;
default:
/* just use the name here */
- if (! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
+ if (!preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
continue 2;
}
}
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 6d7c7eb..d28472f 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -41,7 +41,7 @@ require_once("rrd.inc");
global $g;
-$pgtitle = array(gettext("System"),gettext("RRD Graphs"),gettext("Image viewer"));
+$pgtitle = array(gettext("System"), gettext("RRD Graphs"), gettext("Image viewer"));
if ($_GET['database']) {
$curdatabase = basename($_GET['database']);
@@ -218,32 +218,32 @@ $colorpacketsdown = array('990000', 'CC0000', 'FFC875', 'FF9900');
$colortraffic95 = array('660000', 'FF0000');
/* State Table pfrate, pfstates, pfnat, srcip, dstip */
-$colorstates = array('00AA00','990000','0000FF','000000','DD9B00');
+$colorstates = array('00AA00', '990000', '0000FF', '000000', 'DD9B00');
/* Processor Usage user, nice, system, int, processes */
-$colorprocessor = array('00AA00','990000','0000FF','DD9B00','000000');
+$colorprocessor = array('00AA00', '990000', '0000FF', 'DD9B00', '000000');
/* Memory Usage active, inact, free, cache, wire */
-$colormemory = array('00AA00','990000','0000FF','666666','DD9B00');
+$colormemory = array('00AA00', '990000', '0000FF', '666666', 'DD9B00');
/* MBUF Usage current, cache, total, max */
-$colormbuf = array('0080FF','00E344','FF0000','000000');
+$colormbuf = array('0080FF', '00E344', 'FF0000', '000000');
/* Traffic Shaper Queues q1, q2, q3, q4, q5, q6, q7, q8, q9 */
-$colorqueuesup = array('000000','7B0000','0080FF','00E344','FF0000','2217AA','FFC875','FF9900','CC0000');
-$colorqueuesdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
+$colorqueuesup = array('000000', '7B0000', '0080FF', '00E344', 'FF0000', '2217AA', 'FFC875', 'FF9900', 'CC0000');
+$colorqueuesdown = array('000000', '7B7B7B', '999999', 'BBBBBB', 'CCCCCC', 'D9D9D9', 'EEEEEE', 'FFFFFF', 'CCCCCC');
-$colorqueuesdropup = array('000000','7B0000','0080FF','00E344','FF0000','2217AA','FFC875','FF9900','CC0000');
-$colorqueuesdropdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
+$colorqueuesdropup = array('000000', '7B0000', '0080FF', '00E344', 'FF0000', '2217AA', 'FFC875', 'FF9900', 'CC0000');
+$colorqueuesdropdown = array('000000', '7B7B7B', '999999', 'BBBBBB', 'CCCCCC', 'D9D9D9', 'EEEEEE', 'FFFFFF', 'CCCCCC');
/* Quality Graph Delay >420, 180-420, 60-180, 20-60, <20, Delay Avg */
-$colorqualityrtt = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+$colorqualityrtt = array('990000', 'a83c3c', 'b36666', 'bd9090', 'cccccc', '000000');
/* Quality Graph Loss */
$colorqualityloss = 'ee0000';
/* Wireless Graph SNR, Rate, Channel*/
/* Cellular Graph RSSI, */
-$colorwireless = array('333333','a83c3c','999999');
+$colorwireless = array('333333', 'a83c3c', '999999');
/* SPAMD Times min area, avg area, max area, Time line */
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
@@ -254,7 +254,7 @@ $colorspamdconn = array('AA00BB', 'FFFFFF', '660088', 'FFFF88', '006600');
$colorvpnusers = array('990000');
/* NTPD stats offset, clk jit, sys jit, wander */
-$colorntpd = array('0080FF','00E344','FF0000','000000');
+$colorntpd = array('0080FF', '00E344', 'FF0000', '000000');
/* Captive Portal Total Users Total Users */
/* Captive Portal Concurrent Concurrent Users */
@@ -265,7 +265,7 @@ $rrdcolors = "{$g['www_path']}/themes/{$g['theme']}/rrdcolors.inc.php";
if (file_exists($rrdcolors)) {
include($rrdcolors);
} else {
- log_error(sprintf(gettext("rrdcolors.inc.php for theme %s does not exist, using defaults!"),$g['theme']));
+ log_error(sprintf(gettext("rrdcolors.inc.php for theme %s does not exist, using defaults!"), $g['theme']));
}
switch ($curstyle) {
@@ -1240,17 +1240,17 @@ if (file_exists("$rrdtmppath$curdatabase-$curgraph.png")) {
usleep(500);
}
}
-if (($graphcmdreturn <> 0) || (! $data)) {
- log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'),$graphcmdreturn,$graphcmdoutput));
+if (($graphcmdreturn <> 0) || (!$data)) {
+ log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'), $graphcmdreturn, $graphcmdoutput));
if (strstr($curdatabase, "queues")) {
- log_error(sprintf(gettext("failed to create graph from %s%s, removing database"),$rrddbpath,$curdatabase));
+ log_error(sprintf(gettext("failed to create graph from %s%s, removing database"), $rrddbpath, $curdatabase));
unlink_if_exists($rrddbpath . $curif . $queues);
flush();
usleep(500);
enable_rrd_graphing();
}
if (strstr($curdatabase, "queuesdrop")) {
- log_error(sprintf(gettext("failed to create graph from %s%s, removing database"),$rrddbpath,$curdatabase));
+ log_error(sprintf(gettext("failed to create graph from %s%s, removing database"), $rrddbpath, $curdatabase));
unlink_if_exists($rrddbpath . $curdatabase);
flush();
usleep(500);
diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php
index ef35951..ede9f41 100644
--- a/usr/local/www/status_rrd_graph_settings.php
+++ b/usr/local/www/status_rrd_graph_settings.php
@@ -115,7 +115,7 @@ foreach ($databases as $database) {
}
}
-$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
+$pgtitle = array(gettext("Status"), gettext("RRD Graphs"));
include("head.inc");
?>
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php
index e4402da..ac13b32 100755
--- a/usr/local/www/status_services.php
+++ b/usr/local/www/status_services.php
@@ -67,7 +67,7 @@ if ($_GET['batch']) {
exit;
}
-$pgtitle = array(gettext("Status"),gettext("Services"));
+$pgtitle = array(gettext("Status"), gettext("Services"));
include("head.inc");
?>
diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php
index 296e384..62349df 100644
--- a/usr/local/www/status_upnp.php
+++ b/usr/local/www/status_upnp.php
@@ -56,7 +56,7 @@ exec("/sbin/pfctl -aminiupnpd -sn", $rdr_entries, $pf_ret);
$now = time();
$year = date("Y");
-$pgtitle = array(gettext("Status"),gettext("UPnP &amp; NAT-PMP Status"));
+$pgtitle = array(gettext("Status"), gettext("UPnP &amp; NAT-PMP Status"));
$shortcut_section = "upnp";
include("head.inc");
?>
diff --git a/usr/local/www/status_wireless.php b/usr/local/www/status_wireless.php
index d15cfed..be51458 100644
--- a/usr/local/www/status_wireless.php
+++ b/usr/local/www/status_wireless.php
@@ -39,7 +39,7 @@
require_once("guiconfig.inc");
-$pgtitle = array(gettext("Status"),gettext("Wireless"));
+$pgtitle = array(gettext("Status"), gettext("Wireless"));
$shortcut_section = "wireless";
include("head.inc");
@@ -114,7 +114,7 @@ include("fbegin.inc");
/* Skip Header */
array_shift($states);
- $counter=0;
+ $counter = 0;
foreach ($states as $state) {
/* Split by Mac address for the SSID Field */
$split = preg_split("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state);
@@ -165,7 +165,7 @@ include("fbegin.inc");
exec("/sbin/ifconfig {$rwlif} list sta 2>&1", $states, $ret);
array_shift($states);
- $counter=0;
+ $counter = 0;
foreach ($states as $state) {
$split = preg_split("/[ ]+/i", $state);
/* Split the rest by using spaces for this line using the 2nd part */
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php
index f970822..9b82903 100644
--- a/usr/local/www/system_advanced_admin.php
+++ b/usr/local/www/system_advanced_admin.php
@@ -585,8 +585,8 @@ function prot_change() {
<td width="22%" valign="top" class="vncell"><?=gettext("Primary Console")?></td>
<td width="78%" class="vtable">
<select name="primaryconsole" id="primaryconsole" class="formselect">
- <option value="serial" <?php if ($pconfig['primaryconsole'] == "serial") echo "selected=\"selected\"";?>>Serial Console</option>
- <option value="video" <?php if ($pconfig['primaryconsole'] == "video") echo "selected=\"selected\"";?>>VGA Console</option>
+ <option value="serial" <?php if ($pconfig['primaryconsole'] == "serial") echo "selected=\"selected\"";?>>Serial Console</option>
+ <option value="video" <?php if ($pconfig['primaryconsole'] == "video") echo "selected=\"selected\"";?>>VGA Console</option>
</select>
<br /><?=gettext("Select the preferred console if multiple consoles are present. The preferred console will show pfSense boot script output. All consoles display OS boot messages, console messages, and the console menu."); ?>
</td>
@@ -601,7 +601,7 @@ function prot_change() {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Console menu"); ?></td>
<td width="78%" class="vtable">
- <input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked=\"checked\""; ?> />
+ <input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked=\"checked\""; ?> />
<strong><?=gettext("Password protect the console menu"); ?></strong>
</td>
</tr>
diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php
index 67df042..9894704 100644
--- a/usr/local/www/system_advanced_notifications.php
+++ b/usr/local/www/system_advanced_notifications.php
@@ -368,7 +368,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Startup/Shutdown Sound"); ?></td>
<td width="78%" class="vtable">
- <input name="disablebeep" type="checkbox" id="disablebeep" value="yes" <?php if ($pconfig['disablebeep']) echo "checked=\"checked\""; ?> />
+ <input name="disablebeep" type="checkbox" id="disablebeep" value="yes" <?php if ($pconfig['disablebeep']) echo "checked=\"checked\""; ?> />
<strong><?=gettext("Disable the startup/shutdown beep"); ?></strong>
<br />
<span class="vexpl"><?=gettext("When this is checked, startup and shutdown sounds will no longer play."); ?></span>
@@ -396,7 +396,7 @@ include("head.inc");
jQuery(document).ready(function() {
if (jQuery('#smtpssl').is(':checked')) {
jQuery('#smtptls').prop('disabled', true);
- } else if (jQuery('#smtptls').is(':checked')) {
+ } else if (jQuery('#smtptls').is(':checked')) {
jQuery('#smtpssl').prop('disabled', true);
}
});
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 1f21090..6dff39d 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -464,7 +464,7 @@ if ($_POST) {
// $subject_mismatch = true;
// }
// }
- $mod_csr = csr_get_modulus($pconfig['csr'], false);
+ $mod_csr = csr_get_modulus($pconfig['csr'], false);
$mod_cert = cert_get_modulus($pconfig['cert'], false);
if (strcmp($mod_csr, $mod_cert)) {
diff --git a/usr/local/www/system_crlmanager.php b/usr/local/www/system_crlmanager.php
index 1eb9394..2866688 100644
--- a/usr/local/www/system_crlmanager.php
+++ b/usr/local/www/system_crlmanager.php
@@ -203,15 +203,14 @@ if ($_POST) {
if (($pconfig['method'] == "existing") || ($act == "editimported")) {
$reqdfields = explode(" ", "descr crltext");
$reqdfieldsn = array(
- gettext("Descriptive name"),
- gettext("Certificate Revocation List data"));
+ gettext("Descriptive name"),
+ gettext("Certificate Revocation List data"));
}
if ($pconfig['method'] == "internal") {
- $reqdfields = explode(" ",
- "descr caref");
+ $reqdfields = explode(" ", "descr caref");
$reqdfieldsn = array(
- gettext("Descriptive name"),
- gettext("Certificate Authority"));
+ gettext("Descriptive name"),
+ gettext("Certificate Authority"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php
index b3564c0..cb3dd90 100644
--- a/usr/local/www/system_firmware.php
+++ b/usr/local/www/system_firmware.php
@@ -190,7 +190,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz");
} else if (stristr($_FILES['ulfile']['name'], "bdiff")) {
mwexec_bg("/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz");
- } else {
+ } else {
if ($g['platform'] == "nanobsd") {
$whichone = "pfSenseNanoBSDupgrade";
} else {
@@ -264,7 +264,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?=gettext("Invoke") ." ". $g['product_name'] ." ". gettext("Manual Upgrade"); ?></td>
+ <td colspan="2" class="listtopic"><?=gettext("Invoke") ." ". $g['product_name'] . " " . gettext("Manual Upgrade"); ?></td>
</tr>
<tr>
<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php
index 458e071..d240a63 100644
--- a/usr/local/www/system_firmware_check.php
+++ b/usr/local/www/system_firmware_check.php
@@ -47,7 +47,7 @@ require("guiconfig.inc");
require_once("pfsense-utils.inc");
$curcfg = $config['system']['firmware'];
-$pgtitle=array(gettext("System"), gettext("Firmware"), gettext("Auto Update"));
+$pgtitle = array(gettext("System"), gettext("Firmware"), gettext("Auto Update"));
include("head.inc");
?>
@@ -191,13 +191,13 @@ echo "//]]>\n";
echo "</script>\n";
$txt = gettext("A new version is now available") . "\\n\\n";
-$txt .= gettext("Current version") .": ". $current_installed_version . "\\n";
+$txt .= gettext("Current version") . ": " . $current_installed_version . "\\n";
if ($g['platform'] == "nanobsd") {
$txt .= " " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n";
}
-$txt .= " " . gettext("Built On") .": ". $current_installed_buildtime . "\\n";
-$txt .= " " . gettext("New version") .": ". htmlspecialchars($remote_version, ENT_QUOTES | ENT_HTML401). "\\n\\n";
-$txt .= " " . gettext("Update source") .": ". $updater_url . "\\n";
+$txt .= " " . gettext("Built On") . ": " . $current_installed_buildtime . "\\n";
+$txt .= " " . gettext("New version") . ": " . htmlspecialchars($remote_version, ENT_QUOTES | ENT_HTML401). "\\n\\n";
+$txt .= " " . gettext("Update source") . ": " . $updater_url . "\\n";
update_output_window($txt);
?>
</p>
diff --git a/usr/local/www/system_firmware_restorefullbackup.php b/usr/local/www/system_firmware_restorefullbackup.php
index fb571af..3cf3f83 100644
--- a/usr/local/www/system_firmware_restorefullbackup.php
+++ b/usr/local/www/system_firmware_restorefullbackup.php
@@ -159,16 +159,16 @@ include("head.inc");
$counter++;
$size = exec("gzip -l /root/$arf | grep -v compressed | awk '{ print $2 }'");
echo "<tr>";
- echo "<td class='listlr' width='50%' colspan='1'>";
+ echo "<td class='listlr' width='50%' colspan='1'>";
echo "<input type='radio' name='restorefile' value='$arf' /> $arf";
echo "</td>";
- echo "<td class='listr' width='30%' colspan='1'>";
+ echo "<td class='listr' width='30%' colspan='1'>";
echo date ("F d Y H:i:s", filemtime($arf));
echo "</td>";
- echo "<td class='listr' width='40%' colspan='1'>";
+ echo "<td class='listr' width='40%' colspan='1'>";
echo format_bytes($size);
echo "</td>";
- echo "<td class='listr nowrap' width='20%' colspan='1'>";
+ echo "<td class='listr nowrap' width='20%' colspan='1'>";
echo "<a onclick=\"return confirm('" . gettext("Do you really want to delete this backup?") . "')\" href='system_firmware_restorefullbackup.php?deletefile=" . htmlspecialchars($arf) . "'>";
echo gettext("Delete");
echo "</a> | ";
@@ -180,7 +180,7 @@ include("head.inc");
}
if ($counter == 0) {
echo "<tr>";
- echo "<td class='listlr' width='100%' colspan='4' align='center'>";
+ echo "<td class='listlr' width='100%' colspan='4' align='center'>";
echo gettext("Could not locate any previous backups.");
echo "</td>";
echo "</tr>";
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 12958ec..483e102 100644
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -628,9 +628,9 @@ function calculated_change(calculated_obj, samples_obj) {
function valid_value(object, min, max) {
if (object.value) {
object.value = Math.round(object.value); // Round to integer
- if (object.value < min) object.value = min; // Min Value
- if (object.value > max) object.value = max; // Max Value
- if (isNaN(object.value)) object.value = ''; // Empty Value
+ if (object.value < min) object.value = min; // Min Value
+ if (object.value > max) object.value = max; // Max Value
+ if (isNaN(object.value)) object.value = ''; // Empty Value
}
}
diff --git a/usr/local/www/system_groupmanager_addprivs.php b/usr/local/www/system_groupmanager_addprivs.php
index 00c86f0..830d025 100644
--- a/usr/local/www/system_groupmanager_addprivs.php
+++ b/usr/local/www/system_groupmanager_addprivs.php
@@ -237,7 +237,7 @@ function update_description() {
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($groupid)): ?>
<input name="groupid" type="hidden" value="<?=htmlspecialchars($groupid);?>" />
diff --git a/usr/local/www/system_hasync.php b/usr/local/www/system_hasync.php
index 6455fe2..3426404 100755
--- a/usr/local/www/system_hasync.php
+++ b/usr/local/www/system_hasync.php
@@ -143,7 +143,7 @@ include("head.inc");
<tr valign="top">
<td width="22%" class="vncell">pfsync Synchronize Peer IP</td>
<td class="vtable">
- <input id='pfsyncpeerip' name='pfsyncpeerip' class='formfld unknown' value='<?= htmlentities($pconfig['pfsyncpeerip']); ?>' />
+ <input id='pfsyncpeerip' name='pfsyncpeerip' class='formfld unknown' value='<?= htmlentities($pconfig['pfsyncpeerip']); ?>' />
<br />
Setting this option will force pfsync to synchronize its state table to this IP address. The default is directed multicast.
</td>
@@ -157,7 +157,7 @@ include("head.inc");
<tr valign="top">
<td width="22%" class="vncell">Synchronize Config to IP</td>
<td class="vtable">
- <input id='synchronizetoip' name='synchronizetoip' class='formfld unknown' value='<?= htmlentities($pconfig['synchronizetoip']); ?>' />
+ <input id='synchronizetoip' name='synchronizetoip' class='formfld unknown' value='<?= htmlentities($pconfig['synchronizetoip']); ?>' />
<br />
Enter the IP address of the firewall to which the selected configuration sections should be synchronized.<br />
<br />
@@ -169,7 +169,7 @@ include("head.inc");
<tr valign="top">
<td width="22%" class="vncell">Remote System Username</td>
<td class="vtable">
- <input id='username' name='username' class='formfld unknown' value='<?= htmlentities($pconfig['username']); ?>' />
+ <input id='username' name='username' class='formfld unknown' value='<?= htmlentities($pconfig['username']); ?>' />
<br />
Enter the webConfigurator username of the system entered above for synchronizing your configuration.<br />
<br />
@@ -179,7 +179,7 @@ include("head.inc");
<tr valign="top">
<td width="22%" class="vncell">Remote System Password</td>
<td class="vtable">
- <input id='passwordfld' type='password' name='passwordfld' class='formfld pwd' value='<?= htmlentities($pconfig['passwordfld']); ?>' />
+ <input id='passwordfld' type='password' name='passwordfld' class='formfld pwd' value='<?= htmlentities($pconfig['passwordfld']); ?>' />
<br />
Enter the webConfigurator password of the system entered above for synchronizing your configuration.<br />
<br />
diff --git a/usr/local/www/system_usermanager_addprivs.php b/usr/local/www/system_usermanager_addprivs.php
index 87ddb21..40b11a6 100644
--- a/usr/local/www/system_usermanager_addprivs.php
+++ b/usr/local/www/system_usermanager_addprivs.php
@@ -202,7 +202,7 @@ function update_description() {
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($userid)): ?>
<input name="userid" type="hidden" value="<?=htmlspecialchars($userid);?>" />
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php
index fd400b0..6ef6040 100644
--- a/usr/local/www/vpn_ipsec.php
+++ b/usr/local/www/vpn_ipsec.php
@@ -233,7 +233,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("VPN"),gettext("IPsec"));
+$pgtitle = array(gettext("VPN"), gettext("IPsec"));
$shortcut_section = "ipsec";
include("head.inc");
@@ -385,7 +385,7 @@ include("head.inc");
<?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name'];?>
<?php
if ($ph1ent['encryption-algorithm']['keylen']) {
- if ($ph1ent['encryption-algorithm']['keylen']=="auto") {
+ if ($ph1ent['encryption-algorithm']['keylen'] == "auto") {
echo " (" . gettext("auto") . ")";
} else {
echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")";
@@ -455,7 +455,7 @@ include("head.inc");
<input type="hidden" name="tdph2-<?=$i;?>-visible" id="tdph2-<?=$i;?>-visible" value="<?=$tdph2_visible?>" />
<div id="shph2but-<?=$i?>" <?php echo ($tdph2_visible == '1' ? 'style="display:none"' : '');?>>
<?php
- $phase2count=0;
+ $phase2count = 0;
foreach ($a_phase2 as $ph2ent) {
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) {
continue;
@@ -465,7 +465,7 @@ include("head.inc");
$fr_prefix = "frp2{$i}";
$fr_header = $fr_prefix . "header";
?>
- <input type="button" onclick="show_phase2('tdph2-<?=$i?>','shph2but-<?=$i?>')" value="+" /> - <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?>
+ <input type="button" onclick="show_phase2('tdph2-<?=$i?>', 'shph2but-<?=$i?>')" value="+" /> - <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?>
</div>
<div id="tdph2-<?=$i?>" <?php echo ($tdph2_visible != '1' ? 'style="display:none"' : '');?>>
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="phase-2 entries">
@@ -544,7 +544,7 @@ include("head.inc");
}
echo $p2_ealgos[$ph2ea['name']]['name'];
if ($ph2ea['keylen']) {
- if ($ph2ea['keylen']=="auto") {
+ if ($ph2ea['keylen'] == "auto") {
echo " (" . gettext("auto") . ")";
} else {
echo " ({$ph2ea['keylen']} " . gettext("bits") . ")";
diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php
index 86c63f5..bb1ef75 100644
--- a/usr/local/www/vpn_ipsec_mobile.php
+++ b/usr/local/www/vpn_ipsec_mobile.php
@@ -144,7 +144,7 @@ if ($_POST['submit']) {
/* input validation */
$reqdfields = explode(" ", "user_source group_source");
- $reqdfieldsn = array(gettext("User Authentication Source"), gettext("Group Authentication Source"));
+ $reqdfieldsn = array(gettext("User Authentication Source"), gettext("Group Authentication Source"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -174,7 +174,7 @@ if ($_POST['submit']) {
if ($pconfig['dns_server_enable']) {
if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
- !$pconfig['dns_server3'] && !$pconfig['dns_server4'] ) {
+ !$pconfig['dns_server3'] && !$pconfig['dns_server4']) {
$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
}
if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1'])) {
@@ -375,7 +375,7 @@ function login_banner_change() {
}
}
if ($pconfig['enable'] && !$ph1found) {
- print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br />" . gettext("Please click Create to define one."),gettext("create"),gettext("Create Phase1"));
+ print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br />" . gettext("Please click Create to define one."), gettext("create"), gettext("Create Phase1"));
}
if ($input_errors) {
print_input_errors($input_errors);
diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php
index b4c456a..f9a9805 100644
--- a/usr/local/www/vpn_ipsec_phase2.php
+++ b/usr/local/www/vpn_ipsec_phase2.php
@@ -636,7 +636,7 @@ function change_protocol() {
$iflist = get_configured_interface_with_descr();
foreach ($iflist as $ifname => $ifdescr):
?>
- <option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
+ <option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
<?php endforeach; ?>
</select>
</td>
@@ -673,9 +673,9 @@ function change_protocol() {
$iflist = get_configured_interface_with_descr();
foreach ($iflist as $ifname => $ifdescr):
?>
- <option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
+ <option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
<?php endforeach; ?>
- <option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none" ) echo "selected=\"selected\"";?>><?=gettext("None"); ?></option>
+ <option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none") echo "selected=\"selected\"";?>><?=gettext("None"); ?></option>
</select>
</td>
</tr>
@@ -958,7 +958,7 @@ function pconfig_to_idinfo($prefix,& $pconfig) {
case "network":
return array('type' => $type, 'address' => $address, 'netbits' => $netbits);
default:
- return array('type' => $type );
+ return array('type' => $type);
}
}
diff --git a/usr/local/www/vpn_ipsec_settings.php b/usr/local/www/vpn_ipsec_settings.php
index 456eb7b..9b93f12 100644
--- a/usr/local/www/vpn_ipsec_settings.php
+++ b/usr/local/www/vpn_ipsec_settings.php
@@ -234,9 +234,9 @@ include("head.inc");
function maxmss_checked(obj) {
if (obj.checked) {
- jQuery('#maxmss').attr('disabled',false);
+ jQuery('#maxmss').attr('disabled', false);
} else {
- jQuery('#maxmss').attr('disabled','true');
+ jQuery('#maxmss').attr('disabled', 'true');
}
}
@@ -288,8 +288,9 @@ function maxmss_checked(obj) {
echo "<select name=\"ipsec_{$lkey}\" id=\"ipsec_{$lkey}\">\n";
foreach (array("Silent", "Audit", "Control", "Diag", "Raw", "Highest") as $lidx => $lvalue) {
echo "<option value=\"{$lidx}\" ";
- if ($pconfig["ipsec_{$lkey}"] == $lidx)
+ if ($pconfig["ipsec_{$lkey}"] == $lidx) {
echo "selected=\"selected\"";
+ }
echo ">{$lvalue}</option>\n";
}
?>
diff --git a/usr/local/www/vpn_l2tp.php b/usr/local/www/vpn_l2tp.php
index 7a508c5..88f4eae 100644
--- a/usr/local/www/vpn_l2tp.php
+++ b/usr/local/www/vpn_l2tp.php
@@ -72,7 +72,7 @@ if ($_POST) {
/* input validation */
if ($_POST['mode'] == "server") {
$reqdfields = explode(" ", "localip remoteip");
- $reqdfieldsn = array(gettext("Server address"),gettext("Remote start address"));
+ $reqdfieldsn = array(gettext("Server address"), gettext("Remote start address"));
if ($_POST['radiusenable']) {
$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
@@ -144,19 +144,20 @@ if ($_POST) {
if ($_POST['l2tp_dns1'] == "") {
- if (isset($l2tpcfg['dns1']))
+ if (isset($l2tpcfg['dns1'])) {
unset($l2tpcfg['dns1']);
- } else {
- $l2tpcfg['dns1'] = $_POST['l2tp_dns1'];
}
+ } else {
+ $l2tpcfg['dns1'] = $_POST['l2tp_dns1'];
+ }
- if ($_POST['l2tp_dns2'] == "") {
- if (isset($l2tpcfg['dns2'])) {
- unset($l2tpcfg['dns2']);
- }
- } else {
- $l2tpcfg['dns2'] = $_POST['l2tp_dns2'];
+ if ($_POST['l2tp_dns2'] == "") {
+ if (isset($l2tpcfg['dns2'])) {
+ unset($l2tpcfg['dns2']);
}
+ } else {
+ $l2tpcfg['dns2'] = $_POST['l2tp_dns2'];
+ }
if ($_POST['radiusenable'] == "yes") {
$l2tpcfg['radius']['enable'] = true;
@@ -197,8 +198,7 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
-function get_radio_value(obj)
-{
+function get_radio_value(obj) {
for (i = 0; i < obj.length; i++) {
if (obj[i].checked) {
return obj[i].value;
@@ -358,7 +358,7 @@ function enable_change(enable_over) {
<td width="78%" class="vtable">
<select id="l2tp_subnet" name="l2tp_subnet">
<?php
- for ($x=0; $x<33; $x++) {
+ for ($x = 0; $x < 33; $x++) {
if ($x == $pconfig['l2tp_subnet']) {
$SELECTED = " selected=\"selected\"";
} else {
@@ -376,7 +376,7 @@ function enable_change(enable_over) {
<td width="78%" class="vtable">
<select id="n_l2tp_units" name="n_l2tp_units">
<?php
- for ($x=0; $x<255; $x++) {
+ for ($x = 0; $x < 255; $x++) {
if ($x == $pconfig['n_l2tp_units']) {
$SELECTED = " selected=\"selected\"";
} else {
diff --git a/usr/local/www/vpn_l2tp_users.php b/usr/local/www/vpn_l2tp_users.php
index d45bb21..7ffc969 100644
--- a/usr/local/www/vpn_l2tp_users.php
+++ b/usr/local/www/vpn_l2tp_users.php
@@ -36,7 +36,7 @@
##|*MATCH=vpn_l2tp_users.php*
##|-PRIV
-$pgtitle = array(gettext("VPN"),gettext("L2TP"),gettext("Users"));
+$pgtitle = array(gettext("VPN"), gettext("L2TP"), gettext("Users"));
$shortcut_section = "l2tps";
require("guiconfig.inc");
diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php
index 4fa0f52..e132606 100644
--- a/usr/local/www/vpn_l2tp_users_edit.php
+++ b/usr/local/www/vpn_l2tp_users_edit.php
@@ -36,21 +36,21 @@
##|*MATCH=vpn_l2tp_users_edit.php*
##|-PRIV
-$pgtitle = array(gettext("VPN"),gettext("L2TP"),gettext("User"),gettext("Edit"));
+$pgtitle = array(gettext("VPN"), gettext("L2TP"), gettext("User"), gettext("Edit"));
$shortcut_section = "l2tps";
-function l2tpusercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
+function l2tpusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
}
-function l2tp_users_sort() {
+function l2tp_users_sort() {
global $config;
if (!is_array($config['l2tp']['user'])) {
return;
}
- usort($config['l2tp']['user'], "l2tpusercmp");
+ usort($config['l2tp']['user'], "l2tpusercmp");
}
require("guiconfig.inc");
@@ -86,7 +86,7 @@ if ($_POST) {
$reqdfieldsn = array(gettext("Username"));
} else {
$reqdfields = explode(" ", "usernamefld passwordfld");
- $reqdfieldsn = array(gettext("Username"),gettext("Password"));
+ $reqdfieldsn = array(gettext("Username"), gettext("Password"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index 969ba29..759aeae 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -499,7 +499,7 @@ if ($savemsg) {
<tr>
<td class="tabcont">
- <?php if ($act=="new" || $act=="edit"): ?>
+ <?php if ($act == "new" || $act == "edit"): ?>
<form action="vpn_openvpn_client.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general information">
diff --git a/usr/local/www/vpn_openvpn_csc.php b/usr/local/www/vpn_openvpn_csc.php
index 0211c2c..69dfd28 100644
--- a/usr/local/www/vpn_openvpn_csc.php
+++ b/usr/local/www/vpn_openvpn_csc.php
@@ -363,7 +363,7 @@ function netbios_change() {
<tr>
<td class="tabcont">
- <?php if ($act=="new" || $act=="edit"): ?>
+ <?php if ($act == "new" || $act == "edit"): ?>
<form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general information">
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index 9b70468..7688fa8 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -751,7 +751,7 @@ function tuntap_change() {
mindex = document.iform.mode.selectedIndex;
mvalue = document.iform.mode.options[mindex].value;
- switch( mvalue) {
+ switch (mvalue) {
case "p2p_tls":
case "p2p_shared_key":
p2p = true;
@@ -833,7 +833,7 @@ if ($savemsg) {
<tr>
<td class="tabcont">
- <?php if ($act=="new" || $act=="edit"): ?>
+ <?php if ($act == "new" || $act == "edit"): ?>
<form action="vpn_openvpn_server.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general information">
@@ -922,7 +922,7 @@ if ($savemsg) {
<?php
foreach ($openvpn_dev_mode as $device):
$selected = "";
- if (! empty($pconfig['dev_mode'])) {
+ if (!empty($pconfig['dev_mode'])) {
if ($pconfig['dev_mode'] == $device) {
$selected = "selected=\"selected\"";
}
diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php
index 082978a..4ad8d72 100644
--- a/usr/local/www/vpn_pppoe.php
+++ b/usr/local/www/vpn_pppoe.php
@@ -90,7 +90,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("VPN"),gettext("PPPoE"));
+$pgtitle = array(gettext("VPN"), gettext("PPPoE"));
$shortcut_section = "pppoes";
include("head.inc");
diff --git a/usr/local/www/vpn_pppoe_edit.php b/usr/local/www/vpn_pppoe_edit.php
index e0cc036..343c1f9 100644
--- a/usr/local/www/vpn_pppoe_edit.php
+++ b/usr/local/www/vpn_pppoe_edit.php
@@ -114,12 +114,12 @@ if ($_POST) {
/* input validation */
if ($_POST['mode'] == "server") {
$reqdfields = explode(" ", "localip remoteip");
- $reqdfieldsn = array(gettext("Server address"),gettext("Remote start address"));
+ $reqdfieldsn = array(gettext("Server address"), gettext("Remote start address"));
if ($_POST['radiusenable']) {
$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
$reqdfieldsn = array_merge($reqdfieldsn,
- array(gettext("RADIUS server address"),gettext("RADIUS shared secret")));
+ array(gettext("RADIUS server address"), gettext("RADIUS shared secret")));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -151,7 +151,7 @@ if ($_POST) {
$input_errors[] = sprintf(gettext("No password specified for username %s"), $_POST["username{$x}"]);
}
if ($_POST["ip{$x}"] <> "" && !is_ipaddr($_POST["ip{$x}"])) {
- $input_errors[] = sprintf(gettext("Incorrect ip address specified for username %s"), $_POST["username{$x}"]);
+ $input_errors[] = sprintf(gettext("Incorrect ip address specified for username %s"), $_POST["username{$x}"]);
}
}
}
@@ -290,8 +290,7 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
-function get_radio_value(obj)
-{
+function get_radio_value(obj) {
for (i = 0; i < obj.length; i++) {
if (obj[i].checked) {
return obj[i].value;
@@ -533,7 +532,7 @@ if ($savemsg) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS issued IPs"); ?></td>
<td width="78%" valign="top" class="vtable">
- <input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips" <?php if($pconfig['radiusissueips']) echo "checked=\"checked\""; ?> />
+ <input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips" <?php if ($pconfig['radiusissueips']) echo "checked=\"checked\""; ?> />
<br /><?=gettext("Issue IP Addresses via RADIUS server"); ?>.
</td>
</tr>
@@ -638,7 +637,7 @@ if ($savemsg) {
echo "<input type=\"hidden\" name=\"pppoeid\" id=\"pppoeid\" value=\"{$pppoeid}\" />";
}
?>
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
<a href="vpn_pppoe.php"><input name="Cancel" type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" /></a>
</td>
</tr>
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index e8f9e1f..adab493 100644
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -78,7 +78,7 @@ if (empty($xml)) {
}
if (!is_array($pkg)) {
- print_info_box_np(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."),$g['www_path'],$xml));
+ print_info_box_np(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."), $g['www_path'], $xml));
die;
}
@@ -135,7 +135,7 @@ if ($_POST && !$input_errors) {
function update_config_field($field, $updatetext, $unset, $arraynum, $field_type) {
global $config;
- $field_split = explode("->",$field);
+ $field_split = explode("->", $field);
foreach ($field_split as $f) {
$field_conv .= "['" . $f . "']";
}
@@ -200,8 +200,7 @@ if (file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css")) {
<script type="text/javascript">
//<![CDATA[
-function FieldValidate(userinput, regexp, message)
-{
+function FieldValidate(userinput, regexp, message) {
if (!userinput.match(regexp)) {
alert(message);
}
@@ -768,7 +767,7 @@ function showchange() {
sort($timezonelist);
/* kill carriage returns */
- for ($x=0; $x<count($timezonelist); $x++) {
+ for ($x = 0; $x < count($timezonelist); $x++) {
$timezonelist[$x] = str_replace("\n", "", $timezonelist[$x]);
}
@@ -876,7 +875,7 @@ function showchange() {
$aliases = "";
$addrisfirst = 0;
$aliasesaddr = "";
- if ($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias']))
+ if ($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) {
foreach ($config['aliases']['alias'] as $alias_name) {
if ($isfirst == 1) {
$aliases .= ",";
@@ -884,6 +883,7 @@ function showchange() {
$aliases .= "'" . $alias_name['name'] . "'";
$isfirst = 1;
}
+ }
?>
var customarray=new Array(<?php echo $aliases; ?>);
@@ -891,7 +891,7 @@ function showchange() {
window.onload = function () {
<?php
- $counter=0;
+ $counter = 0;
foreach ($inputaliases as $alias) {
echo "var oTextbox$counter = new AutoSuggestControl(document.getElementById(\"$alias\"), new StateSuggestions(customarray));\n";
$counter++;
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index a0fb72a..5fd022a 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -246,7 +246,7 @@ function restore_config_section_xmlrpc($raw_params) {
/* Log what happened */
$mergedkeys = implode(",", array_merge(array_keys($params[0]), $sync_full_done));
- write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
+ write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."), $mergedkeys));
/*
* The real work on handling the vips specially
@@ -341,7 +341,7 @@ function merge_installedpackages_section_xmlrpc($raw_params) {
}
$config['installedpackages'] = array_merge($config['installedpackages'], $params[0]);
$mergedkeys = implode(",", array_keys($params[0]));
- write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
+ write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."), $mergedkeys));
return $xmlrpc_g['return']['true'];
}
@@ -575,13 +575,13 @@ $server = new XML_RPC_Server(
unlock($xmlrpclockkey);
-function array_overlay($a1,$a2) {
+function array_overlay($a1, $a2) {
foreach ($a1 as $k => $v) {
- if (!array_key_exists($k,$a2)) {
+ if (!array_key_exists($k, $a2)) {
continue;
}
if (is_array($v) && is_array($a2[$k])) {
- $a1[$k] = array_overlay($v,$a2[$k]);
+ $a1[$k] = array_overlay($v, $a2[$k]);
} else {
$a1[$k] = $a2[$k];
}
OpenPOWER on IntegriCloud