summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-08-16 14:15:56 +0930
committerStephen Beaver <sbeaver@netgate.com>2016-08-16 09:22:10 -0400
commit3896b7328bd97acd3a2eb54f7eb6d2e981e3005d (patch)
tree8162e613c6660db1fb080a66fc2c89dd2ca90655 /src
parentad4ed096dd52ba6c677ee86ad59bfc6982c2f67f (diff)
downloadpfsense-3896b7328bd97acd3a2eb54f7eb6d2e981e3005d.zip
pfsense-3896b7328bd97acd3a2eb54f7eb6d2e981e3005d.tar.gz
Code style and comments
No functional change - just making style consistent (cherry picked from commit 9d3e8723171c727cf43338bd8e95ab2bb7e6a66c)
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/filter_log.inc4
-rw-r--r--src/etc/inc/pfsense-utils.inc2
-rw-r--r--src/etc/inc/upgrade_config.inc2
-rw-r--r--src/etc/inc/util.inc4
-rw-r--r--src/usr/local/www/classes/Form/Button.class.php4
-rw-r--r--src/usr/local/www/classes/Form/Group.class.php2
-rw-r--r--src/usr/local/www/classes/Form/Input.class.php4
-rw-r--r--src/usr/local/www/classes/Form/Section.class.php4
-rw-r--r--src/usr/local/www/classes/Form/Select.class.php8
-rw-r--r--src/usr/local/www/diag_dns.php4
-rw-r--r--src/usr/local/www/diag_edit.php6
-rw-r--r--src/usr/local/www/firewall_virtual_ip_edit.php2
-rw-r--r--src/usr/local/www/js/pfSense.js6
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js2
-rw-r--r--src/usr/local/www/pkg_mgr_install.php2
-rw-r--r--src/usr/local/www/services_dhcpv6_edit.php2
-rw-r--r--src/usr/local/www/services_router_advertisements.php6
-rw-r--r--src/usr/local/www/status_logs_filter_dynamic.php4
-rw-r--r--src/usr/local/www/system_advanced_misc.php2
-rw-r--r--src/usr/local/www/system_authservers.php16
-rw-r--r--src/usr/local/www/system_crlmanager.php2
-rw-r--r--src/usr/local/www/system_gateway_groups_edit.php2
-rw-r--r--src/usr/local/www/system_groupmanager.php4
-rw-r--r--src/usr/local/www/system_groupmanager_addprivs.php2
-rw-r--r--src/usr/local/www/system_update_settings.php3
-rw-r--r--src/usr/local/www/system_usermanager.php4
-rw-r--r--src/usr/local/www/system_usermanager_addprivs.php2
-rw-r--r--src/usr/local/www/vpn_openvpn_server.php2
-rw-r--r--src/usr/local/www/widgets/javascript/thermal_sensors.js8
-rw-r--r--src/usr/local/www/widgets/widgets/gmirror_status.widget.php2
-rw-r--r--src/usr/local/www/widgets/widgets/log.widget.php2
-rw-r--r--src/usr/local/www/widgets/widgets/ntp_status.widget.php4
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php6
-rw-r--r--src/usr/local/www/wizard.php4
-rw-r--r--src/usr/local/www/wizards/openvpn_wizard.inc4
-rw-r--r--src/usr/local/www/wizards/setup_wizard.xml44
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc42
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc42
38 files changed, 133 insertions, 132 deletions
diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc
index 1208711..693488f 100644
--- a/src/etc/inc/filter_log.inc
+++ b/src/etc/inc/filter_log.inc
@@ -255,7 +255,7 @@ function parse_vpn_login_log_line($line) {
if (!( (trim($flent['time']) == "") && (trim($flent['action']) == "") && (trim($flent['user']) == "") && (trim($flent['ip_address']) == "") )) {
return $flent;
} else {
- if($g['debug']) {
+ if ($g['debug']) {
log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line));
}
return "";
@@ -277,7 +277,7 @@ function parse_vpn_service_log_line($line) {
if (!( (trim($flent['time']) == "") && (trim($flent['type']) == "") && (trim($flent['message']) == "") )) {
return $flent;
} else {
- if($g['debug']) {
+ if ($g['debug']) {
log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line));
}
return "";
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc
index a061dc3..fbdd290 100644
--- a/src/etc/inc/pfsense-utils.inc
+++ b/src/etc/inc/pfsense-utils.inc
@@ -739,7 +739,7 @@ function get_filename_from_url($url) {
function get_dir($dir) {
$dir_array = array();
$d = dir($dir);
- if(!is_object($d)) {
+ if (!is_object($d)) {
return array();
}
while (false !== ($entry = $d->read())) {
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index 314796a..633cacc 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -4469,7 +4469,7 @@ function upgrade_142_to_143() {
if (is_array($config['filter']['separator'])) {
foreach ($config['filter']['separator'] as $interface => $separators) {
- if(is_array($separators)) {
+ if (is_array($separators)) {
foreach ($separators as $sepn => $separator) {
$seprow = substr($separator['row']['0'], 2);
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc
index e164881..24ffc5f 100644
--- a/src/etc/inc/util.inc
+++ b/src/etc/inc/util.inc
@@ -907,7 +907,7 @@ function check_subnetsv4_overlap($subnet1, $bits1, $subnet2, $bits2) {
$subnetv4_start1 = gen_subnetv4($subnet1, $largest_sn);
$subnetv4_start2 = gen_subnetv4($subnet2, $largest_sn);
- if($subnetv4_start1 == '' || $subnetv4_start2 == '') {
+ if ($subnetv4_start1 == '' || $subnetv4_start2 == '') {
// One or both args is not a valid IPv4 subnet
//FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed
return false;
@@ -922,7 +922,7 @@ function check_subnetsv6_overlap($subnet1, $bits1, $subnet2, $bits2) {
$subnetv6_start1 = gen_subnetv6($subnet1, $largest_sn);
$subnetv6_start2 = gen_subnetv6($subnet2, $largest_sn);
- if($subnetv6_start1 == '' || $subnetv6_start2 == '') {
+ if ($subnetv6_start1 == '' || $subnetv6_start2 == '') {
// One or both args is not a valid IPv6 subnet
//FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed
return false;
diff --git a/src/usr/local/www/classes/Form/Button.class.php b/src/usr/local/www/classes/Form/Button.class.php
index bc13e7a..3460588 100644
--- a/src/usr/local/www/classes/Form/Button.class.php
+++ b/src/usr/local/www/classes/Form/Button.class.php
@@ -71,11 +71,11 @@ class Form_Button extends Form_Input
$this->_tagName = 'a';
$this->addClass('btn-default');
unset($this->_attributes['type']);
- if(isset($icon)) {
+ if (isset($icon)) {
$this->_attributes['icon'] = $icon;
}
}
- else if(isset($icon))
+ else if (isset($icon))
{
$this->_tagSelfClosing = false;
$this->_tagName = 'button';
diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php
index 1b3aa40..361ceac 100644
--- a/src/usr/local/www/classes/Form/Group.class.php
+++ b/src/usr/local/www/classes/Form/Group.class.php
@@ -96,7 +96,7 @@ class Form_Group extends Form_Element
public function enableDuplication($max = null, $horiz = false)
{
- if($horiz)
+ if ($horiz)
$this->addClass('user-duplication-horiz'); // added buttons are 2 cols wide with no offset
else
$this->addClass('user-duplication'); // added buttons 10 cols wide with 2 col offset
diff --git a/src/usr/local/www/classes/Form/Input.class.php b/src/usr/local/www/classes/Form/Input.class.php
index 48188b3..5b2385a 100644
--- a/src/usr/local/www/classes/Form/Input.class.php
+++ b/src/usr/local/www/classes/Form/Input.class.php
@@ -241,7 +241,7 @@ class Form_Input extends Form_Element
// These methods required by pkg_edit and the wizards that map xml element definitions to Form elements
public function setOnclick($text)
{
- if($text)
+ if ($text)
$this->_attributes['onclick'] = $text;
return $this;
@@ -249,7 +249,7 @@ class Form_Input extends Form_Element
public function setOnchange($text)
{
- if($text)
+ if ($text)
$this->_attributes['onchange'] = $text;
return $this;
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php
index 133c7ba..2ccfe41 100644
--- a/src/usr/local/www/classes/Form/Section.class.php
+++ b/src/usr/local/www/classes/Form/Section.class.php
@@ -94,12 +94,12 @@ class Form_Section extends Form_Element
}
// Shortcut, adds a group with a password and a confirm password field.
- // The confirm password element is created by apprnding "_confirm" to the name supplied
+ // The confirm password element is created by appending "_confirm" to the name supplied
// The value is overwritten with a default pattern (So the user cannot see it)
public function addPassword(Form_Input $input)
{
$group = new Form_Group($input->getTitle());
- if($input->getValue() != "") {
+ if ($input->getValue() != "") {
$input->setValue(DMYPWD);
}
diff --git a/src/usr/local/www/classes/Form/Select.class.php b/src/usr/local/www/classes/Form/Select.class.php
index e64203c..b156793 100644
--- a/src/usr/local/www/classes/Form/Select.class.php
+++ b/src/usr/local/www/classes/Form/Select.class.php
@@ -79,15 +79,15 @@ class Form_Select extends Form_Input
$options = '';
foreach ($this->_values as $value => $name)
{
- // Things can get wierd if we have mixed types
+ // Things can get weird if we have mixed types
$sval = $this->_value;
- if( (gettype($value) == "integer") && (gettype($sval) == "string") )
+ if ((gettype($value) == "integer") && (gettype($sval) == "string"))
$value = strval($value);
- if (isset($this->_attributes['multiple']))
+ if (isset($this->_attributes['multiple'])) {
$selected = in_array($value, (array)$sval);
- else {
+ } else {
$selected = ($sval == $value);
}
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php
index 23a0525..17064d7 100644
--- a/src/usr/local/www/diag_dns.php
+++ b/src/usr/local/www/diag_dns.php
@@ -87,7 +87,7 @@ function resolve_host_addresses($host) {
$resolved = array();
$errreporting = error_reporting();
error_reporting($errreporting & ~E_WARNING);// dns_get_record throws a warning if nothing is resolved..
- foreach($recordtypes as $recordtype) {
+ foreach ($recordtypes as $recordtype) {
$tmp = dns_get_record($host, $recordtype);
if (is_array($tmp)) {
$dnsresult = array_merge($dnsresult, $tmp);
@@ -95,7 +95,7 @@ function resolve_host_addresses($host) {
}
error_reporting($errreporting);// restore original php warning/error settings.
- foreach($dnsresult as $item) {
+ foreach ($dnsresult as $item) {
$newitem = array();
$newitem['type'] = $item['type'];
switch ($item['type']) {
diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php
index 98dfb94..2cdb458 100644
--- a/src/usr/local/www/diag_edit.php
+++ b/src/usr/local/www/diag_edit.php
@@ -188,8 +188,8 @@ print_callout(gettext("The capabilities offered here can be dangerous. No suppor
// calculate start/end
var startPos = 0, endPos = tarea.value.length;
- for(var x = 0; x < lines.length; x++) {
- if(x == lineNum) {
+ for (var x = 0; x < lines.length; x++) {
+ if (x == lineNum) {
break;
}
startPos += (lines[x].length+1);
@@ -201,7 +201,7 @@ print_callout(gettext("The capabilities offered here can be dangerous. No suppor
// do selection
// Chrome / Firefox
- if(typeof(tarea.selectionStart) != "undefined") {
+ if (typeof(tarea.selectionStart) != "undefined") {
tarea.focus();
tarea.selectionStart = startPos;
tarea.selectionEnd = endPos;
diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php
index b506eb7..1a0eb19 100644
--- a/src/usr/local/www/firewall_virtual_ip_edit.php
+++ b/src/usr/local/www/firewall_virtual_ip_edit.php
@@ -465,7 +465,7 @@ $section->addInput(new Form_Input(
$pconfig['descr']
))->setHelp('A description may be entered here for administrative reference (not parsed).');
-if (isset($id) && $a_vip[$id]){
+if (isset($id) && $a_vip[$id]) {
$section->addInput(new Form_Input(
'id',
null,
diff --git a/src/usr/local/www/js/pfSense.js b/src/usr/local/www/js/pfSense.js
index 2f6aad0..2f9811e 100644
--- a/src/usr/local/www/js/pfSense.js
+++ b/src/usr/local/www/js/pfSense.js
@@ -175,10 +175,10 @@ $(function() {
// Use element title in the confirmation message, or if not available
// the element value
$('.btn-danger, .fa-trash').on('click', function(e){
- if(!($(this).hasClass('no-confirm'))) {
+ if (!($(this).hasClass('no-confirm'))) {
var msg = $.trim(this.textContent);
- if(!msg)
+ if (!msg)
var msg = $.trim(this.value).toLowerCase();
var q = 'Are you sure you wish to '+ msg +'?';
@@ -233,7 +233,7 @@ $(function() {
originalLeave.call(this, obj);
- if(self.$tip && self.$tip.length) {
+ if (self.$tip && self.$tip.length) {
container = self.$tip;
timeout = self.timeout;
container.one('mouseenter', function(){
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index 9ddabcf..56d659e 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -141,7 +141,7 @@ function hideLabel(text, hide) {
// Hides the '/' and the subnet mask of an Ip_Address/subnet_mask group
function hideMask(name, hide) {
- if(hide) {
+ if (hide) {
$('[id^=' + name + ']').hide();
$('[id^=' + name + ']').prev('span').hide();
$('[id^=' + name + ']').parent('div').removeClass('input-group');
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index 0126028..e5c1335 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -600,7 +600,7 @@ function get_firmware_versions()
json = jQuery.parseJSON(response);
- if(json) {
+ if (json) {
$('#installed_version').text(json.installed_version);
$('#version').text(json.version);
diff --git a/src/usr/local/www/services_dhcpv6_edit.php b/src/usr/local/www/services_dhcpv6_edit.php
index 2e15225..f17b420 100644
--- a/src/usr/local/www/services_dhcpv6_edit.php
+++ b/src/usr/local/www/services_dhcpv6_edit.php
@@ -275,7 +275,7 @@ $section->addInput(new Form_Input(
$pconfig['descr']
))->setHelp('A description may be entered here for administrative reference (not parsed).');
-if($netboot_enabled) {
+if ($netboot_enabled) {
$section->addInput(new Form_Input(
'filename',
'Netboot filename',
diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php
index eea6d89..5cd5c7c 100644
--- a/src/usr/local/www/services_router_advertisements.php
+++ b/src/usr/local/www/services_router_advertisements.php
@@ -348,8 +348,8 @@ $carplist = get_configured_vip_list("inet6", VIP_CARP);
$carplistif = array();
-if(count($carplist) > 0) {
- foreach($carplist as $ifname => $vip) {
+if (count($carplist) > 0) {
+ foreach ($carplist as $ifname => $vip) {
if (get_configured_vip_interface($ifname) == $if) {
$carplistif[$ifname] = $vip;
}
@@ -360,7 +360,7 @@ if (count($carplistif) > 0) {
$iflist = array();
$iflist['interface'] = strtoupper($if);
- foreach($carplistif as $ifname => $vip) {
+ foreach ($carplistif as $ifname => $vip) {
$iflist[$ifname] = get_vip_descr($vip) . " - " . $vip;
}
diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php
index c5b4992..bab7097 100644
--- a/src/usr/local/www/status_logs_filter_dynamic.php
+++ b/src/usr/local/www/status_logs_filter_dynamic.php
@@ -326,7 +326,7 @@ function update_table_rows(data) {
move = 0;
}
- if (($("#count").text() == 0) && (data.length < nentries)){
+ if (($("#count").text() == 0) && (data.length < nentries)) {
move += rows.length;
}
@@ -477,7 +477,7 @@ function toggleListDescriptions() {
<td><?=htmlspecialchars($filterent['proto'])?></td>
</tr>
<?php
- } // e-o-foreach()
+ } // e-o-foreach ()
if (count($filterlog) == 0) {
print '<tr class="text-nowrap"><td colspan=6>';
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index 8aeaed8..018c452 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -147,7 +147,7 @@ if ($_POST) {
$input_errors[] = gettext("The proxy username contains invalid characters.");
}
- if($_POST['proxypass'] != $_POST['proxypass_confirm']) {
+ if ($_POST['proxypass'] != $_POST['proxypass_confirm']) {
$input_errors[] = gettext("Proxy password and confirmation must match.");
}
diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php
index abca849..e5c5ee4 100644
--- a/src/usr/local/www/system_authservers.php
+++ b/src/usr/local/www/system_authservers.php
@@ -432,7 +432,7 @@ if ($_POST) {
}
// On error, restore the form contents so the user doesn't have to re-enter too much
-if($_POST && $input_errors) {
+if ($_POST && $input_errors) {
$pconfig = $_POST;
$pconfig['ldap_authcn'] = $_POST['ldapauthcontainers'];
$pconfig['ldap_template'] = $_POST['ldap_tmpltype'];
@@ -477,7 +477,7 @@ if (!($act == "new" || $act == "edit" || $input_errors)) {
</tr>
</thead>
<tbody>
- <?php foreach($a_server as $i => $server): ?>
+ <?php foreach ($a_server as $i => $server): ?>
<tr>
<td><?=htmlspecialchars($server['name'])?></td>
<td><?=htmlspecialchars($auth_server_types[$server['type']])?></td>
@@ -689,7 +689,7 @@ $section->add($group);
if (!isset($id)) {
$template_list = array();
- foreach($ldap_templates as $option => $template) {
+ foreach ($ldap_templates as $option => $template) {
$template_list[$option] = $template['desc'];
}
@@ -918,7 +918,7 @@ events.push(function() {
}
function set_ldap_port() {
- if($('#ldap_urltype').find(":selected").index() == 0)
+ if ($('#ldap_urltype').find(":selected").index() == 0)
$('#ldap_port').val('389');
else
$('#ldap_port').val('636');
@@ -926,7 +926,7 @@ events.push(function() {
// Hides all elements of the specified class. This will usually be a section
function hideClass(s_class, hide) {
- if(hide)
+ if (hide)
$('.' + s_class).hide();
else
$('.' + s_class).show();
@@ -959,18 +959,18 @@ events.push(function() {
hideClass('ldapanon', $('#ldap_anon').prop('checked'));
hideClass('extended', !$('#ldap_extended_enabled').prop('checked'));
- if($('#ldap_port').val() == "")
+ if ($('#ldap_port').val() == "")
set_ldap_port();
<?php
- if($act == 'edit') {
+ if ($act == 'edit') {
?>
$('#type option:not(:selected)').each(function(){
$(this).attr('disabled', 'disabled');
});
<?php
- if(!$input_errors) {
+ if (!$input_errors) {
?>
$('#name').prop("readonly", true);
<?php
diff --git a/src/usr/local/www/system_crlmanager.php b/src/usr/local/www/system_crlmanager.php
index cf0d313..48e05e9 100644
--- a/src/usr/local/www/system_crlmanager.php
+++ b/src/usr/local/www/system_crlmanager.php
@@ -353,7 +353,7 @@ function build_cacert_list() {
$list = array();
- foreach($ca_certs as $cert) {
+ foreach ($ca_certs as $cert) {
$list[$cert['refid']] = $cert['descr'];
}
diff --git a/src/usr/local/www/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php
index 075d07f..204cc29 100644
--- a/src/usr/local/www/system_gateway_groups_edit.php
+++ b/src/usr/local/www/system_gateway_groups_edit.php
@@ -371,7 +371,7 @@ $section->addInput(new Form_Input(
$pconfig['descr']
))->setHelp('A description may be entered here for administrative reference (not parsed).');
-if (isset($id) && $a_gateway_groups[$id]){
+if (isset($id) && $a_gateway_groups[$id]) {
$section->addInput(new Form_Input(
'id',
null,
diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php
index 09a5201..9e8248e 100644
--- a/src/usr/local/www/system_groupmanager.php
+++ b/src/usr/local/www/system_groupmanager.php
@@ -192,7 +192,7 @@ if (isset($_POST['save'])) {
}
/* Check the POSTed members to ensure they are valid and exist */
- if(is_array($_POST['members'])) {
+ if (is_array($_POST['members'])) {
foreach ($_POST['members'] as $newmember) {
if (!is_numeric($newmember) || empty(getUserEntryByUID($newmember))) {
$input_errors[] = gettext("One or more invalid group members was submitted.");
@@ -385,7 +385,7 @@ $form->addGlobal(new Form_Input(
$id
));
-if (isset($id) && $a_group[$id]){
+if (isset($id) && $a_group[$id]) {
$form->addGlobal(new Form_Input(
'id',
null,
diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php
index 4f7a2dc..ff0c95b 100644
--- a/src/usr/local/www/system_groupmanager_addprivs.php
+++ b/src/usr/local/www/system_groupmanager_addprivs.php
@@ -306,7 +306,7 @@ events.push(function() {
});
$('#filtertxt').keypress(function(e) {
- if(e.which == 13) {
+ if (e.which == 13) {
e.preventDefault();
$('#btnfilter').trigger('click');
}
diff --git a/src/usr/local/www/system_update_settings.php b/src/usr/local/www/system_update_settings.php
index ae79ecb..769b5ea 100644
--- a/src/usr/local/www/system_update_settings.php
+++ b/src/usr/local/www/system_update_settings.php
@@ -186,6 +186,7 @@ if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) {
'synconupgrade',
'Auto sync on update',
'Enable repository/branch sync before reboot',
+ 'Enable repository/branch sync before reboot',
isset($gitcfg['synconupgrade'])
))->setHelp('After updating, sync with the following repository/branch before reboot.');
@@ -227,7 +228,7 @@ if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) {
'<br />Note: Sync will not be performed if a branch is not specified.', [$lastbranch]);
$form->add($section);
-} // e-o-if(file_exista()
+} // e-o-if (file_exists())
print($form);
diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php
index f33a1f9..0184149 100644
--- a/src/usr/local/www/system_usermanager.php
+++ b/src/usr/local/www/system_usermanager.php
@@ -247,7 +247,7 @@ if ($_POST['save']) {
}
/* Check the POSTed groups to ensure they are valid and exist */
- if(is_array($_POST['groups'])) {
+ if (is_array($_POST['groups'])) {
foreach ($_POST['groups'] as $newgroup) {
if (empty(getGroupEntry($newgroup))) {
$input_errors[] = gettext("One or more invalid groups was submitted.");
@@ -890,7 +890,7 @@ if ($act == "new" || $act == "edit" || $input_errors):
$section->addClass('cert-options');
$nonPrvCas = array();
- foreach($config['ca'] as $ca) {
+ foreach ($config['ca'] as $ca) {
if (!$ca['prv']) {
continue;
}
diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php
index 306a389..e157693 100644
--- a/src/usr/local/www/system_usermanager_addprivs.php
+++ b/src/usr/local/www/system_usermanager_addprivs.php
@@ -310,7 +310,7 @@ events.push(function() {
});
$('#filtertxt').keypress(function(e) {
- if(e.which == 13) {
+ if (e.which == 13) {
e.preventDefault();
$('#btnfilter').trigger('click');
}
diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php
index 57b1040..e7b2af3 100644
--- a/src/usr/local/www/vpn_openvpn_server.php
+++ b/src/usr/local/www/vpn_openvpn_server.php
@@ -1259,7 +1259,7 @@ endif;
events.push(function() {
function advanced_change(hide, mode) {
- if(!hide) {
+ if (!hide) {
hideClass('advanced', false);
hideClass("clientadv", false);
} else if (mode == "p2p_tls") {
diff --git a/src/usr/local/www/widgets/javascript/thermal_sensors.js b/src/usr/local/www/widgets/javascript/thermal_sensors.js
index 70de0e9..448c05e 100644
--- a/src/usr/local/www/widgets/javascript/thermal_sensors.js
+++ b/src/usr/local/www/widgets/javascript/thermal_sensors.js
@@ -56,7 +56,7 @@ ajaxBusy = false;
//should be called from "thermal_sensors.widget.php"
function showThermalSensorsData() {
- if(!ajaxBusy) {
+ if (!ajaxBusy) {
ajaxBusy = true;
//get data from thermal_sensors.widget.php
url = "/widgets/widgets/thermal_sensors.widget.php?getThermalSensorsData=1"
@@ -86,7 +86,7 @@ function buildThermalSensorsData(thermalSensorsData) {
if (thermal_sensors_widget_showRawOutput) {
buildThermalSensorsDataRaw(thermalSensorsData);
} else {
- if(warningTemp == 9999) {
+ if (warningTemp == 9999) {
buildThermalSensorsDataGraph(thermalSensorsData);
}
@@ -224,11 +224,11 @@ function getThermalSensorValue(stringValue) {
function setTempProgress(bar, percent) {
var barTempL, barTempM, barTempH;
- if(percent <= warningTemp) {
+ if (percent <= warningTemp) {
barTempL = percent;
barTempM = 0;
barTempH = 0;
- } else if(percent <= criticalTemp) {
+ } else if (percent <= criticalTemp) {
barTempL = warningTemp;
barTempM = percent - warningTemp;
barTempH = 0;
diff --git a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
index 532f731..cf89cda 100644
--- a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
@@ -67,7 +67,7 @@ require_once("gmirror.inc");
<script type="text/javascript">
//<![CDATA[
-function gmirrorStatusUpdateFromServer(){
+function gmirrorStatusUpdateFromServer() {
$.ajax({
type: 'get',
url: '/widgets/widgets/gmirror_status.widget.php',
diff --git a/src/usr/local/www/widgets/widgets/log.widget.php b/src/usr/local/www/widgets/widgets/log.widget.php
index b844f9e..9b79692 100644
--- a/src/usr/local/www/widgets/widgets/log.widget.php
+++ b/src/usr/local/www/widgets/widgets/log.widget.php
@@ -207,7 +207,7 @@ if (isset($_GET['lastsawtime'])) {
<script type="text/javascript">
//<![CDATA[
-function logWidgetUpdateFromServer(){
+function logWidgetUpdateFromServer() {
$.ajax({
type: 'get',
url: '/widgets/widgets/log.widget.php',
diff --git a/src/usr/local/www/widgets/widgets/ntp_status.widget.php b/src/usr/local/www/widgets/widgets/ntp_status.widget.php
index 30a126a..99d6342 100644
--- a/src/usr/local/www/widgets/widgets/ntp_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/ntp_status.widget.php
@@ -223,7 +223,7 @@ if ($_REQUEST['updateme']) {
?>
<script type="text/javascript">
//<![CDATA[
-function ntpWidgetUpdateFromServer(){
+function ntpWidgetUpdateFromServer() {
$.ajax({
type: 'get',
url: '/widgets/widgets/ntp_status.widget.php',
@@ -239,7 +239,7 @@ function ntpWidgetUpdateFromServer(){
});
}
-function ntpWidgetUpdateDisplay(){
+function ntpWidgetUpdateDisplay() {
// Javascript handles overflowing
ntpServerTime.setSeconds(ntpServerTime.getSeconds()+1);
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php
index 3b509b1..290a4a5 100644
--- a/src/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/src/usr/local/www/widgets/widgets/system_information.widget.php
@@ -198,7 +198,7 @@ $filesystems = get_mounted_filesystems();
<ul style="margin-bottom:0px">
<?php
$dns_servers = get_dns_servers();
- foreach($dns_servers as $dns) {
+ foreach ($dns_servers as $dns) {
echo "<li>{$dns}</li>";
}
?>
@@ -370,7 +370,7 @@ function setTimer() {
function stats(x) {
var values = x.split("|");
- if ($.each(values,function(key,value){
+ if ($.each(values,function(key,value) {
if (value == 'undefined' || value == null)
return true;
else
@@ -502,7 +502,7 @@ function updateInterfaces(x) {
} else {
ipv4_details = details[2] + '<br />';
}
- switch(details[1]) {
+ switch (details[1]) {
case "up":
$('#' + details[0] + '-up').css("display","inline");
$('#' + details[0] + '-down').css("display","none");
diff --git a/src/usr/local/www/wizard.php b/src/usr/local/www/wizard.php
index a1c99dd..a61ed0d 100644
--- a/src/usr/local/www/wizard.php
+++ b/src/usr/local/www/wizard.php
@@ -883,8 +883,8 @@ if ($pkg['step'][$stepid]['fields']['field'] != "") {
break;
} // e-o-switch
- } // e-o-foreach(package)
-} // e-o- if(we have fields)
+ } // e-o-foreach (package)
+} // e-o-if (we have fields)
$form->add($section);
print($form);
diff --git a/src/usr/local/www/wizards/openvpn_wizard.inc b/src/usr/local/www/wizards/openvpn_wizard.inc
index 8d34af6..2ccf528 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.inc
+++ b/src/usr/local/www/wizards/openvpn_wizard.inc
@@ -216,7 +216,7 @@ function step7_submitphpaction() {
$canames = array();
$cacns = array();
if (is_array($config['ca'])) {
- foreach($config['ca'] as $ca) {
+ foreach ($config['ca'] as $ca) {
$canames[] = $ca['descr'];
$cainfo = cert_get_subject_hash($ca['crt']);
$cacns[] = $cainfo["CN"];
@@ -319,7 +319,7 @@ function step9_submitphpaction() {
$certnames = array();
$certcns = array();
if (is_array($config['cert'])) {
- foreach($config['cert'] as $cert) {
+ foreach ($config['cert'] as $cert) {
$certnames[] = $cert['descr'];
$certinfo = cert_get_subject_hash($cert['crt']);
$certcns[] = $certinfo["CN"];
diff --git a/src/usr/local/www/wizards/setup_wizard.xml b/src/usr/local/www/wizards/setup_wizard.xml
index 0e32ae0..a9d2637 100644
--- a/src/usr/local/www/wizards/setup_wizard.xml
+++ b/src/usr/local/www/wizards/setup_wizard.xml
@@ -148,28 +148,28 @@
</stepbeforeformdisplay>
<stepsubmitphpaction>
<![CDATA[
- if(empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) {
+ if (empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) {
include("head.inc");
$input_errors[] = "Hostname is invalid. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
+ if (empty($_POST['domain']) || !is_domain($_POST['domain'])) {
include("head.inc");
$input_errors[] = "Domain is invalid. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
+ if (!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
include("head.inc");
$input_errors[] = "Primary DNS server is invalid. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
+ if (!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
include("head.inc");
$input_errors[] = "Second DNS server is invalid. Please press back in the browser window and correct.";
print_input_errors($input_errors);
@@ -220,16 +220,16 @@
<description>On this screen the Wide Area Network information will be configured.</description>
<javascriptafterformdisplay>
var selectedItem = 0;
- if(document.forms[0].ipaddress.value == 'dhcp') {
+ if (document.forms[0].ipaddress.value == 'dhcp') {
selectedItem = 1;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'pppoe') {
+ } else if (document.forms[0].ipaddress.value == 'pppoe') {
selectedItem = 2;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'pptp') {
+ } else if (document.forms[0].ipaddress.value == 'pptp') {
selectedItem = 3;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
+ } else if (document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
document.forms[0].ipaddress.value = '';
} else {
selectedItem = 0;
@@ -239,7 +239,7 @@
events.push(function(){
$('#showpppoepassword').click(function(event) {
- if(this.checked) {
+ if (this.checked) {
$('#pppoepassword').attr('type', 'text');
} else {
$('#pppoepassword').attr('type', 'password');
@@ -247,7 +247,7 @@
});
$('#showpptppassword').click(function(event) {
- if(this.checked) {
+ if (this.checked) {
$('#pptppassword').attr('type', 'text');
} else {
$('#pptppassword').attr('type', 'password');
@@ -488,21 +488,21 @@
</stepbeforeformdisplay>
<stepsubmitphpaction>
<![CDATA[
- if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
+ if (!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
include("head.inc");
$input_errors[] = "MTU Must be at least 576 (Per RFC 791). Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
+ if (!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
include("head.inc");
$input_errors[] = "Invalid MAC Address. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
+ if (!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
if (!is_ipaddr($_POST['ipaddress'])) {
include("head.inc");
$input_errors[] = "Invalid WAN IP Address. Please press back in the browser window and correct.";
@@ -520,21 +520,21 @@
die;
}
}
- if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
+ if (!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
include("head.inc");
$input_errors[] = "Invalid DHCP Hostname. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
+ if (!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
include("head.inc");
$input_errors[] = "Invalid PPTP Local IP Address. Please press back in the browser window and correct.";
print_input_errors($input_errors);
include("foot.inc");
die;
}
- if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
+ if (!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
include("head.inc");
$input_errors[] = "Invalid PPTP Remote IP Address. Please press back in the browser window and correct.";
print_input_errors($input_errors);
@@ -584,14 +584,14 @@
</stepsubmitphpaction>
<stepsubmitbeforesave>
<![CDATA[
- if($_POST['selectedtype'] == "Static") {
+ if ($_POST['selectedtype'] == "Static") {
} else {
$_POST['ipaddress'] = $_POST['selectedtype'];
$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
write_config();
}
- if(!$config['interfaces']['lan']) {
+ if (!$config['interfaces']['lan']) {
header("Location: /wizard.php?xml=setup_wizard.xml&stepid=6&next=Next");
}
]]>
@@ -622,7 +622,7 @@
</fields>
<stepsubmitphpaction>
<![CDATA[
- if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
+ if (empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
print_info_box("Invalid LAN IP address. Please press back in the browser window and correct.");
die;
}
@@ -704,8 +704,8 @@
</fields>
<stepsubmitphpaction>
<![CDATA[
- if($_POST['adminpassword'] != "") {
- if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
+ if ($_POST['adminpassword'] != "") {
+ if ($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
$admin_user =& getUserEntryByUID(0);
local_user_set_password($admin_user, $_POST['adminpassword']);
local_user_set($admin_user);
@@ -783,7 +783,7 @@
<title>Wizard completed.</title>
<stepbeforeformdisplay>
<![CDATA[
- if($g['product_name'] <> 'pfSense') {
+ if ($g['product_name'] <> 'pfSense') {
header("Location: " . fixup_string("\$myurl"));
exit;
}
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 256efeb..5d87b7e 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -507,8 +507,8 @@ function step3_stepsubmitphpaction() {
if (!$_POST['enable'])
return;
- if($_POST['upstream_sip_server']) {
- if(!is_ipaddroralias($_POST['upstream_sip_server'])) {
+ if ($_POST['upstream_sip_server']) {
+ if (!is_ipaddroralias($_POST['upstream_sip_server'])) {
/* item is not an ip or alias. error out */
$savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue.");
$stepid--;
@@ -590,12 +590,12 @@ function step4_stepsubmitphpaction() {
global $stepid, $savemsg;
if ( $_POST['enable'] ) {
- if(!$_POST['bandwidth']) {
+ if (!$_POST['bandwidth']) {
$savemsg="A value for bandwidth must be specified.";
$stepid--;
return;
}
- if(!is_numeric($_POST['bandwidth'])) {
+ if (!is_numeric($_POST['bandwidth'])) {
$savemsg="The posted value is not a valid bandwidth.";
$stepid--;
return;
@@ -607,12 +607,12 @@ function step4_stepsubmitphpaction() {
return;
}
$bw = $_POST['bandwidth'];
- if($bw > 15 || $bw < 2) {
+ if ($bw > 15 || $bw < 2) {
$savemsg="Values should be between 2% and 15%!";
$stepid--;
return;
}
- if($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) {
+ if ($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) {
/* item is not an ip or alias. error out */
$savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue.");
$stepid--;
@@ -625,7 +625,7 @@ function step5_stepsubmitphpaction() {
if ( $_POST['enable'] ) {
if ($_POST['p2pcatchall']) {
- if(!is_numeric($_POST['bandwidth'])) {
+ if (!is_numeric($_POST['bandwidth'])) {
$savemsg="Posted value is not a valid bandwidth.";
$stepid--;
return;
@@ -636,7 +636,7 @@ function step5_stepsubmitphpaction() {
return;
}
$bw = $_POST['bandwidth'];
- if($bw > 15 || $bw < 2) {
+ if ($bw > 15 || $bw < 2) {
$savemsg="Values should be between 2% and 15%!";
$stepid--;
return;
@@ -677,10 +677,10 @@ function apply_all_chosen_items() {
* Doing it here makes sense since we can wipe the previous config only after
* the user decides to do so, finishing the wizard.
*/
- if(isset($config['shaper']['queue']))
+ if (isset($config['shaper']['queue']))
unset($config['shaper']['queue']);
/* XXX: This is redundant, because this should be handled by converter at startup. */
- if(isset($config['shaper']['rule']))
+ if (isset($config['shaper']['rule']))
unset($config['shaper']['rule']);
foreach ($config['filter']['rule'] as $key => $rule)
if ($rule['wizard'] == "yes")
@@ -1470,7 +1470,7 @@ function apply_all_chosen_items() {
/* Rules */
if ($penalty) {
- if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) {
+ if ( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) {
$rule = array();
$rule['type'] = "match";
$rule['interface'] = $interfacelist;
@@ -1488,7 +1488,7 @@ function apply_all_chosen_items() {
/* If user specifies an IP, we don't bother with providers */
if ($voip) {
- if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) {
+ if (is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) {
/* create VOIP rules */
$rule = array();
$rule['type'] = "match";
@@ -1518,7 +1518,7 @@ function apply_all_chosen_items() {
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
- } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) {
+ } elseif ( $config['ezshaper']['step3']['provider'] == "Generic" ) {
/* create VOIP rules */
$rule = array();
$rule['type'] = "match";
@@ -1549,7 +1549,7 @@ function apply_all_chosen_items() {
$rule['wizard'] = "yes";
$rule['enabled'] = "on";
$rule['destination']['port'] = $voip[2]."-".$voip[3];
- if($voip[1] != '')
+ if ($voip[1] != '')
$rule['protocol'] = $voip[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
@@ -1559,7 +1559,7 @@ function apply_all_chosen_items() {
/* loop through p2plist[] */
if ($p2p) {
- foreach($config['ezshaper']['step5'] as $key => $val) {
+ foreach ($config['ezshaper']['step5'] as $key => $val) {
if (!is_array($p2plist[$key]))
continue;
foreach ($p2plist[$key] as $p2pclient) {
@@ -1573,7 +1573,7 @@ function apply_all_chosen_items() {
$rule['floating'] = "yes";
$rule['wizard'] = "yes";
$rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3];
- if($p2pclient[1] != '')
+ if ($p2pclient[1] != '')
$rule['protocol'] = $p2pclient[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
@@ -1583,7 +1583,7 @@ function apply_all_chosen_items() {
/* loop through gamesplist[] */
if ($games) {
- foreach($config['ezshaper']['step6'] as $key => $val) {
+ foreach ($config['ezshaper']['step6'] as $key => $val) {
if (!is_array($gamesplist[$key]))
continue;
foreach ($gamesplist[$key] as $Gameclient) {
@@ -1600,7 +1600,7 @@ function apply_all_chosen_items() {
$rule['enabled'] = "on";
$rule['descr'] = "m_Game {$Gameclient[0]} outbound";
$rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3];
- if($Gameclient[1] != '')
+ if ($Gameclient[1] != '')
$rule['protocol'] = $Gameclient[1];
$config['filter']['rule'][] = $rule;
}
@@ -1609,7 +1609,7 @@ function apply_all_chosen_items() {
/* loop through othersplist[] */
if ($otherpriority) {
- foreach($config['ezshaper']['step7'] as $key => $val) {
+ foreach ($config['ezshaper']['step7'] as $key => $val) {
if (!is_array($othersplist[$key]))
continue;
foreach ($othersplist[$key] as $otherclient) {
@@ -1649,10 +1649,10 @@ function apply_all_chosen_items() {
$rule['enabled'] = "on";
$rule['descr'] = "m_Other {$otherclient[0]} outbound";
- if($otherclient[2] or $otherclient[3]) {
+ if ($otherclient[2] or $otherclient[3]) {
$rule['destination']['port'] = $otherclient[2]."-".$otherclient[3];
}
- if($otherclient[1] != '')
+ if ($otherclient[1] != '')
$rule['protocol'] = $otherclient[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index 1f33344..0e83047 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -561,8 +561,8 @@ function step3_stepsubmitphpaction() {
if (!$_POST['enable'])
return;
- if($_POST['upstream_sip_server']) {
- if(!is_ipaddroralias($_POST['upstream_sip_server'])) {
+ if ($_POST['upstream_sip_server']) {
+ if (!is_ipaddroralias($_POST['upstream_sip_server'])) {
/* item is not an ip or alias. error out */
$savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue.");
$stepid--;
@@ -658,13 +658,13 @@ function step4_stepsubmitphpaction() {
global $stepid, $savemsg;
if ( $_POST['enable'] ) {
- if(!$_POST['bandwidth']) {
+ if (!$_POST['bandwidth']) {
$savemsg="A value for bandwidth must be specified.";
$stepid--;
return;
}
- if(!is_numeric($_POST['bandwidth'])) {
+ if (!is_numeric($_POST['bandwidth'])) {
$savemsg="The posted value is not a valid bandwidth.";
$stepid--;
return;
@@ -675,12 +675,12 @@ function step4_stepsubmitphpaction() {
return;
}
$bw = $_POST['bandwidth'];
- if($bw > 15 || $bw < 2) {
+ if ($bw > 15 || $bw < 2) {
$savemsg="Values should be between 2% and 15%!";
$stepid--;
return;
}
- if($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) {
+ if ($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) {
/* item is not an ip or alias. error out */
$savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue.");
$stepid--;
@@ -692,7 +692,7 @@ function step5_stepsubmitphpaction() {
global $stepid, $savemsg;
if ( $_POST['enable'] ) {
if ($_POST['p2pcatchall']) {
- if(!is_numeric($_POST['bandwidth'])) {
+ if (!is_numeric($_POST['bandwidth'])) {
$savemsg="Posted value is not a valid bandwidth.";
$stepid--;
}
@@ -702,7 +702,7 @@ function step5_stepsubmitphpaction() {
return;
}
$bw = $_POST['bandwidth'];
- if($bw > 15 || $bw < 2) {
+ if ($bw > 15 || $bw < 2) {
$savemsg="Values should be between 2% and 15%!";
$stepid--;
return;
@@ -743,10 +743,10 @@ function apply_all_chosen_items() {
* Doing it here makes sense since we can wipe the previous config only after
* the user decides to do so, finishing the wizard.
*/
- if(isset($config['shaper']['queue']))
+ if (isset($config['shaper']['queue']))
unset($config['shaper']['queue']);
/* XXX: This is redundant, because this should be handled by converter at startup. */
- if(isset($config['shaper']['rule']))
+ if (isset($config['shaper']['rule']))
unset($config['shaper']['rule']);
foreach ($config['filter']['rule'] as $key => $rule)
if ($rule['wizard'] == "yes")
@@ -1558,7 +1558,7 @@ function apply_all_chosen_items() {
/* Rules */
if ($penalty) {
- if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) {
+ if (is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) {
$rule = array();
$rule['type'] = "match";
$rule['interface'] = $interfacelist;
@@ -1577,7 +1577,7 @@ function apply_all_chosen_items() {
/* If user specifies an IP, we don't bother with providers */
if ($voip) {
- if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) {
+ if (is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) {
/* create VOIP rules */
$rule = array();
$rule['type'] = "match";
@@ -1607,7 +1607,7 @@ function apply_all_chosen_items() {
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
- } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) {
+ } elseif ($config['ezshaper']['step3']['provider'] == "Generic") {
/* create VOIP rules */
$rule = array();
$rule['type'] = "match";
@@ -1638,7 +1638,7 @@ function apply_all_chosen_items() {
$rule['wizard'] = "yes";
$rule['enabled'] = "on";
$rule['destination']['port'] = $voip[2]."-".$voip[3];
- if($voip[1] != '')
+ if ($voip[1] != '')
$rule['protocol'] = $voip[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
@@ -1648,7 +1648,7 @@ function apply_all_chosen_items() {
/* loop through p2plist[] */
if ($p2p) {
- foreach($config['ezshaper']['step5'] as $key => $val) {
+ foreach ($config['ezshaper']['step5'] as $key => $val) {
if (!is_array($p2plist[$key]))
continue;
foreach ($p2plist[$key] as $p2pclient) {
@@ -1662,7 +1662,7 @@ function apply_all_chosen_items() {
$rule['floating'] = "yes";
$rule['wizard'] = "yes";
$rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3];
- if($p2pclient[1] != '')
+ if ($p2pclient[1] != '')
$rule['protocol'] = $p2pclient[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
@@ -1672,7 +1672,7 @@ function apply_all_chosen_items() {
/* loop through gamesplist[] */
if ($games) {
- foreach($config['ezshaper']['step6'] as $key => $val) {
+ foreach ($config['ezshaper']['step6'] as $key => $val) {
if (!is_array($gamesplist[$key]))
continue;
foreach ($gamesplist[$key] as $Gameclient) {
@@ -1689,7 +1689,7 @@ function apply_all_chosen_items() {
$rule['enabled'] = "on";
$rule['descr'] = "m_Game {$Gameclient[0]} outbound";
$rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3];
- if($Gameclient[1] != '')
+ if ($Gameclient[1] != '')
$rule['protocol'] = $Gameclient[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
@@ -1699,7 +1699,7 @@ function apply_all_chosen_items() {
/* loop through othersplist[] */
if ($otherpriority) {
- foreach($config['ezshaper']['step7'] as $key => $val) {
+ foreach ($config['ezshaper']['step7'] as $key => $val) {
if (!is_array($othersplist[$key]))
continue;
foreach ($othersplist[$key] as $otherclient) {
@@ -1739,10 +1739,10 @@ function apply_all_chosen_items() {
$rule['enabled'] = "on";
$rule['descr'] = "m_Other {$otherclient[0]} outbound";
- if($otherclient[2] or $otherclient[3]) {
+ if ($otherclient[2] or $otherclient[3]) {
$rule['destination']['port'] = $otherclient[2]."-".$otherclient[3];
}
- if($otherclient[1] != '')
+ if ($otherclient[1] != '')
$rule['protocol'] = $otherclient[1];
$rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard"));
$config['filter']['rule'][] = $rule;
OpenPOWER on IntegriCloud