function collectsuppression() { global $pfb; $dnssupp_ex = array(); $custom_list = pfbng_text_area_decode($pfb['dnsblconfig']['suppression']); if (!empty($custom_list)) { $dnssupp_ex = array_filter(explode("\n", pfbng_text_area_decode($pfb['dnsblconfig']['suppression']))); } return $dnssupp_ex; }
} // Collect number of suppressed hosts $pfbsupp_cnt = 0; if (file_exists("{$pfb['supptxt']}")) { $pfbsupp_cnt = exec("{$pfb['grep']} -c ^ {$pfb['supptxt']}"); } // Alerts tab customizations $aglobal_array = array('pfbdenycnt' => 25, 'pfbpermitcnt' => 5, 'pfbmatchcnt' => 5, 'pfbdnscnt' => 5, 'alertrefresh' => 'on', 'hostlookup' => 'on'); $pfb['aglobal'] =& $config['installedpackages']['pfblockerngglobal']; foreach ($aglobal_array as $type => $value) { ${"{$type}"} = $pfb['aglobal'][$type] != '' ? $pfb['aglobal'][$type] : $value; } // Collect DNSBL suppression list $pfb['dsupp'] =& $config['installedpackages']['pfblockerngdnsblsettings']['config'][0]['suppression']; $dnssupp_ex = array(); $suppression = pfbng_text_area_decode($pfb['dnsblconfig']['suppression'], TRUE); if (isset($suppression)) { foreach ($suppression as $dnssupp) { // Create 1) array for the suppressed domains 2) A string with the domain and comment text $dnssupp_ex[] = $dnssupp[0]; $dnssupp_dat .= "{$dnssupp[0]}{$dnssupp[1]}\r\n"; } } // Save Alerts tab customizations if (isset($_POST['save'])) { $pfb['aglobal']['alertrefresh'] = htmlspecialchars($_POST['alertrefresh']) ?: 'off'; $pfb['aglobal']['hostlookup'] = htmlspecialchars($_POST['hostlookup']) ?: 'off'; unset($aglobal_array['alertrefresh'], $aglobal_array['hostlookup']); foreach ($aglobal_array as $type => $value) { if (ctype_digit(htmlspecialchars($_POST[$type]))) { $pfb['aglobal'][$type] = htmlspecialchars($_POST[$type]);