summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-12-15 23:00:44 +0545
committerStephen Beaver <sbeaver@netgate.com>2015-12-15 12:25:11 -0500
commit8f65151c5beaee62d661af81bf96a93edaae22d9 (patch)
treef629ac10993774b9390f4eb5e95f8524661a020b /src/usr/local/www
parent2e3732ecdd5e9fa8bbc540729b869d99d00a45ad (diff)
downloadpfsense-8f65151c5beaee62d661af81bf96a93edaae22d9.zip
pfsense-8f65151c5beaee62d661af81bf96a93edaae22d9.tar.gz
Code style System Advanced
Diffstat (limited to 'src/usr/local/www')
-rw-r--r--src/usr/local/www/system.php28
-rw-r--r--src/usr/local/www/system_advanced_admin.php36
-rw-r--r--src/usr/local/www/system_advanced_misc.php8
-rw-r--r--src/usr/local/www/system_advanced_network.php11
-rw-r--r--src/usr/local/www/system_advanced_notifications.php8
-rw-r--r--src/usr/local/www/system_advanced_sysctl.php29
6 files changed, 69 insertions, 51 deletions
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php
index 051dcae..f51f5f5 100644
--- a/src/usr/local/www/system.php
+++ b/src/usr/local/www/system.php
@@ -80,7 +80,7 @@ list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $
$arr_gateways = return_gateways_array();
// set default colmns to two if unset
-if(!isset($config['system']['webgui']['dashboardcolumns'])) {
+if (!isset($config['system']['webgui']['dashboardcolumns'])) {
$config['system']['webgui']['dashboardcolumns'] = 2;
}
@@ -149,7 +149,7 @@ if ($_POST) {
} else {
unset($config['system']['webgui']['webguicss']);
}
-
+
if ($_POST['webguifixedmenu']) {
$config['system']['webgui']['webguifixedmenu'] = $_POST['webguifixedmenu'];
} else {
@@ -160,8 +160,8 @@ if ($_POST) {
$config['system']['webgui']['dashboardcolumns'] = $_POST['dashboardcolumns'];
} else {
unset($config['system']['webgui']['dashboardcolumns']);
- }
-
+ }
+
if ($_POST['hostname']) {
if (!is_hostname($_POST['hostname'])) {
$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'.");
@@ -340,11 +340,13 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("General Setup"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, success);
+}
?>
<div id="container">
<?php
@@ -371,8 +373,7 @@ $form->add($section);
$section = new Form_Section('DNS server settings');
-for ($i=1; $i<5; $i++)
-{
+for ($i=1; $i<5; $i++) {
// if (!isset($pconfig['dns'.$i]))
// continue;
@@ -391,12 +392,12 @@ for ($i=1; $i<5; $i++)
if ($multiwan) {
$options = array('none' => 'none');
- foreach($arr_gateways as $gwname => $gwitem) {
- if((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
+ foreach ($arr_gateways as $gwname => $gwitem) {
+ if ((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
continue;
}
- if((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
+ if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
continue;
}
@@ -414,8 +415,9 @@ for ($i=1; $i<5; $i++)
"When using multiple WAN connections there should be at least one unique DNS server per gateway.";
}
- if($i == 4)
+ if ($i == 4) {
$group->setHelp($help);
+ }
$section->add($group);
}
@@ -469,7 +471,7 @@ $csslist = array();
$css = glob("/usr/local/www/bootstrap/css/*.css");
foreach ($css as $file) {
$file = basename($file);
- if(substr($file, 0, 9) !== 'bootstrap') {
+ if (substr($file, 0, 9) !== 'bootstrap') {
$csslist[$file] = pathinfo($file, PATHINFO_FILENAME);
}
}
diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php
index 28edf97..5752515 100644
--- a/src/usr/local/www/system_advanced_admin.php
+++ b/src/usr/local/www/system_advanced_admin.php
@@ -266,8 +266,8 @@ if ($_POST) {
}
if (($sshd_enabled != $config['system']['enablesshd']) ||
- ($sshd_keyonly != $config['system']['sshdkeyonly']) ||
- ($sshd_port != $config['system']['ssh']['port'])) {
+ ($sshd_keyonly != $config['system']['sshdkeyonly']) ||
+ ($sshd_port != $config['system']['ssh']['port'])) {
$restart_sshd = true;
}
@@ -320,11 +320,13 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Admin Access"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, 'success');
+}
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
@@ -345,7 +347,7 @@ $group->add(new Form_Checkbox(
'webguiproto',
'Protocol',
'HTTP',
- ($pconfig['webguiproto']=='http'),
+ ($pconfig['webguiproto'] == 'http'),
'http'
))->displayAsRadio();
@@ -353,7 +355,7 @@ $group->add(new Form_Checkbox(
'webguiproto',
'Protocol',
'HTTPS',
- ($pconfig['webguiproto']=='https'),
+ ($pconfig['webguiproto'] == 'https'),
'https'
))->displayAsRadio();
@@ -364,8 +366,9 @@ $group->setHelp($certs_available ? '':'No Certificates have been defined. You mu
$section->add($group);
$values = array();
-foreach($a_cert as $cert)
+foreach ($a_cert as $cert) {
$values[ $cert['refid'] ] = $cert['descr'];
+}
$section->addInput($input = new Form_Select(
'ssl-certref',
@@ -421,10 +424,11 @@ $section->addInput(new Form_Checkbox(
))->setHelp('When this is checked, successful logins to the webConfigurator will '.
'not be logged.');
-if ($config['interfaces']['lan'])
+if ($config['interfaces']['lan']) {
$lockout_interface = "LAN";
-else
+} else {
$lockout_interface = "WAN";
+}
$section->addInput(new Form_Checkbox(
'noantilockout',
@@ -508,8 +512,7 @@ $section->addInput(new Form_Input(
))->setHelp('Note: Leave this blank for the default of 22.');
-if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom"))
-{
+if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
$form->add($section);
$section = new Form_Section('Serial Communications');
@@ -559,7 +562,7 @@ print $form;
?>
<script type="text/javascript">
//<![CDATA[
-events.push(function(){
+events.push(function() {
// ---------- On initial page load ------------------------------------------------------------
@@ -577,11 +580,11 @@ events.push(function(){
<?php
include("foot.inc");
-if ($restart_webgui)
+if ($restart_webgui) {
echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
+}
-if ($restart_sshd)
-{
+if ($restart_sshd) {
killbyname("sshd");
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
@@ -591,8 +594,7 @@ if ($restart_sshd)
}
}
-if ($restart_webgui)
-{
+if ($restart_webgui) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index 422ca6f..ff11032 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -301,11 +301,13 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Miscellaneous"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, success);
+}
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
@@ -561,7 +563,7 @@ if ($g['platform'] == "pfSense") {
$opts = array(0.5, 1, 2, 3, 4, 5, 7.5, 10, 15, 20, 30, 60);
$vals = array( 6, 12, 24, 36, 48, 60, 90, 120, 180, 240, 241, 242);
- $section->addINput(new Form_Select(
+ $section->addInput(new Form_Select(
'harddiskstandby',
'Hard disk standby time',
$pconfig['harddiskstandby'],
diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php
index 6a3f3f5..46b797c 100644
--- a/src/usr/local/www/system_advanced_network.php
+++ b/src/usr/local/www/system_advanced_network.php
@@ -174,10 +174,12 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Networking"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
-if ($savemsg)
+}
+if ($savemsg) {
print_info_box($savemsg);
+}
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
@@ -284,14 +286,13 @@ $section->addInput(new Form_Checkbox(
))->setHelp('This option will suppress ARP log messages when multiple interfaces '.
'reside on the same broadcast domain');
-if (get_freebsd_version() == 8)
-{
+if (get_freebsd_version() == 8) {
$section->addInput(new Form_Checkbox(
'flowtable',
'Enable flowtable support',
$pconfig['flowtable']
))->setHelp('Enables infrastructure for caching flows as a means of accelerating '.
- 'L3 and L2 lookupsas well as providing stateful load balancing when used with '.
+ 'L3 and L2 lookups as well as providing stateful load balancing when used with '.
'RADIX_MPATH.');
}
diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php
index bdc6034..16be2d5 100644
--- a/src/usr/local/www/system_advanced_notifications.php
+++ b/src/usr/local/www/system_advanced_notifications.php
@@ -183,7 +183,7 @@ if ($_POST) {
if (isset($_POST['test-growl'])) {
// Send test message via growl
if ($config['notifications']['growl']['ipaddress'] &&
- $config['notifications']['growl']['password'] = $_POST['password']) {
+ $config['notifications']['growl']['password'] = $_POST['password']) {
unlink_if_exists($g['vardb_path'] . "/growlnotices_lastmsg.txt");
register_via_growl();
notify_via_growl(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true);
@@ -202,11 +202,13 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Notifications"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, 'success');
+}
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
diff --git a/src/usr/local/www/system_advanced_sysctl.php b/src/usr/local/www/system_advanced_sysctl.php
index 8d1e0b0..822bb49 100644
--- a/src/usr/local/www/system_advanced_sysctl.php
+++ b/src/usr/local/www/system_advanced_sysctl.php
@@ -143,7 +143,7 @@ if ($_POST) {
$tunableent = array();
- if(!$_POST['tunable'] || !isset($_POST['value'])) {
+ if (!$_POST['tunable'] || !isset($_POST['value'])) {
$input_errors[] = gettext("Both a name and a value must be specified.");
} else if (!ctype_alnum($_POST['value'])) {
$input_errors[] = gettext("The value may contain alphanumeric characters only.");
@@ -169,14 +169,17 @@ if ($_POST) {
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("System Tunables"));
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
-if ($savemsg)
+if ($savemsg) {
print_info_box($savemsg, 'success');
+}
-if (is_subsystem_dirty('sysctl') && ($act != "edit" ))
+if (is_subsystem_dirty('sysctl') && ($act != "edit" )) {
print_info_box_np(gettext("The firewall tunables have changed. You must apply the configuration for them to take affect."));
+}
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
@@ -187,7 +190,7 @@ $tab_array[] = array(gettext("System Tunables"), true, "system_advanced_sysctl.p
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
-if ($act != "edit" ): ?>
+if ($act != "edit"): ?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title"><?=gettext('System Tunables'); ?></h2>
@@ -204,15 +207,21 @@ if ($act != "edit" ): ?>
<th><a class="btn btn-xs btn-primary" href="system_advanced_sysctl.php?act=edit"><?=gettext('New'); ?></a></th>
</tr>
</thead>
- <?php foreach ($tunables as $i => $tunable):
- if (!isset($tunable['modified']))
- $i = $tunable['tunable']; ?>
+ <?php
+ foreach ($tunables as $i => $tunable):
+ if (!isset($tunable['modified'])) {
+ $i = $tunable['tunable'];
+ }
+ ?>
<tr>
<td><?=$tunable['tunable']; ?></td>
<td><?=$tunable['descr']; ?></td>
<td><?=$tunable['value']; ?>
- <?php if($tunable['value'] == "default")
- echo "(" . get_default_sysctl_value($tunable['tunable']) . ")"; ?>
+ <?php
+ if ($tunable['value'] == "default") {
+ echo "(" . get_default_sysctl_value($tunable['tunable']) . ")";
+ }
+ ?>
</td>
<td>
<a class="fa fa-pencil" title="<?=gettext("Edit tunable"); ?>" href="system_advanced_sysctl.php?act=edit&amp;id=<?=$i;?>"></a>
OpenPOWER on IntegriCloud