diff options
Diffstat (limited to 'src/usr/local/www')
33 files changed, 390 insertions, 287 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 7c9c7d8..8df884e 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -304,8 +304,9 @@ function verify_gzip_file($fname) { function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $class="alert-warning") { global $g; - if (strpos($class, "alert-") !== 0) + if (strpos($class, "alert-") !== 0) { $class = 'alert-' . $class; + } if (empty($value)) { $value = gettext("Apply changes"); @@ -316,12 +317,14 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) { $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $name .'" value="'.$value.'">'.$name.'</button>'; - if ($_POST['if']) + if ($_POST['if']) { $msg .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />"; + } $msg .= '</form>'; - } else + } else { $msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'. $msg; + } echo '<div class="alert ' . $class . ' clearfix" role="alert">'.$msg.'</div>'; } @@ -523,18 +526,20 @@ function gentitle($title) { } function genhtmltitle($title) { - if (!is_array($title)) + if (!is_array($title)) { return '<h1 class="page-header"><a href="">' . $title . '</a></h1>'; + } $heading = '<h1 class="page-header"><a href="">' . end($title) . '</a></h1>'; // If the array contains only one element, there are no breadcrumbs, so don't // add anything else - if(count($title) > 1) { + if (count($title) > 1) { $bc = '<ol class="breadcrumb">'; - foreach ($title as $el) + foreach ($title as $el) { $bc .= '<li>'.$el.'</li>'; + } $bc .= '</ol>'; } else { @@ -599,10 +604,12 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r"; $logarr = ""; $grepline = " "; - if (is_array($grepfor)) + if (is_array($grepfor)) { $grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor)); - if (is_array($grepinvert)) + } + if (is_array($grepinvert)) { $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); + } if (is_dir($logfile)) { $logarr = array("File $logfile is a directory."); } elseif (file_exists($logfile) && filesize($logfile) == 0) { @@ -611,10 +618,11 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g if ($config['system']['disablesyslogclog']) { exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); } else { - if (isset($config['system']['usefifolog'])) + if (isset($config['system']['usefifolog'])) { exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); - else + } else { exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); + } } } echo "\n"; @@ -626,7 +634,7 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g 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))); @@ -1048,8 +1056,9 @@ function display_top_tabs(& $tab_array, $no_drop_down = false, $type = 'pills') $font_color = "white"; $tabcharcount = 0; - foreach ($tab_array as $ta) + foreach ($tab_array as $ta) { $tabcharcount = $tabcharcount + strlen($ta[0]); + } if ($no_drop_down == true) { $tabcharcount = 0; @@ -1063,10 +1072,11 @@ function display_top_tabs(& $tab_array, $no_drop_down = false, $type = 'pills') 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"; - else + } else { $selected = ""; + } // Onclick in option will not work in some browser // echo "<option onclick=\"document.location='{$ta[2]}';\"{$selected}>{$ta['0']}</option>\n"; echo "<option value=\"{$ta[2]}\"{$selected}>{$ta['0']}</option>\n"; @@ -1101,7 +1111,7 @@ function add_package_tabs($tabgroup, &$tab_array) { return; } - foreach ($config['installedpackages']['package'] as $pkg){ + foreach ($config['installedpackages']['package'] as $pkg) { $pkg_config = read_package_configurationfile($pkg['name']); if (!isset($pkg_config['tabs']['tab'])) { @@ -1123,32 +1133,31 @@ function add_package_tabs($tabgroup, &$tab_array) { function alias_info_popup($alias_id) { global $config; - if (!is_array($config['aliases']['alias'][$alias_id])) + if (!is_array($config['aliases']['alias'][$alias_id])) { return; + } $maxlength = 60; $alias = $config['aliases']['alias'][$alias_id]; $content = ""; - if ($alias['url']) - { + if ($alias['url']) { // TODO: Change it when pf supports tables with ports if ($alias['type'] == "urltable") { exec("/sbin/pfctl -t {$alias['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']} -T show | head -10002", $alias_addresses); } else { $urlfn = alias_expand_urltable($alias['name']); $alias_addresses = explode("\n", file_get_contents($urlfn)); $counter = count($alias_addresses); } - + $content .= '<h5>'. $alias['url'] .'</h5><ul><li>'. implode('</li><li>', $alias_addresses) .'</li></ul>'; - if ($counter > 10002) + if ($counter > 10002) { $content .= '<i>'. gettext("listing only first 10k items") .'</i>'; - } - else - { + } + } else { $alias_addresses = explode (" ", $alias['address']); $alias_details = explode ("||", $alias['detail']); $idx = 0; @@ -1176,8 +1185,9 @@ function alias_info_popup($alias_id) { $content .= "<table>\n"; } - if (strlen($alias['descr']) >= $maxlength) + if (strlen($alias['descr']) >= $maxlength) { $alias['descr'] = substr($alias['descr'], 0, $maxlength) . '…'; + } return $content; } @@ -1185,19 +1195,24 @@ function alias_info_popup($alias_id) { function rule_columns_with_alias($src, $srcport, $dst, $dstport) { global $config; - if ($config['aliases']['alias'] == "" || !is_array($config['aliases']['alias'])) + if ($config['aliases']['alias'] == "" || !is_array($config['aliases']['alias'])) { return; + } $columns = array(); foreach ($config['aliases']['alias'] as $alias_id => $alias_name) { - if ($alias_name['name'] == $src) + if ($alias_name['name'] == $src) { $columns['src'] = $alias_id; - if ($alias_name['name'] == $srcport) + } + if ($alias_name['name'] == $srcport) { $columns['srcport'] = $alias_id; - if ($alias_name['name'] == $dst ) + } + if ($alias_name['name'] == $dst) { $columns['dst'] = $alias_id; - if ($alias_name['name'] == $dstport) + } + if ($alias_name['name'] == $dstport) { $columns['dstport'] = $alias_id; + } } return $columns; diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index 0fb30e6..5fa4de7 100755 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -78,7 +78,7 @@ if (isset($config['system']['webgui']['webguicss'])) { } // set default colmns to two if unset -if(!isset($config['system']['webgui']['dashboardcolumns'])) { +if (!isset($config['system']['webgui']['dashboardcolumns'])) { $config['system']['webgui']['dashboardcolumns'] = 2; } @@ -141,7 +141,7 @@ function return_ext_menu($section) { $htmltext = ""; $extarray = array(); - if ( (!empty($config['installedpackages']['package'])) && (!empty($config['installedpackages']['menu']))) { + if ((!empty($config['installedpackages']['package'])) && (!empty($config['installedpackages']['menu']))) { foreach ($config['installedpackages']['menu'] as $menu) { // print('Name: ' . $menu['name'] . ', Pkg category: ' . $menu['category'] . ', Section: ' . $section . '<br />'); if ($menu['section'] != $section) { @@ -308,7 +308,7 @@ if (count($config['interfaces']) > 1) { $ifentries = get_configured_interface_with_descr(); foreach ($ifentries as $ent => $entdesc) { if (is_array($config['interfaces'][$ent]['wireless']) && - preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if'])) { + preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if'])) { $wifdescrs[$ent] = $entdesc; } } @@ -434,7 +434,7 @@ if (($pagename === "index.php") && ($numColumns > 2)) { <?php $notices = get_notices()?> <li class="dropdown"> <a href="#" data-toggle="modal" data-target="#notices" role="button" aria-expanded="false"> - <i class="fa fa-bell text-danger" title="<?=gettext("Notices")?>"></i> + <i class="fa fa-bell text-danger" title="<?=gettext("Notices")?>"></i> <span class="badge bg-danger"><?=count($notices)?></span> </a> </li> @@ -451,12 +451,11 @@ if (($pagename === "index.php") && ($numColumns > 2)) { <?php // If you set $notitle = true BEFORE including head.inc, the page title will be supressed - if(isset($notitle)) { + if (isset($notitle)) { print('<br />'); unset($notitle); } else { - - print(genhtmltitle($pgtitle)); + print(genhtmltitle($pgtitle)); } ?> <ul class="context-links"> @@ -540,11 +539,11 @@ if (are_notices_pending()):?> <?php $noticeCategories = array(); - if(is_array($notices)) { - foreach ($notices as $time => $notice) - { - if (!isset($noticeCategories[ $notice['category'] ])) + if (is_array($notices)) { + foreach ($notices as $time => $notice) { + if (!isset($noticeCategories[ $notice['category'] ])) { $noticeCategories[ $notice['category'] ] = array(); + } $notice['time'] = $time; array_push($noticeCategories[ $notice['category'] ], $notice); @@ -581,16 +580,16 @@ if (are_notices_pending()):?> <script type="text/javascript"> //<![CDATA[ - events.push(function(){ + events.push(function() { $('#clearallnotices').click(function() { ajaxRequest = $.ajax({ url: "/index.php", type: "post", data: { closenotice: "all"}, - success: function(){ + success: function() { window.location = window.location.href; }, - failure: function () { + failure: function() { alert("Error clearing notices!"); } }); diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index 350ddb7..496d128 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -138,8 +138,7 @@ foreach ($phpincludefiles as $includename) { } ##build list of widgets -foreach (glob("/usr/local/www/widgets/widgets/*.widget.php") as $file) -{ +foreach (glob("/usr/local/www/widgets/widgets/*.widget.php") as $file) { $name = basename($file, '.widget.php'); // Get the widget title that should be in a var defined in the widget's inc file. $widgettitle = ${$name . '_title'}; @@ -253,8 +252,9 @@ if ($fd) { } } fclose($fd); - if (!isset($hwcrypto) && get_single_sysctl("dev.aesni.0.%desc")) + if (!isset($hwcrypto) && get_single_sysctl("dev.aesni.0.%desc")) { $hwcrypto = get_single_sysctl("dev.aesni.0.%desc"); + } } ##build widget saved list information @@ -262,14 +262,14 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") { $pconfig['sequence'] = $config['widgets']['sequence']; $widgetsfromconfig = array(); - foreach (explode(',', $pconfig['sequence']) as $line) - { + foreach (explode(',', $pconfig['sequence']) as $line) { list($file, $col, $display) = explode(':', $line); // be backwards compatible $offset = strpos($file, '-container'); - if (false !== $offset) + if (false !== $offset) { $file = substr($file, 0, $offset); + } // Get the widget title that should be in a var defined in the widget's inc file. $widgettitle = ${$file . '_title'}; @@ -364,17 +364,18 @@ foreach ($widgets as $widgetname => $widgetconfig): <?php $widgetColumns = array(); -foreach ($widgets as $widgetname => $widgetconfig) -{ - if ($widgetconfig['display'] == 'none') +foreach ($widgets as $widgetname => $widgetconfig) { + if ($widgetconfig['display'] == 'none') { continue; + } if (!file_exists('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php')) { continue; } - if (!isset($widgetColumns[ $widgetconfig['col'] ])) + if (!isset($widgetColumns[ $widgetconfig['col'] ])) { $widgetColumns[ $widgetconfig['col'] ] = array(); + } $widgetColumns[ $widgetconfig['col'] ][ $widgetname ] = $widgetconfig; } @@ -415,7 +416,7 @@ foreach ($widgets as $widgetname => $widgetconfig) </a> </span> </div> - <div id="widget-<?=$widgetname?>_panel-body" class="panel-body collapse<?=($widgetconfig['display']=='close' ? '' : ' in')?>"> + <div id="widget-<?=$widgetname?>_panel-body" class="panel-body collapse<?=($widgetconfig['display'] == 'close' ? '' : ' in')?>"> <?php include('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?> </div> </div> @@ -425,7 +426,7 @@ foreach ($widgets as $widgetname => $widgetconfig) </div> <?php endforeach; ?> <?php - for($n = 1; $n <= ($numColumns - $columnCounter); $n++) { + for ($n = 1; $n <= ($numColumns - $columnCounter); $n++) { echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . ($n + $columnCounter) . '"></div>'; } ?> @@ -433,20 +434,20 @@ foreach ($widgets as $widgetname => $widgetconfig) <script type="text/javascript"> //<![CDATA[ -function updateWidgets(newWidget) -{ +function updateWidgets(newWidget) { var sequence = ''; - $('.container .col-md-<?=$columnWidth?>').each(function(idx, col){ - $('.panel', col).each(function(idx, widget){ + $('.container .col-md-<?=$columnWidth?>').each(function(idx, col) { + $('.panel', col).each(function(idx, widget) { var isOpen = $('.panel-body', widget).hasClass('in'); sequence += widget.id.split('-')[1] +':'+ col.id.split('-')[1] +':'+ (isOpen ? 'open' : 'close') +','; }); }); - if (typeof newWidget !== 'undefined') + if (typeof newWidget !== 'undefined') { sequence += newWidget + ':' + 'col2:open'; + } $('#widgetSequence').removeClass('hidden'); $('input[name=sequence]', $('#widgetSequence_Form')).val(sequence); @@ -455,8 +456,8 @@ function updateWidgets(newWidget) events.push(function() { // Make panels destroyable - $('.container .panel-heading a[data-toggle="close"]').each(function (idx, el){ - $(el).on('click', function(e){ + $('.container .panel-heading a[data-toggle="close"]').each(function (idx, el) { + $(el).on('click', function(e) { $(el).parents('.panel').remove(); updateWidgets(); }) @@ -487,7 +488,8 @@ events.push(function() { </script> <?php //build list of javascript include files -foreach (glob('widgets/javascript/*.js') as $file) +foreach (glob('widgets/javascript/*.js') as $file) { echo '<script src="'.$file.'"></script>'; +} include("foot.inc"); diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 6344388..5f5ce62 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -466,7 +466,7 @@ if ($_POST['apply']) { } else { interface_bring_down($ifapply, true, $ifcfgo); if (isset($config['dhcpd'][$ifapply]['enable']) || - isset($config['dhcpdv6'][$ifapply]['enable'])) { + isset($config['dhcpdv6'][$ifapply]['enable'])) { services_dhcpd_configure(); } } @@ -675,8 +675,8 @@ if ($_POST['apply']) { continue; } 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-interface'] == $_POST['track6-interface'] && + $config['interfaces'][$ifent]['track6-prefix-id'] == $track6_prefix_id) { $input_errors[] = sprintf(gettext("This track6 prefix ID is already being used in %s."), $ifdescr); } } @@ -784,12 +784,12 @@ if ($_POST['apply']) { $input_errors[] = gettext("The idle timeout value must be an integer."); } if ($_POST['pppoe_resethour'] != "" && !is_numericint($_POST['pppoe_resethour']) && - $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) { - $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); + $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) { + $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); } if ($_POST['pppoe_resetminute'] != "" && !is_numericint($_POST['pppoe_resetminute']) && - $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) { - $input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59)."); + $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) { + $input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59)."); } if ($_POST['pppoe_resetdate'] != "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) { $input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy)."); @@ -1670,15 +1670,18 @@ function build_gatewayv6_list() { include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if (is_subsystem_dirty('interfaces')) +if (is_subsystem_dirty('interfaces')) { print_info_box_np(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "<br />" . gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying.")); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} $form = new Form(new Form_Button( @@ -2729,8 +2732,9 @@ if (isset($wancfg['wireless'])) { } } - if (count($mode_list) == 1) + if (count($mode_list) == 1) { $mode_list[''] = ''; + } $section->addInput(new Form_Select( 'standard', @@ -2746,9 +2750,7 @@ if (isset($wancfg['wireless'])) { $pconfig['protmode'], ['off' => 'Off', 'cts' => 'CTS to self', 'rtscts' => 'RTS and CTS'] ))->setHelp('For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.'); - } - else - { + } else { $section->addInput(new Form_Input( 'protmode', null, @@ -3086,7 +3088,7 @@ $section->addInput(new Form_Checkbox( ' as well as loopback addresses (127/8). You should generally leave this option turned on, unless your WAN network ' . 'lies in such a private address space, too.'); - $section->addInput(new Form_Checkbox( +$section->addInput(new Form_Checkbox( 'blockbogons', 'Block bogon networks', '', @@ -3177,7 +3179,7 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { function updateType(t) { switch (t) { @@ -3220,8 +3222,9 @@ events.push(function(){ } function updateTypeSix(t) { - if (!isNaN(t[0])) + if (!isNaN(t[0])) { t = '_' + t; + } switch (t) { case "none": { @@ -3333,8 +3336,7 @@ events.push(function(){ $("#newgateway").modal('hide'); } - function addOption(selectbox, text, value) - { + function addOption(selectbox, text, value) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; @@ -3365,8 +3367,7 @@ events.push(function(){ } - function addOption_v6(selectbox, text, value) - { + function addOption_v6(selectbox, text, value) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; @@ -3505,7 +3506,7 @@ events.push(function(){ var adv = $('#dhcpadv').prop('checked'); var ovr = $('#dhcpovr').prop('checked'); - if(ovr) { + if (ovr) { hideInput('dhcphostname', true); hideIpAddress('alias-address', true); hideInput('dhcprejectfrom', true); @@ -3544,12 +3545,12 @@ events.push(function(){ updateType($('#type').val()); updateTypeSix($('#type6').val()); show_reset_settings($('#pppoe-reset-type').val()); - $("#add").prop('type' ,'button'); - $("#cnx").prop('type' ,'button'); - $("#addgw").prop('type' ,'button'); - $("#add6").prop('type' ,'button'); - $("#cnx6").prop('type' ,'button'); - $("#addgw6").prop('type' ,'button'); + $("#add").prop('type', 'button'); + $("#cnx").prop('type', 'button'); + $("#addgw").prop('type', 'button'); + $("#add6").prop('type', 'button'); + $("#cnx6").prop('type', 'button'); + $("#addgw6").prop('type', 'button'); hideClass('dhcp6advanced', true); hideClass('dhcpadvanced', true); show_dhcp6adv(); @@ -3557,24 +3558,25 @@ events.push(function(){ // Set preset buttons on page load var sv = "<?=htmlspecialchars($pconfig['adv_dhcp_pt_values']);?>"; - if(sv == "") + if (sv == "") { $("input[name=adv_dhcp_pt_values][value='SavedCfg']").prop('checked', true); + } // Set preset from value setPresets(sv); - + // ---------- Click checkbox handlers --------------------------------------------------------- $('#type').on('change', function() { - updateType( this.value ); + updateType(this.value); }); $('#type6').on('change', function() { - updateTypeSix( this.value ); + updateTypeSix(this.value); }); $('#pppoe-reset-type').on('change', function() { - show_reset_settings( this.value ); + show_reset_settings(this.value); }); $("#add").click(function() { diff --git a/src/usr/local/www/interfaces_assign.php b/src/usr/local/www/interfaces_assign.php index 377741d..7acc006 100644 --- a/src/usr/local/www/interfaces_assign.php +++ b/src/usr/local/www/interfaces_assign.php @@ -410,8 +410,9 @@ if (isset($_POST['add']) && isset($_POST['if_add'])) { } } else { unset($delbtn); - if (!empty($_POST['del'])) + if (!empty($_POST['del'])) { $delbtn = key($_POST['del']); + } if (isset($delbtn)) { $id = $delbtn; @@ -507,8 +508,9 @@ if (file_exists("/tmp/reload_interfaces")) { pfSense_handle_custom_code("/usr/local/pkg/interfaces_assign/pre_input_errors"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), true, "interfaces_assign.php"); @@ -535,10 +537,11 @@ display_top_tabs($tab_array); <tbody> <?php foreach ($config['interfaces'] as $ifname => $iface): - if ($iface['descr']) + if ($iface['descr']) { $ifdescr = $iface['descr']; - else + } else { $ifdescr = strtoupper($ifname); + } ?> <tr> <td><a href="/interfaces.php?if=<?=$ifname?>"><?=$ifdescr?></a></td> diff --git a/src/usr/local/www/interfaces_bridge.php b/src/usr/local/www/interfaces_bridge.php index 6511245..65b3b2d 100644 --- a/src/usr/local/www/interfaces_bridge.php +++ b/src/usr/local/www/interfaces_bridge.php @@ -110,13 +110,13 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array(gettext("Interfaces"),gettext("Bridge")); +$pgtitle = array(gettext("Interfaces"), gettext("Bridge")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) - print_input_errors($input_errors); ?> +if ($input_errors) { + print_input_errors($input_errors); +} -<?php $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); $tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php"); @@ -162,8 +162,9 @@ foreach ($a_bridges as $bridge) { echo $ifdescrs[$member]; $j++; } - if ($j > 0 && $j < count($members)) + if ($j > 0 && $j < count($members)) { echo ", "; + } } ?> </td> diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php index 321d078..971dc34 100644 --- a/src/usr/local/www/interfaces_bridge_edit.php +++ b/src/usr/local/www/interfaces_bridge_edit.php @@ -65,8 +65,9 @@ require("guiconfig.inc"); -if (!is_array($config['bridges']['bridged'])) +if (!is_array($config['bridges']['bridged'])) { $config['bridges']['bridged'] = array(); +} $a_bridges = &$config['bridges']['bridged']; @@ -211,13 +212,15 @@ if ($_POST) { if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers) { $input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue."); } - foreach($a_bridges as $a_bridge) { - if ($_POST['bridgeif'] === $a_bridge['bridgeif']) + foreach ($a_bridges as $a_bridge) { + if ($_POST['bridgeif'] === $a_bridge['bridgeif']) { continue; + } $a_members = explode(',', $a_bridge['members']); foreach ($a_members as $a_member) { - if ($ifmembers === $a_member) + if ($ifmembers === $a_member) { $input_errors[] = $ifmembers . gettext(" is part of another bridge. Remove the interface from bridge members to continue."); + } } } } @@ -317,8 +320,9 @@ function build_spanport_list() { $splist = array('none' => 'None'); - foreach ($ifacelist as $ifn => $ifdescr) + foreach ($ifacelist as $ifn => $ifdescr) { $splist[$ifn] = $ifdescr; + } return($splist); } @@ -357,12 +361,13 @@ function build_port_list($selecton) { return($portlist); } -$pgtitle = array(gettext("Interfaces"),gettext("Bridge"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("Bridge"), gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); @@ -397,10 +402,11 @@ $form->add($section); $section = new Form_Section('Advanced Configuration'); // Set initial toggle state manually for now -if($pconfig['showadvanced']) +if ($pconfig['showadvanced']) { $section->addClass('toggle-advanced in'); -else +} else { $section->addClass('toggle-advanced collapse'); +} $section->addInput(new Form_Input( 'maxaddr', @@ -500,10 +506,11 @@ $section->addInput(new Form_Checkbox( // Show the spanning tree section $form->add($section); $section = new Form_Section('RSTP/STP'); -if($pconfig['showadvanced']) +if ($pconfig['showadvanced']) { $section->addClass('toggle-advanced in'); -else +} else { $section->addClass('toggle-advanced collapse'); +} $section->addInput(new Form_Select( 'proto', diff --git a/src/usr/local/www/interfaces_gif.php b/src/usr/local/www/interfaces_gif.php index dfbc094..fb72b2b 100644 --- a/src/usr/local/www/interfaces_gif.php +++ b/src/usr/local/www/interfaces_gif.php @@ -108,8 +108,9 @@ $pgtitle = array(gettext("Interfaces"), gettext("GIF")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); diff --git a/src/usr/local/www/interfaces_gif_edit.php b/src/usr/local/www/interfaces_gif_edit.php index 030df82..b328f1e 100644 --- a/src/usr/local/www/interfaces_gif_edit.php +++ b/src/usr/local/www/interfaces_gif_edit.php @@ -65,8 +65,9 @@ require("guiconfig.inc"); -if (!is_array($config['gifs']['gif'])) +if (!is_array($config['gifs']['gif'])) { $config['gifs']['gif'] = array(); +} $a_gifs = &$config['gifs']['gif']; @@ -161,20 +162,22 @@ if ($_POST) { $gif['gifif'] = $_POST['gifif']; $gif['gifif'] = interface_gif_configure($gif); - if ($gif['gifif'] == "" || !stristr($gif['gifif'], "gif")) + if ($gif['gifif'] == "" || !stristr($gif['gifif'], "gif")) { $input_errors[] = gettext("Error occurred creating interface, please retry."); - else { - if (isset($id) && $a_gifs[$id]) + } else { + if (isset($id) && $a_gifs[$id]) { $a_gifs[$id] = $gif; - else + } else { $a_gifs[] = $gif; + } write_config(); $confif = convert_real_interface_to_friendly_interface_name($gif['gifif']); - if ($confif != "") + if ($confif != "") { interface_configure($confif); + } header("Location: interfaces_gif.php"); exit; @@ -185,18 +188,20 @@ if ($_POST) { function build_parent_list() { $parentlist = array(); $portlist = get_possible_listen_ips(); - foreach ($portlist as $ifn => $ifinfo) + foreach ($portlist as $ifn => $ifinfo) { $parentlist[$ifn] = $ifinfo; + } return($parentlist); } -$pgtitle = array(gettext("Interfaces"),gettext("GIF"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("GIF"), gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); diff --git a/src/usr/local/www/interfaces_gre.php b/src/usr/local/www/interfaces_gre.php index 749c20f..f5c1396 100644 --- a/src/usr/local/www/interfaces_gre.php +++ b/src/usr/local/www/interfaces_gre.php @@ -108,8 +108,9 @@ if ($_GET['act'] == "del") { $pgtitle = array(gettext("Interfaces"), gettext("GRE")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); diff --git a/src/usr/local/www/interfaces_gre_edit.php b/src/usr/local/www/interfaces_gre_edit.php index dc2a99f..0f9313c 100644 --- a/src/usr/local/www/interfaces_gre_edit.php +++ b/src/usr/local/www/interfaces_gre_edit.php @@ -66,8 +66,9 @@ require("guiconfig.inc"); require_once("functions.inc"); -if (!is_array($config['gres']['gre'])) +if (!is_array($config['gres']['gre'])) { $config['gres']['gre'] = array(); +} $a_gres = &$config['gres']['gre']; @@ -168,8 +169,9 @@ if ($_POST) { $confif = convert_real_interface_to_friendly_interface_name($gre['greif']); - if ($confif != "") + if ($confif != "") { interface_configure($confif); + } header("Location: interfaces_gre.php"); exit; @@ -180,18 +182,20 @@ if ($_POST) { function build_parent_list() { $parentlist = array(); $portlist = get_possible_listen_ips(); - foreach ($portlist as $ifn => $ifinfo) + foreach ($portlist as $ifn => $ifinfo) { $parentlist[$ifn] = $ifinfo; + } return($parentlist); } -$pgtitle = array(gettext("Interfaces"),gettext("GRE"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("GRE"), gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); diff --git a/src/usr/local/www/interfaces_groups.php b/src/usr/local/www/interfaces_groups.php index 6a1b9f2..0eecef6 100644 --- a/src/usr/local/www/interfaces_groups.php +++ b/src/usr/local/www/interfaces_groups.php @@ -128,13 +128,14 @@ display_top_tabs($tab_array); $members_arr = explode(" ", $ifgroupentry['members']); $iflist = get_configured_interface_with_descr(false, true); $memberses_arr = array(); - foreach ($members_arr as $memb) + foreach ($members_arr as $memb) { $memberses_arr[] = $iflist[$memb] ? $iflist[$memb] : $memb; + } unset($iflist); $memberses = implode(", ", $memberses_arr); echo $memberses; - if(count($members_arr) >= 10) { + if (count($members_arr) >= 10) { echo '…'; } ?> diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php index a7346c7..5f944a5 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -127,15 +127,15 @@ if ($_POST) { } if (isset($_POST['members'])) { - foreach ($_POST['members'] as $member ) { - if ($isfirst > 0) + foreach ($_POST['members'] as $member) { + if ($isfirst > 0) { $members .= " "; + } $members .= $member[0]; $isfirst++; } - } - else { + } else { $members = ""; } diff --git a/src/usr/local/www/interfaces_lagg.php b/src/usr/local/www/interfaces_lagg.php index e02b2c4..438ec42 100644 --- a/src/usr/local/www/interfaces_lagg.php +++ b/src/usr/local/www/interfaces_lagg.php @@ -115,8 +115,9 @@ $pgtitle = array(gettext("Interfaces"), gettext("LAGG")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php index 904c0b5..69b6e7a 100644 --- a/src/usr/local/www/interfaces_lagg_edit.php +++ b/src/usr/local/www/interfaces_lagg_edit.php @@ -65,8 +65,9 @@ require("guiconfig.inc"); -if (!is_array($config['laggs']['lagg'])) +if (!is_array($config['laggs']['lagg'])) { $config['laggs']['lagg'] = array(); +} $a_laggs = &$config['laggs']['lagg']; @@ -209,8 +210,9 @@ if ($_POST) { write_config(); $confif = convert_real_interface_to_friendly_interface_name($lagg['laggif']); - if ($confif != "") + if ($confif != "") { interface_configure($confif); + } header("Location: interfaces_lagg.php"); exit; @@ -226,19 +228,21 @@ function build_member_list() { $members_array = explode(',', $pconfig['members']); foreach ($portlist as $ifn => $ifinfo) { - if (array_key_exists($ifn, $realifchecklist)) + if (array_key_exists($ifn, $realifchecklist)) { continue; + } $memberlist['list'][$ifn] = $ifn . '(' . $ifinfo['mac'] . ')'; - if (stristr($pconfig['members'], $ifn)) + if (stristr($pconfig['members'], $ifn)) { array_push($memberlist['selected'], $ifn); + } } return($memberlist); } -$pgtitle = array(gettext("Interfaces"),gettext("LAGG"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("LAGG"), gettext("Edit")); $shortcut_section = "interfaces"; include("head.inc"); $form = new Form(); diff --git a/src/usr/local/www/interfaces_ppps.php b/src/usr/local/www/interfaces_ppps.php index 076ecf7..f3160ec 100644 --- a/src/usr/local/www/interfaces_ppps.php +++ b/src/usr/local/www/interfaces_ppps.php @@ -107,7 +107,7 @@ if (!is_array($config['ppps']['ppp'])) { } $a_ppps = $config['ppps']['ppp']; -$pgtitle = array(gettext("Interfaces"),gettext("PPPs")); +$pgtitle = array(gettext("Interfaces"), gettext("PPPs")); $shortcut_section = "interfaces"; include("head.inc"); @@ -149,8 +149,9 @@ foreach ($a_ppps as $id => $ppp) { <?php $portlist = explode(",", $ppp['ports']); foreach ($portlist as $portid => $port) { - if ($port != get_real_interface($port) && $ppp['type'] != "ppp") + if ($port != get_real_interface($port) && $ppp['type'] != "ppp") { $portlist[$portid] = convert_friendly_interface_to_friendly_descr($port); + } } echo htmlspecialchars(implode(",", $portlist)); ?> diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 200d208..127dfd9 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -92,14 +92,17 @@ if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { } } -if($_GET && $_GET['type']) +if ($_GET && $_GET['type']) { $pconfig['type'] = $_GET['type']; +} -if (is_numericint($_GET['id'])) +if (is_numericint($_GET['id'])) { $id = $_GET['id']; +} -if (isset($_POST['id']) && is_numericint($_POST['id'])) +if (isset($_POST['id']) && is_numericint($_POST['id'])) { $id = $_POST['id']; +} if (isset($id) && $a_ppps[$id]) { $pconfig['ptpid'] = $a_ppps[$id]['ptpid']; @@ -114,13 +117,14 @@ 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'])) + if (isset($a_ppps[$id]['shortseq'])) { $pconfig['shortseq'] = true; + } if (isset($a_ppps[$id]['acfcomp'])) { $pconfig['acfcomp'] = true; @@ -449,7 +453,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" $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']; @@ -463,7 +467,7 @@ function build_country_list() { // get_country_name is in pfSense-utils.inc $country_list = get_country_name("ALL"); - foreach($country_list as $country) { + foreach ($country_list as $country) { $list[$country['code']] = $country['name']; } @@ -481,14 +485,15 @@ function build_link_list() { $selected_ports = array(); - if($pconfig['interfaces']) { - $selected_ports = explode(',',$pconfig['interfaces']); + if ($pconfig['interfaces']) { + $selected_ports = explode(',', $pconfig['interfaces']); } - if (!is_dir("/var/spool/lock")) + if (!is_dir("/var/spool/lock")) { mwexec("/bin/mkdir -p /var/spool/lock"); + } - if($pconfig['type'] == 'ppp') { + if ($pconfig['type'] == 'ppp') { $serialports = glob("/dev/cua[a-zA-Z][0-9]{,.[0-9],.[0-9][0-9],[0-9],[0-9].[0-9],[0-9].[0-9][0-9]}", GLOB_BRACE); $serport_count = 0; @@ -497,38 +502,43 @@ function build_link_list() { $linklist['list'][$port] = trim($port); - if (in_array($port, $selected_ports)) + if (in_array($port, $selected_ports)) { array_push($linklist['selected'], $port); + } } - } - else { + } else { $port_count = 0; - foreach ($portlist as $ifn => $ifinfo){ + foreach ($portlist as $ifn => $ifinfo) { $port_count++; $string = ""; if (is_array($ifinfo)) { $string .= $ifn; - if ($ifinfo['mac']) - $string .= " ({$ifinfo['mac']})"; - } else + if ($ifinfo['mac']) { + $string .= " ({$ifinfo['mac']})"; + } + } else { $string .= $ifinfo; + } $linklist['list'][$ifn] = $string; - if (in_array($ifn, $selected_ports)) + if (in_array($ifn, $selected_ports)) { array_push($linklist['selected'], $ifn); + } } - if($serport_count > $port_count) - $port_count=$serport_count; + if ($serport_count > $port_count) { + $port_count = $serport_count; + } } return($linklist); } -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $linkparamstr = gettext('Bandwidth is set only for MLPPP connections and when links have different bandwidths' . '<br />' . 'MTU defaults to 1492' . '<br />' . @@ -599,9 +609,9 @@ $section->addInput(new Form_Input( )); // These elements are hidden by default, and un-hidden in Javascript -if($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') { +if ($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') { $j = 0; - foreach($linklist['list'] as $ifnm =>$nm) { + foreach ($linklist['list'] as $ifnm => $nm) { $group = new Form_Group('IP/Gateway (' . $ifnm . ')'); @@ -625,7 +635,7 @@ if($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') { } } -if($pconfig['type'] == 'ppp') { +if ($pconfig['type'] == 'ppp') { $section->addInput(new Form_Input( 'phone', 'Phone number', @@ -863,7 +873,7 @@ $section->addInput(new Form_Checkbox( // Display the Link parameters. We will hide this by default, then un-hide the selected ones on clicking 'Advanced' $j = 0; -foreach($linklist['list'] as $ifnm =>$nm) { +foreach ($linklist['list'] as $ifnm =>$nm) { $group = new Form_Group('Link Parameters (' . $ifnm . ')'); @@ -933,16 +943,15 @@ print($form); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { var showadvanced = false; function setAdvVisible() { // Update the button text and toggle showadvanced - if(showadvanced) { + if (showadvanced) { $("#btnadvanced").prop('value', 'Hide'); showadvanced = false; - } - else { + } else { $("#btnadvanced").prop('value', 'Show'); showadvanced = true; } @@ -975,8 +984,8 @@ events.push(function(){ hideClass('pppoe-reset-date', true); hideClass('pppoe-reset-cron', true); - if(!hide) { - switch($('#pppoe-reset-type').val()) { + if (!hide) { + switch ($('#pppoe-reset-type').val()) { case 'custom' : hideClass('pppoe-reset-date', false); break; @@ -995,10 +1004,10 @@ events.push(function(){ var selected = $('#interfaces').val(); var length = $("#interfaces :selected").length; - for(var i=0; i<length; i++) { + for (var i=0; i<length; i++) { hideClass('localip' + selected[i], false); - if(!showadvanced) { + if (!showadvanced) { hideClass('linkparam' + selected[i], false); hideInput('linkparamhelp', false); } @@ -1063,7 +1072,7 @@ events.push(function(){ var provider = xmldoc.getElementsByTagName('connection')[0]; $('#username').val(''); $('#password').val(''); - if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") { + if (provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") { $('#phone').val('#777'); $('#apn').val(''); } else { @@ -1118,11 +1127,13 @@ events.push(function(){ hideClass('linkparam', true); hideProviders($('#type').val() != "ppp"); - if ($('provider').size() == 0) + if ($('provider').size() == 0) { hideInput('provider', true); + } - if ($('providerplan').size() == 0) + if ($('providerplan').size() == 0) { hideInput('providerplan', true); + } }); //]]> diff --git a/src/usr/local/www/interfaces_qinq.php b/src/usr/local/www/interfaces_qinq.php index f0d2e8a..6d5f782 100644 --- a/src/usr/local/www/interfaces_qinq.php +++ b/src/usr/local/www/interfaces_qinq.php @@ -119,8 +119,9 @@ $pgtitle = array(gettext("Interfaces"), gettext("QinQ")); $shortcut_section = "interfaces"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $tab_array = array(); $tab_array[] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); diff --git a/src/usr/local/www/interfaces_qinq_edit.php b/src/usr/local/www/interfaces_qinq_edit.php index 8d48db3..016330b 100644 --- a/src/usr/local/www/interfaces_qinq_edit.php +++ b/src/usr/local/www/interfaces_qinq_edit.php @@ -151,18 +151,18 @@ if ($_POST) { $member = explode("-", $memb); if (count($member) > 1) { - if (preg_match("/([^0-9])+/", $member[0], $match) || preg_match("/([^0-9])+/", $member[1], $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 #-#."); + } for ($i = $member[0]; $i <= $member[1]; $i++) { $members .= ($isfirst == 0 ? '':' ') . $i; $isfirst++; } - } - else { // Just a single number - if (preg_match("/([^0-9])+/", $memb, $match)) + } else { // Just a single number + if (preg_match("/([^0-9])+/", $memb, $match)) { $input_errors[] = gettext("Tags can contain only numbers or a range in format #-#."); - else { + } else { $members .= ($isfirst == 0 ? '':' ') . $memb; $isfirst++; } @@ -246,8 +246,9 @@ function build_parent_list() { $list = array(); foreach ($portlist as $ifn => $ifinfo) { - if (is_jumbo_capable($ifn)) + if (is_jumbo_capable($ifn)) { $list[$ifn] = $ifn . ' (' . $ifinfo['mac'] . ')'; + } } return($list); @@ -255,8 +256,9 @@ function build_parent_list() { include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(new Form_Button( 'Submit', @@ -313,12 +315,13 @@ $counter = 0; $members = $pconfig['members']; // List each of the member tags from the space-separated list -if ($members != "") +if ($members != "") { $item = explode(" ", $members); -else +} else { $item = array(''); +} -foreach($item as $ww) { +foreach ($item as $ww) { $member = $item[$counter]; $group = new Form_Group($counter == 0 ? 'Tag(s)':''); diff --git a/src/usr/local/www/interfaces_vlan.php b/src/usr/local/www/interfaces_vlan.php index cf32902..1619878 100644 --- a/src/usr/local/www/interfaces_vlan.php +++ b/src/usr/local/www/interfaces_vlan.php @@ -177,11 +177,11 @@ display_top_tabs($tab_array); <?=print_info_box(sprintf(gettext('NOTE: Not all drivers/NICs support 802.1Q '. 'VLAN tagging properly. <br />On cards that do not explicitly support it, VLAN '. 'tagging will still work, but the reduced MTU may cause problems.<br />See the '. - '%s handbook for information on supported cards.'),$g['product_name']), info)?> + '%s handbook for information on supported cards.'), $g['product_name']), info)?> </div> <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // Select 'delete button' clicks, extract the id, set the hidden input values and submit $('[id^=del-]').click(function(event) { $('#act').val('del'); diff --git a/src/usr/local/www/interfaces_vlan_edit.php b/src/usr/local/www/interfaces_vlan_edit.php index 3a87a47..3a2e951 100644 --- a/src/usr/local/www/interfaces_vlan_edit.php +++ b/src/usr/local/www/interfaces_vlan_edit.php @@ -68,8 +68,9 @@ require("guiconfig.inc"); -if (!is_array($config['vlans']['vlan'])) +if (!is_array($config['vlans']['vlan'])) { $config['vlans']['vlan'] = array(); +} $a_vlans = &$config['vlans']['vlan']; @@ -155,8 +156,9 @@ if ($_POST) { pfSense_interface_destroy("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}"); $confif = convert_real_interface_to_friendly_interface_name("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}"); } - if ($confif != "") + if ($confif != "") { $config['interfaces'][$confif]['if'] = "{$_POST['if']}_vlan{$_POST['tag']}"; + } } } $vlan = array(); @@ -177,8 +179,9 @@ if ($_POST) { write_config(); - if ($confif != "") + if ($confif != "") { interface_configure($confif); + } header("Location: interfaces_vlan.php"); exit; } diff --git a/src/usr/local/www/interfaces_wireless.php b/src/usr/local/www/interfaces_wireless.php index dbd737c..717aa4b 100644 --- a/src/usr/local/www/interfaces_wireless.php +++ b/src/usr/local/www/interfaces_wireless.php @@ -109,8 +109,9 @@ $pgtitle = array(gettext("Interfaces"), gettext("Wireless")); $shortcut_section = "wireless"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); ?> +} <?php $tab_array = array(); diff --git a/src/usr/local/www/interfaces_wireless_edit.php b/src/usr/local/www/interfaces_wireless_edit.php index 4dd7930..182e214 100644 --- a/src/usr/local/www/interfaces_wireless_edit.php +++ b/src/usr/local/www/interfaces_wireless_edit.php @@ -66,11 +66,13 @@ require("guiconfig.inc"); -if (!is_array($config['wireless'])) +if (!is_array($config['wireless'])) { $config['wireless'] = array(); +} -if (!is_array($config['wireless']['clone'])) +if (!is_array($config['wireless']['clone'])) { $config['wireless']['clone'] = array(); +} $a_clones = &$config['wireless']['clone']; @@ -192,17 +194,19 @@ function build_parent_list() { } } - if($count > 0) + if ($count > 0) { return($parentlist); - else + } else { return(array('0' => gettext('None available'))); + } } -$pgtitle = array(gettext("Interfaces"),gettext("Wireless"),gettext("Edit")); +$pgtitle = array(gettext("Interfaces"), gettext("Wireless"), gettext("Edit")); include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); diff --git a/src/usr/local/www/license.php b/src/usr/local/www/license.php index a450779..1233d83 100644 --- a/src/usr/local/www/license.php +++ b/src/usr/local/www/license.php @@ -115,7 +115,7 @@ include("head.inc"); <?= "{$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'])?>. + "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 /> diff --git a/src/usr/local/www/load_balancer_monitor.php b/src/usr/local/www/load_balancer_monitor.php index f911234..e007e18 100644 --- a/src/usr/local/www/load_balancer_monitor.php +++ b/src/usr/local/www/load_balancer_monitor.php @@ -107,19 +107,22 @@ 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"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} -if (is_subsystem_dirty('loadbalancer')) +if (is_subsystem_dirty('loadbalancer')) { print_info_box_np(gettext("The load balancer configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); +} /* active tabs */ $tab_array = array(); @@ -146,7 +149,7 @@ display_top_tabs($tab_array); <tbody> <?php $idx = 0; -foreach($a_monitor as $monitor) { +foreach ($a_monitor as $monitor) { ?> <tr> <td> diff --git a/src/usr/local/www/load_balancer_monitor_edit.php b/src/usr/local/www/load_balancer_monitor_edit.php index 5cd870a..0786239 100644 --- a/src/usr/local/www/load_balancer_monitor_edit.php +++ b/src/usr/local/www/load_balancer_monitor_edit.php @@ -242,19 +242,20 @@ $types = array("icmp" => gettext("ICMP"), "tcp" => gettext("TCP"), "http" => get <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +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 + } else { $('.' + s_class).show(); + } } // Hide all sections except 't' - function updateType(t){ - switch(t) { + function updateType(t) { + switch (t) { <?php /* OK, so this is sick using php to generate javascript, but it needed to be done */ foreach ($types as $key => $val) { @@ -288,8 +289,9 @@ events.push(function(){ </script> <?php -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(new Form_Button( 'Submit', diff --git a/src/usr/local/www/load_balancer_pool.php b/src/usr/local/www/load_balancer_pool.php index b1db377..7236129 100644 --- a/src/usr/local/www/load_balancer_pool.php +++ b/src/usr/local/www/load_balancer_pool.php @@ -121,19 +121,22 @@ 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"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg); +} -if (is_subsystem_dirty('loadbalancer')) +if (is_subsystem_dirty('loadbalancer')) { print_info_box_np(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />")); +} /* active tabs */ $tab_array = array(); @@ -164,7 +167,7 @@ display_top_tabs($tab_array); <?php $idx = 0; -foreach($a_pool as $pool) { +foreach ($a_pool as $pool) { ?> <tr> <td> diff --git a/src/usr/local/www/load_balancer_pool_edit.php b/src/usr/local/www/load_balancer_pool_edit.php index 9d5c98b..6c6996a 100644 --- a/src/usr/local/www/load_balancer_pool_edit.php +++ b/src/usr/local/www/load_balancer_pool_edit.php @@ -76,10 +76,12 @@ if (!is_array($config['load_balancer']['lbpool'])) { $a_pool = &$config['load_balancer']['lbpool']; -if (is_numericint($_GET['id'])) +if (is_numericint($_GET['id'])) { $id = $_GET['id']; -if (isset($_POST['id']) && is_numericint($_POST['id'])) +} +if (isset($_POST['id']) && is_numericint($_POST['id'])) { $id = $_POST['id']; +} if (isset($id) && $a_pool[$id]) { $pconfig['name'] = $a_pool[$id]['name']; @@ -105,55 +107,61 @@ 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++) - if (($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name']) && ($i != $id)) + 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."); + } + } - if (preg_match('/[ \/]/', $_POST['name'])) + if (preg_match('/[ \/]/', $_POST['name'])) { $input_errors[] = gettext("You cannot use spaces or slashes in the 'name' field."); + } - if (strlen($_POST['name']) > 16) + if (strlen($_POST['name']) > 16) { $input_errors[] = gettext("The 'name' field must be 16 characters or less."); + } - if (in_array($_POST['name'], $reserved_table_names)) + if (in_array($_POST['name'], $reserved_table_names)) { $input_errors[] = sprintf(gettext("The name '%s' is a reserved word and cannot be used."), $_POST['name']); + } - if (is_alias($_POST['name'])) + if (is_alias($_POST['name'])) { $input_errors[] = sprintf(gettext("Sorry, an alias is already named %s."), $_POST['name']); + } - if (!is_portoralias($_POST['port'])) + if (!is_portoralias($_POST['port'])) { $input_errors[] = gettext("The port must be an integer between 1 and 65535, or a port alias."); + } // May as well use is_port as we want a positive integer and such. - if (!empty($_POST['retry']) && !is_port($_POST['retry'])) + if (!empty($_POST['retry']) && !is_port($_POST['retry'])) { $input_errors[] = gettext("The retry value must be an integer between 1 and 65535."); + } if (!in_array($_POST['mode'], $allowed_modes)) { $input_errors[] = gettext("The submitted mode is not valid."); } if (is_array($_POST['servers'])) { - foreach($pconfig['servers'] as $svrent) { + foreach ($pconfig['servers'] as $svrent) { if (!is_ipaddr($svrent) && !is_subnetv4($svrent)) { $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet (in \"enabled\" list)."), $svrent); - } - else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) { + } else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) { $input_errors[] = sprintf(gettext("%s is a subnet containing more than 64 IP addresses (in \"enabled\" list)."), $svrent); } } } if (is_array($_POST['serversdisabled'])) { - foreach($pconfig['serversdisabled'] as $svrent) { + foreach ($pconfig['serversdisabled'] as $svrent) { if (!is_ipaddr($svrent) && !is_subnetv4($svrent)) { $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet (in \"disabled\" list)."), $svrent); - } - else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) { + } else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) { $input_errors[] = sprintf(gettext("%s is a subnet containing more than 64 IP addresses (in \"disabled\" list)."), $svrent); } } @@ -161,19 +169,23 @@ 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]; + } - if (!isset($m[$_POST['monitor']])) + if (!isset($m[$_POST['monitor']])) { $input_errors[] = gettext("Invalid monitor chosen."); + } if (!$input_errors) { $poolent = array(); - if(isset($id) && $a_pool[$id]) + if (isset($id) && $a_pool[$id]) { $poolent = $a_pool[$id]; + } - if($poolent['name'] != "") + if ($poolent['name'] != "") { $changedesc .= sprintf(gettext(" modified '%s' pool:"), $poolent['name']); + } update_if_changed("name", $poolent['name'], $_POST['name']); update_if_changed("mode", $poolent['mode'], $_POST['mode']); @@ -187,12 +199,14 @@ if ($_POST) { if (isset($id) && $a_pool[$id]) { /* modify all virtual servers with this name */ for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) { - if ($config['load_balancer']['virtual_server'][$i]['lbpool'] == $a_pool[$id]['name']) + if ($config['load_balancer']['virtual_server'][$i]['lbpool'] == $a_pool[$id]['name']) { $config['load_balancer']['virtual_server'][$i]['lbpool'] = $poolent['name']; + } } $a_pool[$id] = $poolent; - } else + } else { $a_pool[] = $poolent; + } if ($changecount > 0) { /* Mark pool dirty */ @@ -205,7 +219,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"); @@ -213,7 +227,7 @@ include("head.inc"); <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // Disables the specified input element function disableInput(id, disable) { @@ -232,9 +246,9 @@ events.push(function(){ var len = From.length; var option; - if(len > 1) { - for(i=0; i<len; i++) { - if(From.eq(i).is(':selected')) { + if (len > 1) { + for (i=0; i<len; i++) { + if (From.eq(i).is(':selected')) { option = From.eq(i).val(); value = From.eq(i).text(); To.append(new Option(value, option)); @@ -249,7 +263,7 @@ events.push(function(){ if ($("#mode").val() == "failover") { disableInput('movetoenabled', $('[name="servers[]"] option').length > 0); } else { - disableInput('movetoenabled',false); + disableInput('movetoenabled', false); } } @@ -262,8 +276,8 @@ events.push(function(){ var len = $('[name="servers[]"] option').length; var option; - if(len > 1) { - for(i=len-1; i>0; i--) { + if (len > 1) { + for (i=len-1; i>0; i--) { option = $('[name="servers[]"] option').eq(i).val(); $('[name="serversdisabled[]"]').append(new Option(option, option)); $('[name="servers[]"] option').eq(i).remove(); @@ -310,7 +324,7 @@ events.push(function(){ checkPoolControls(); // On submit - $('form').submit(function(){ + $('form').submit(function() { AllServers($('[name="servers[]"] option'), true); AllServers($('[name="serversdisabled[]"] option'), true); }); @@ -320,8 +334,9 @@ events.push(function(){ </script> <?php -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(new Form_Button( 'Submit', @@ -375,10 +390,11 @@ $section = new Form_Section('Add item to the pool'); $monitorlist = array(); -foreach ($config['load_balancer']['monitor_type'] as $monitor) +foreach ($config['load_balancer']['monitor_type'] as $monitor) { $monitorlist[$monitor['name']] = $monitor['name']; +} -if(count($config['load_balancer']['monitor_type'])) { +if (count($config['load_balancer']['monitor_type'])) { $section->addInput(new Form_Select( 'monitor', 'Monitor', @@ -417,8 +433,9 @@ $list = array(); if (is_array($pconfig['serversdisabled'])) { foreach ($pconfig['serversdisabled'] as $svrent) { - if ($svrent != '') + if ($svrent != '') { $list[$svrent] = $svrent; + } } } @@ -483,7 +500,7 @@ print($form); ?> <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // --------- Autocomplete ----------------------------------------------------------------------------------------- var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>; diff --git a/src/usr/local/www/load_balancer_setting.php b/src/usr/local/www/load_balancer_setting.php index 13dacb5..204d762 100644 --- a/src/usr/local/www/load_balancer_setting.php +++ b/src/usr/local/www/load_balancer_setting.php @@ -120,20 +120,23 @@ 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"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} -if (is_subsystem_dirty('loadbalancer')) +if (is_subsystem_dirty('loadbalancer')) { print_info_box_np(gettext("The load balancer configuration has been changed") . ' ' . gettext("You must apply the changes in order for them to take effect."), 'Apply', null, false, 'danger'); +} /* active tabs */ $tab_array = array(); diff --git a/src/usr/local/www/load_balancer_virtual_server.php b/src/usr/local/www/load_balancer_virtual_server.php index 41439a4..2daed10 100644 --- a/src/usr/local/www/load_balancer_virtual_server.php +++ b/src/usr/local/www/load_balancer_virtual_server.php @@ -126,14 +126,17 @@ $shortcut_section = "relayd-virtualservers"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} -if ($savemsg) +if ($savemsg) { print_info_box($savemsg); +} -if (is_subsystem_dirty('loadbalancer')) +if (is_subsystem_dirty('loadbalancer')) { print_info_box_np(gettext("The virtual server configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); +} /* active tabs */ $tab_array = array(); @@ -163,9 +166,9 @@ display_top_tabs($tab_array); </thead> <tbody> <?php -if(!empty($a_vs)) { +if (!empty($a_vs)) { $i = 0; - foreach($a_vs as $a_v) { + foreach ($a_vs as $a_v) { ?> <tr> <td><?=htmlspecialchars($a_v['name'])?></td> diff --git a/src/usr/local/www/load_balancer_virtual_server_edit.php b/src/usr/local/www/load_balancer_virtual_server_edit.php index b4472dc..56e85b8 100644 --- a/src/usr/local/www/load_balancer_virtual_server_edit.php +++ b/src/usr/local/www/load_balancer_virtual_server_edit.php @@ -198,8 +198,9 @@ $shortcut_section = "relayd-virtualservers"; include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); +} $form = new Form(); @@ -307,7 +308,7 @@ print_info_box(gettext('Don\'t forget to add a firewall rule for the virtual ser ?> <script type="text/javascript"> //<![CDATA[ -events.push(function(){ +events.push(function() { // --------- Autocomplete ----------------------------------------------------------------------------------------- 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"))) ?>; diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php index 823c575..c1ff4d4 100644 --- a/src/usr/local/www/pkg_edit.php +++ b/src/usr/local/www/pkg_edit.php @@ -1442,8 +1442,9 @@ print($form); if ($pkg['note'] != "") { print_info_box($pkg['note']); +} -if ($pkg['custom_php_after_form_command']) +if ($pkg['custom_php_after_form_command']) { eval($pkg['custom_php_after_form_command']); } diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php index 0524cf7..7166ad7 100644 --- a/src/usr/local/www/status_logs_filter.php +++ b/src/usr/local/www/status_logs_filter.php @@ -422,7 +422,7 @@ if (!$rawfilter) { // Advanced log filter form $group->add(new Form_Checkbox( 'actpass', - 'Pass', + null, 'Pass', in_arrayi('Pass', $Include_Act), 'Pass' @@ -463,7 +463,7 @@ if (!$rawfilter) { // Advanced log filter form $group->add(new Form_Checkbox( 'actblock', - 'Block', + null, 'Block', in_arrayi('Block', $Include_Act), 'Block' @@ -505,7 +505,7 @@ if (!$rawfilter) { // Advanced log filter form $group->add(new Form_Select( 'interface', - 'Interface', + null, $interfacefilter, build_if_list() ))->setWidth(2)->setHelp('Interface'); @@ -666,21 +666,21 @@ if (!$rawfilter) { $dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto); $dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']); ?> - <td> - <i class="fa fa-info icon-pointer icon-primary" onclick="javascript:resolve_with_ajax('<?="{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve")?>" alt="Reverse Resolve with DNS"/> + <td style="white-space:nowrap;"> + <i class="fa fa-info icon-pointer icon-primary" onclick="javascript:resolve_with_ajax('<?="{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve")?>"> </i> - <i class="fa fa-minus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=block&int={$int}&src={$filterent['srcip']}&ipproto={$ipproto}"; ?>" alt="Easy Rule: Add to Block List" title="<?=gettext("Easy Rule: Add to Block List")?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")?>')"> - </i> + <a class="fa fa-minus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=block&int={$int}&src={$filterent['srcip']}&ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List")?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")?>')"> + </a> <?=$srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>'?> </td> - <td> - <i class="fa fa-info icon-pointer icon-primary" onclick="javascript:resolve_with_ajax('<?="{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve")?>" class="ICON-<?= $dst_htmlclass; ?>" alt="Reverse Resolve with DNS"/> + <td style="white-space:nowrap;"> + <i class="fa fa-info icon-pointer icon-primary; ICON-<?= $dst_htmlclass; ?>" onclick="javascript:resolve_with_ajax('<?="{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve")?>"> </i> - <i class="fa fa-plus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=pass&int={$int}&proto={$proto}&src={$filterent['srcip']}&dst={$filterent['dstip']}&dstport={$filterent['dstport']}&ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic")?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")?>')"> - </i> + <a class="fa fa-plus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=pass&int={$int}&proto={$proto}&src={$filterent['srcip']}&dst={$filterent['dstip']}&dstport={$filterent['dstport']}&ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic")?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")?>')"> + </a> <?=$dststr . '<span class="RESOLVE-' . $dst_htmlclass . '"></span>'?> </td> <?php |