diff options
-rw-r--r-- | src/usr/local/www/services_igmpproxy.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/services_igmpproxy_edit.php | 18 | ||||
-rw-r--r-- | src/usr/local/www/services_ntpd.php | 12 | ||||
-rw-r--r-- | src/usr/local/www/services_ntpd_gps.php | 14 | ||||
-rw-r--r-- | src/usr/local/www/services_ntpd_pps.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/services_pppoe.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/services_pppoe_edit.php | 33 | ||||
-rw-r--r-- | src/usr/local/www/services_rfc2136.php | 21 | ||||
-rw-r--r-- | src/usr/local/www/services_rfc2136_edit.php | 23 | ||||
-rw-r--r-- | src/usr/local/www/services_router_advertisements.php | 17 | ||||
-rw-r--r-- | src/usr/local/www/services_snmp.php | 21 | ||||
-rw-r--r-- | src/usr/local/www/services_unbound.php | 15 | ||||
-rw-r--r-- | src/usr/local/www/services_unbound_acls.php | 45 | ||||
-rw-r--r-- | src/usr/local/www/services_unbound_domainoverride_edit.php | 3 | ||||
-rw-r--r-- | src/usr/local/www/services_unbound_host_edit.php | 20 | ||||
-rw-r--r-- | src/usr/local/www/services_wol.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/services_wol_edit.php | 3 |
17 files changed, 160 insertions, 117 deletions
diff --git a/src/usr/local/www/services_igmpproxy.php b/src/usr/local/www/services_igmpproxy.php index afcc8f2..df1f560 100644 --- a/src/usr/local/www/services_igmpproxy.php +++ b/src/usr/local/www/services_igmpproxy.php @@ -101,11 +101,13 @@ if ($_GET['act'] == "del") { $pgtitle = array(gettext("Services"), gettext("IGMP Proxy")); include("head.inc"); -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} -if (is_subsystem_dirty('igmpproxy')) +if (is_subsystem_dirty('igmpproxy')) { print_info_box_np(gettext('The IGMP entry list has been changed.' . '<br />' . 'You must apply the changes in order for them to take effect.')); +} ?> <form action="services_igmpproxy.php" method="post"> @@ -137,7 +139,7 @@ foreach ($a_igmpproxy as $igmpentry): $addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10)); print($addresses); - if(count($addresses) < 10) { + if (count($addresses) < 10) { print(' '); } else { print('...'); diff --git a/src/usr/local/www/services_igmpproxy_edit.php b/src/usr/local/www/services_igmpproxy_edit.php index f7b3e1b..371b85a 100644 --- a/src/usr/local/www/services_igmpproxy_edit.php +++ b/src/usr/local/www/services_igmpproxy_edit.php @@ -114,7 +114,7 @@ if ($_POST) { /* item is a normal igmpentry type */ $x = 0; - while($_POST["address{$x}"]) { + while ($_POST["address{$x}"]) { if ($isfirst > 0) { $address .= " "; @@ -151,8 +151,9 @@ if ($_POST) { include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} // These two inputs appear in the original file. Don't know what they are for // but they are here just in case. @@ -178,8 +179,9 @@ $section = new Form_Section('IGMP Proxy Edit'); $optionlist = array(); $iflist = get_configured_interface_with_descr(); -foreach ($iflist as $ifnam => $ifdescr) +foreach ($iflist as $ifnam => $ifdescr) { $optionlist[$ifnam] = $ifdescr; +} $section->addInput(new Form_Select( 'ifname', @@ -202,7 +204,7 @@ $section->addInput(new Form_Select( ['upstream' => gettext('Upstream Interface'), 'downstream' => gettext('Downstream Interface')] ))->setHelp('The upstream network interface is the outgoing interface which is responsible for communicating to available multicast data sources .' . 'There can only be one upstream interface.' . '<br />' . - 'Downstream network interfaces are the distribution interfaces to the destination networks, where multicast clients can join groups and '. + 'Downstream 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.'); $section->addInput(new Form_Input( @@ -213,7 +215,7 @@ $section->addInput(new Form_Input( ))->setHelp('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.'); -if (isset($id) && $a_igmpproxy[$id]){ +if (isset($id) && $a_igmpproxy[$id]) { $section->addInput(new Form_Input( 'id', null, @@ -232,13 +234,13 @@ $address = $pconfig['address']; $item = explode(" ", $address); $rows = count($item) -1; -foreach($item as $ww) { +foreach ($item as $ww) { $address = $item[$counter]; $address_subnet = ""; $item2 = explode("/", $address); - foreach($item2 as $current) { - if($item2[1] != "") { + foreach ($item2 as $current) { + if ($item2[1] != "") { $address = $item2[0]; $address_subnet = $item2[1]; } diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php index bf9b518..e672f99 100644 --- a/src/usr/local/www/services_ntpd.php +++ b/src/usr/local/www/services_ntpd.php @@ -72,7 +72,7 @@ if (!is_array($config['ntpd'])) { if (empty($config['ntpd']['interface'])) { if (is_array($config['installedpackages']['openntpd']) && is_array($config['installedpackages']['openntpd']['config']) && - is_array($config['installedpackages']['openntpd']['config'][0]) && !empty($config['installedpackages']['openntpd']['config'][0]['interface'])) { + is_array($config['installedpackages']['openntpd']['config'][0]) && !empty($config['installedpackages']['openntpd']['config'][0]['interface'])) { $pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']); unset($config['installedpackages']['openntpd']); write_config("Upgraded settings from openttpd"); @@ -269,10 +269,12 @@ $pgtitle = array(gettext("Services"), gettext("NTP"), gettext("NTP")); $shortcut_section = "ntp"; 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("NTP"), true, "services_ntpd.php"); @@ -296,7 +298,7 @@ $section->addInput(new Form_Select( 'Selecting no interfaces will listen on all interfaces with a wildcard.' . '<br />' . 'Selecting all interfaces will explicitly listen on only the interfaces/IPs specified.'); -$timeservers = explode( ' ', $config['system']['timeservers']); +$timeservers = explode(' ', $config['system']['timeservers']); $maxrows = max(count($timeservers), 1); for ($counter=0; $counter < $maxrows; $counter++) { $group = new Form_Group($counter == 0 ? 'Time servers':''); @@ -504,7 +506,7 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // Make the ‘clear’ button a plain button, not a submit button $('#btnadvstats').prop('type','button'); diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php index 7bfbde7..5afc183 100644 --- a/src/usr/local/www/services_ntpd_gps.php +++ b/src/usr/local/www/services_ntpd_gps.php @@ -208,12 +208,14 @@ function build_nmea_list() { $nmealist['options'][4] = 'GLL'; $nmealist['options'][8] = 'ZDA or ZDG'; - if(!$pconfig['nmea']) + if (!$pconfig['nmea']) { array_push($nmealist['selected'], 0); + } - foreach($nmealist['options'] as $val => $opt) { - if($pconfig['nmea'] & $val) + foreach ($nmealist['options'] as $val => $opt) { + if ($pconfig['nmea'] & $val) { array_push($nmealist['selected'], $val); + } } return($nmealist); @@ -261,7 +263,7 @@ if (!empty($serialports)) { $splist = array(); foreach ($serialports as $port) { - $shortport = substr($port,5); + $shortport = substr($port, 5); $splist[$shortport] = $shortport; } @@ -424,13 +426,13 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { function NMEAChecksum(cmd) { // Compute the checksum by XORing all the character values in the string. var checksum = 0; - for(var i = 0; i < cmd.length; i++) { + for (var i = 0; i < cmd.length; i++) { checksum = checksum ^ cmd.charCodeAt(i); } // Convert it to hexadecimal (base-16, upper case, most significant byte first). diff --git a/src/usr/local/www/services_ntpd_pps.php b/src/usr/local/www/services_ntpd_pps.php index 615c5d7..98c1b37 100644 --- a/src/usr/local/www/services_ntpd_pps.php +++ b/src/usr/local/www/services_ntpd_pps.php @@ -137,11 +137,13 @@ $pgtitle = array(gettext("Services"), gettext("NTP"), gettext("PPS")); $shortcut_section = "ntp"; 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("NTP"), false, "services_ntpd.php"); @@ -168,7 +170,7 @@ if (!empty($serialports)) { $splist = array(); foreach ($serialports as $port) { - $shortport = substr($port,5); + $shortport = substr($port, 5); $splist[$shortport] = $shortport; } diff --git a/src/usr/local/www/services_pppoe.php b/src/usr/local/www/services_pppoe.php index 090e4df..109520b 100644 --- a/src/usr/local/www/services_pppoe.php +++ b/src/usr/local/www/services_pppoe.php @@ -113,15 +113,17 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array(gettext("Services"),gettext("PPPoE Server")); +$pgtitle = array(gettext("Services"), gettext("PPPoE Server")); $shortcut_section = "pppoes"; include("head.inc"); -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} -if (is_subsystem_dirty('vpnpppoe')) +if (is_subsystem_dirty('vpnpppoe')) { print_info_box_np(gettext('The PPPoE entry list has been changed') . '.<br />' . gettext('You must apply the changes in order for them to take effect.')); +} ?> <div class="table-responsive"> diff --git a/src/usr/local/www/services_pppoe_edit.php b/src/usr/local/www/services_pppoe_edit.php index f358749..38b7d2f 100644 --- a/src/usr/local/www/services_pppoe_edit.php +++ b/src/usr/local/www/services_pppoe_edit.php @@ -162,7 +162,7 @@ if ($_POST) { $subnet_start = ip2ulong($_POST['remoteip']); $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['pppoe_subnet'] - 1; if ((ip2ulong($_POST['localip']) >= $subnet_start) && - (ip2ulong($_POST['localip']) <= $subnet_end)) { + (ip2ulong($_POST['localip']) <= $subnet_end)) { $input_errors[] = gettext("The specified server address lies in the remote subnet."); } if ($_POST['localip'] == get_interface_ip($_POST['interface'])) { @@ -292,21 +292,24 @@ function build_interface_list() { $interfaces = get_configured_interface_with_descr(); - foreach ($interfaces as $iface => $ifacename) + foreach ($interfaces as $iface => $ifacename) { $list[$iface] = $ifacename; + } return($list); } -$pgtitle = array(gettext("Services"),gettext("PPPoE Server"), gettext("Edit")); +$pgtitle = array(gettext("Services"), gettext("PPPoE Server"), gettext("Edit")); $shortcut_section = "pppoes"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} $form = new Form(); @@ -431,7 +434,7 @@ $group->add(new Form_Input( null, 'text', $pconfig['radiusserverport'] -))->setHelp('Authentication port '); +))->setHelp('Authentication port'); $group->add(new Form_Input( 'radiusserveracctport', @@ -464,7 +467,7 @@ $group->add(new Form_Input( null, 'text', $pconfig['radiusserver2port'] -))->setHelp('Authentication port '); +))->setHelp('Authentication port'); $group->add(new Form_Input( 'radiusserver2acctport', @@ -492,15 +495,16 @@ $usernames = $pconfig['username']; //DEBUG //$usernames = 'sbeaver:TXlQYXNzd2Q=:192.168.1.1 smith:TXlQYXNzd2Q=:192.168.2.1 sjones:TXlQYXNzd2Q=:192.168.3.1 salpha:TXlQYXNzd2Q=:192.168.4.1'; -if($usernames == "") +if ($usernames == "") { $usernames = '::'; +} -if ($usernames != ""){ +if ($usernames != "") { $item = explode(" ", $usernames); $numrows = count($item) -1; - foreach($item as $ww) { + foreach ($item as $ww) { $wws = explode(":", $ww); $user = $wws[0]; $passwd = base64_decode($wws[1]); @@ -553,7 +557,7 @@ $section->addInput(new Form_StaticText( )); // Hidden fields -if(isset($id)) { +if (isset($id)) { $section->addInput(new Form_Input( 'id', null, @@ -579,7 +583,7 @@ print_info_box(gettext('Don\'t forget to add a firewall rule to permit traffic f ?> <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // show/hide radius server controls function hide_radius(hide) { @@ -607,10 +611,11 @@ events.push(function(){ // When the RADIUS checkbox is clicked . . $('#radiusenable').click(function () { hide_radius(!$('#radiusenable').prop('checked')); - if(!$('#radiusenable').prop('checked')) + if (!$('#radiusenable').prop('checked')) { hide_radius2(true); - else + } else { hide_radius2(!$('#radiussecenable').prop('checked')); + } }); // When the 'Use backup RADIUS' checkbox is clicked . . diff --git a/src/usr/local/www/services_rfc2136.php b/src/usr/local/www/services_rfc2136.php index 59416de..0649abd 100644 --- a/src/usr/local/www/services_rfc2136.php +++ b/src/usr/local/www/services_rfc2136.php @@ -75,8 +75,7 @@ if ($_GET['act'] == "del") { header("Location: services_rfc2136.php"); exit; -} -else if ($_GET['act'] == "toggle") { +} else if ($_GET['act'] == "toggle") { if ($a_rfc2136[$_GET['id']]) { if (isset($a_rfc2136[$_GET['id']]['enable'])) { unset($a_rfc2136[$_GET['id']]['enable']); @@ -98,8 +97,9 @@ $tab_array[] = array(gettext("Dynamic DNS"), false, "services_dyndns.php"); $tab_array[] = array(gettext("RFC 2136"), true, "services_rfc2136.php"); display_top_tabs($tab_array); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} ?> <form action="services_rfc2136.php" method="post" name="iform" id="iform"> @@ -147,18 +147,20 @@ foreach ($a_rfc2136 as $rfc2136): if (file_exists($filename)) { print('IPv4: '); - if (isset($rfc2136['usepublicip'])) + if (isset($rfc2136['usepublicip'])) { $ipaddr = dyndnsCheckIP($rfc2136['interface']); - else + } else { $ipaddr = get_interface_ip($rfc2136['interface']); + } $cached_ip_s = explode("|", file_get_contents($filename)); $cached_ip = $cached_ip_s[0]; - if ($ipaddr != $cached_ip) + if ($ipaddr != $cached_ip) { print('<span class="text-danger">'); - else + } else { print('<span class="text-success">'); + } print(htmlspecialchars($cached_ip)); print('</span>'); @@ -174,10 +176,11 @@ foreach ($a_rfc2136 as $rfc2136): $cached_ip_s = explode("|", file_get_contents("{$filename}.ipv6")); $cached_ip = $cached_ip_s[0]; - if ($ipaddr != $cached_ip) + if ($ipaddr != $cached_ip) { print('<span class="text-danger">'); - else + } else { print('<span class="text-success">'); + } print(htmlspecialchars($cached_ip)); print('</span>'); diff --git a/src/usr/local/www/services_rfc2136_edit.php b/src/usr/local/www/services_rfc2136_edit.php index fa244a1..0c0548a 100644 --- a/src/usr/local/www/services_rfc2136_edit.php +++ b/src/usr/local/www/services_rfc2136_edit.php @@ -160,11 +160,13 @@ if ($_POST) { $pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("RFC 2136 Client"), gettext("Edit")); include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg); +} $form = new Form; @@ -180,8 +182,9 @@ $section->addInput(new Form_Checkbox( $optionlist = array(); $iflist = get_configured_interface_with_descr(); -foreach ($iflist as $ifnam => $ifdescr) +foreach ($iflist as $ifnam => $ifdescr) { $optionlist[$ifnam] = $ifdescr; +} $section->addInput(new Form_Select( 'interface', @@ -217,7 +220,7 @@ $group->add(new Form_Checkbox( 'keytype', 'Key Type', 'Zone', - ($pconfig['keytype']=='zone'), + ($pconfig['keytype'] == 'zone'), 'zone' ))->displayAsRadio(); @@ -225,7 +228,7 @@ $group->add($input = new Form_Checkbox( 'keytype', 'Key Type', 'Host', - ($pconfig['keytype']=='host'), + ($pconfig['keytype'] == 'host'), 'host' ))->displayAsRadio(); @@ -233,7 +236,7 @@ $group->add($input = new Form_Checkbox( 'keytype', 'Key Type', 'User', - ($pconfig['keytype']=='user'), + ($pconfig['keytype'] == 'user'), 'user' ))->displayAsRadio(); @@ -273,7 +276,7 @@ $group->add(new Form_Checkbox( 'recordtype', 'Record Type', 'A (IPv4)', - ($pconfig['recordtype']=='A'), + ($pconfig['recordtype'] == 'A'), 'A' ))->displayAsRadio(); @@ -281,7 +284,7 @@ $group->add($input = new Form_Checkbox( 'recordtype', 'Record Type', 'AAAA (IPv6)', - ($pconfig['recordtype']=='AAAA'), + ($pconfig['recordtype'] == 'AAAA'), 'AAAA' ))->displayAsRadio(); @@ -289,7 +292,7 @@ $group->add($input = new Form_Checkbox( 'recordtype', 'Record Type', 'Both', - ($pconfig['recordtype']=='both'), + ($pconfig['recordtype'] == 'both'), 'both' ))->displayAsRadio(); @@ -302,7 +305,7 @@ $section->addInput(new Form_Input( $pconfig['descr'] ))->setHelp('You may enter a description here for your reference (not parsed).'); -if (isset($id) && $a_rfc2136[$id]){ +if (isset($id) && $a_rfc2136[$id]) { $section->addInput(new Form_Input( 'id', null, diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php index da1c640..1693b4a 100644 --- a/src/usr/local/www/services_router_advertisements.php +++ b/src/usr/local/www/services_router_advertisements.php @@ -103,7 +103,7 @@ if (!$if || !isset($iflist[$if])) { foreach ($iflist as $ifent => $ifname) { $oc = $config['interfaces'][$ifent]; if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) || - (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) { + (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) { continue; } $if = $ifent; @@ -227,11 +227,13 @@ $pgtitle = array(gettext("Services"), gettext("Router Advertisements")); include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} /* active tabs */ $tab_array = array(); @@ -241,7 +243,7 @@ foreach ($iflist as $ifent => $ifname) { $oc = $config['interfaces'][$ifent]; // We need at least one interface configured with a NON-LOCAL IPv6 static address. fd80:8dba:82e1::/64 fits the bill if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) || - (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) { + (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) { continue; } @@ -324,8 +326,9 @@ $section->addInput(new Form_StaticText( )); -if(empty($pconfig['subnets'])) +if (empty($pconfig['subnets'])) { $pconfig['subnets'] = array('0' => '/128'); +} $counter = 0; $numrows = count($pconfig['subnets']) - 1; @@ -364,7 +367,7 @@ $form->add($section); $section = new Form_Section('DNS Configuration'); -for($idx=1; $idx<=3; $idx++) { +for ($idx=1; $idx<=3; $idx++) { $section->addInput(new Form_IpAddress( 'radns' . $idx, 'Server ' . $idx, @@ -400,7 +403,7 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // Suppress "Delete row" button if there are fewer than two rows checkLastRow(); diff --git a/src/usr/local/www/services_snmp.php b/src/usr/local/www/services_snmp.php index 67f5efb..f11c90f 100644 --- a/src/usr/local/www/services_snmp.php +++ b/src/usr/local/www/services_snmp.php @@ -213,11 +213,13 @@ $shortcut_section = "snmp"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg); +} $form = new Form(); @@ -277,10 +279,11 @@ $form->add($section); $section = new Form_Section('SNMP Trap settings'); -if($pconfig['trapenable']) +if ($pconfig['trapenable']) { $section->addClass('toggle-traps', 'in'); -else +} else { $section->addClass('toggle-traps', 'collapse'); +} $section->addInput(new Form_Input( 'trapserver', @@ -372,7 +375,7 @@ print($form); //<![CDATA[ // hostres requires mibii so we force that here -events.push(function(){ +events.push(function() { noMibii = false; @@ -380,7 +383,7 @@ events.push(function(){ hostresChange(); function hostresChange() { - if($('#hostres').prop('checked')) { + if ($('#hostres').prop('checked')) { $('#mibii').prop('checked', true); noMibii = true; } else { @@ -388,13 +391,13 @@ events.push(function(){ } } - $('#hostres').change(function(){ + $('#hostres').change(function() { hostresChange(); }); - $('#mibii').change(function(){ - if(noMibii) { + $('#mibii').change(function() { + if (noMibii) { $('#mibii').prop('checked', 'true'); } }); diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index 17e7f33..ccef9f2 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -238,8 +238,9 @@ function build_if_list($selectedifs) { foreach ($interface_addresses as $laddr => $ldescr) { $iflist['options'][$laddr] = htmlspecialchars($ldescr); - if ($selectedifs && in_array($laddr, $selectedifs)) + if ($selectedifs && in_array($laddr, $selectedifs)) { array_push($iflist['selected'], $laddr); + } } unset($interface_addresses); @@ -253,11 +254,13 @@ $shortcut_section = "resolver"; include_once("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('unbound')) { print_info_box_np(gettext("The configuration of the DNS Resolver has been changed. You must apply changes for them to take effect.")); @@ -374,7 +377,7 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // If the enable checkbox is not checked, disable the next three checkboxes function disableDHCP() { @@ -407,7 +410,7 @@ events.push(function(){ }); // On initial load - if($('#custom_options').val().length == 0) { + if ($('#custom_options').val().length == 0) { hideInput('custom_options', true); } @@ -551,7 +554,7 @@ endforeach; " entered in %sSystem: General setup%s". " or those obtained via DHCP or PPP on WAN if "Allow". " DNS server list to be overridden by DHCP/PPP on WAN"". - " is checked."),'<a href="system.php">','</a>'), info)?> + " is checked."), '<a href="system.php">', '</a>'), info)?> </div> <?php include("foot.inc"); diff --git a/src/usr/local/www/services_unbound_acls.php b/src/usr/local/www/services_unbound_acls.php index b85565d..94e3d83 100644 --- a/src/usr/local/www/services_unbound_acls.php +++ b/src/usr/local/www/services_unbound_acls.php @@ -109,12 +109,14 @@ if ($act == "edit") { } } -if(!is_array($networkacl)) +if (!is_array($networkacl)) { $networkacl = array(); +} // Add a row to the networks table -if($act == 'new') +if ($act == 'new') { $networkacl = array('0' => array('acl_network' => '', 'mask' => '', 'description' => '')); +} if ($_POST) { unset($input_errors); @@ -122,8 +124,8 @@ if ($_POST) { $deleting = false; // Delete a row from the networks table - for($idx = 0; $idx<50; $idx++) { - if($pconfig['dlt' . $idx] == 'Delete') { + for ($idx = 0; $idx < 50; $idx++) { + if ($pconfig['dlt' . $idx] == 'Delete') { unset($networkacl[$idx]); $deleting = true; break; @@ -133,9 +135,10 @@ if ($_POST) { if ($_POST['apply']) { $retval = services_unbound_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) + if ($retval == 0) { clear_subsystem_dirty('unbound'); - } else if(!$deleting) { + } + } else if (!$deleting) { // input validation - only allow 50 entries in a single ACL for ($x = 0; $x < 50; $x++) { @@ -208,14 +211,17 @@ $pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("Access L $shortcut_section = "resolver"; 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('unbound')) +if (is_subsystem_dirty('unbound')) { print_info_box_np(gettext("The configuration of the DNS Resolver, has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); +} $tab_array = array(); $tab_array[] = array(gettext("General settings"), false, "/services_unbound.php"); @@ -223,7 +229,7 @@ $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_adva $tab_array[] = array(gettext("Access Lists"), true, "/services_unbound_acls.php"); display_top_tabs($tab_array, true); -if($act=="new" || $act=="edit") { +if ($act == "new" || $act == "edit") { $form = new Form(); @@ -251,10 +257,10 @@ if($act=="new" || $act=="edit") { ))->setHelp('Provide an Access List name.'); $section->addInput(new Form_Select( - 'aclaction', - 'Action', - strtolower($pconfig['aclaction']), - array('allow' => 'Allow','deny' => 'Deny','refuse' => 'Refuse','allow snoop' => 'Allow Snoop') + 'aclaction', + 'Action', + strtolower($pconfig['aclaction']), + array('allow' => 'Allow', 'deny' => 'Deny', 'refuse' => 'Refuse', 'allow snoop' => 'Allow Snoop') ))->setHelp($actionHelp); $section->addInput(new Form_Input( @@ -267,7 +273,7 @@ if($act=="new" || $act=="edit") { $numrows = count($networkacl) - 1; $counter = 0; - foreach($networkacl as $item) { + foreach ($networkacl as $item) { $network = $item['acl_network']; $cidr = $item['mask']; $description = $item['description']; @@ -305,9 +311,8 @@ if($act=="new" || $act=="edit") { $form->add($section); print($form); -} -else // NOT 'edit' or 'add' -{ +} else { + // NOT 'edit' or 'add' ?> <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?=gettext('Access Lists to control access to the DNS Resolver')?></h2></div> @@ -325,7 +330,7 @@ else // NOT 'edit' or 'add' <tbody> <?php $i = 0; - foreach($a_acls as $acl): + foreach ($a_acls as $acl): ?> <tr ondblclick="document.location='services_unbound_acls.php?act=edit&id=<?=$i?>'"> <td> @@ -361,7 +366,7 @@ else // NOT 'edit' or 'add' <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // Suppress "Delete row" button if there are fewer than two rows checkLastRow(); }); diff --git a/src/usr/local/www/services_unbound_domainoverride_edit.php b/src/usr/local/www/services_unbound_domainoverride_edit.php index 6a02e6c..01d4cad 100644 --- a/src/usr/local/www/services_unbound_domainoverride_edit.php +++ b/src/usr/local/www/services_unbound_domainoverride_edit.php @@ -67,8 +67,9 @@ require("guiconfig.inc"); -if (!is_array($config['unbound']['domainoverrides'])) +if (!is_array($config['unbound']['domainoverrides'])) { $config['unbound']['domainoverrides'] = array(); +} $a_domainOverrides = &$config['unbound']['domainoverrides']; diff --git a/src/usr/local/www/services_unbound_host_edit.php b/src/usr/local/www/services_unbound_host_edit.php index 787b39b..6f87318 100644 --- a/src/usr/local/www/services_unbound_host_edit.php +++ b/src/usr/local/www/services_unbound_host_edit.php @@ -213,28 +213,30 @@ if ($_POST) { } // Delete a row in the options table -if($_GET['act'] == "delopt") { +if ($_GET['act'] == "delopt") { $idx = $_GET['id']; - if($pconfig['aliases'] && is_array($pconfig['aliases']['item'][$idx])) { + if ($pconfig['aliases'] && is_array($pconfig['aliases']['item'][$idx])) { unset($pconfig['aliases']['item'][$idx]); } } // Add an option row -if($_GET['act'] == "addopt") { - if(!is_array($pconfig['aliases']['item'])) +if ($_GET['act'] == "addopt") { + if (!is_array($pconfig['aliases']['item'])) { $pconfig['aliases']['item'] = array(); + } array_push($pconfig['aliases']['item'], array('host' => null, 'domain' => null, 'description' => null)); } -$pgtitle = array(gettext("Services"),gettext("DNS Resolver"),gettext("Edit Host Override")); +$pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("Edit Host Override")); $shortcut_section = "resolver"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); @@ -283,15 +285,15 @@ $form->add($section); $section = new Form_Section('Additional names for this host'); -if(!$pconfig['aliases']['item']) { +if (!$pconfig['aliases']['item']) { $pconfig['aliases']['item'] = array('host' => ""); } -if( $pconfig['aliases']['item']) { +if ($pconfig['aliases']['item']) { $counter = 0; $last = count($pconfig['aliases']['item']) - 1; - foreach($pconfig['aliases']['item'] as $item) { + foreach ($pconfig['aliases']['item'] as $item) { $group = new Form_Group(null); $group->addClass('repeatable'); diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php index 0194910..8d91c19 100644 --- a/src/usr/local/www/services_wol.php +++ b/src/usr/local/www/services_wol.php @@ -69,7 +69,7 @@ if (!is_array($config['wol']['wolentry'])) { } $a_wol = &$config['wol']['wolentry']; -if($_GET['wakeall'] != "") { +if ($_GET['wakeall'] != "") { $i = 0; $savemsg = ""; foreach ($a_wol as $wolent) { @@ -149,11 +149,13 @@ print_info_box(gettext('This service can be used to wake up (power on) computers <?php -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg); +} $form = new Form('Send'); diff --git a/src/usr/local/www/services_wol_edit.php b/src/usr/local/www/services_wol_edit.php index 9163ee4..0bbcda3 100644 --- a/src/usr/local/www/services_wol_edit.php +++ b/src/usr/local/www/services_wol_edit.php @@ -137,8 +137,9 @@ if ($_POST) { $pgtitle = array(gettext("Services"), gettext("Wake on LAN"), gettext("Edit")); include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form; |