aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2015-02-03 23:52:14 -0500
committerBBcan177 <bbcan177@gmail.com>2015-02-03 23:52:14 -0500
commit484a88e083e59348c7fa0cc9e33b1430f32e4e13 (patch)
tree3a3dc148997f3c1631d544e02149c78120983724
parent23b21b4b325deb7b438d8f781d86a434778dfe21 (diff)
downloadpfsense-packages-484a88e083e59348c7fa0cc9e33b1430f32e4e13.tar.gz
pfsense-packages-484a88e083e59348c7fa0cc9e33b1430f32e4e13.tar.bz2
pfsense-packages-484a88e083e59348c7fa0cc9e33b1430f32e4e13.zip
pfBlockerNG - Fix Force Cron Function
Changes: 1) When the User selects "Force Cron" and "no updates" are required, the function doesn't complete properly, and didn't restore the Cron Task. 2) XMLRPC Sync add Maxmind "Annonymous Proxy and Satellite Providers"
-rw-r--r--config/pfblockerng/pfblockerng.inc37
-rw-r--r--config/pfblockerng/pfblockerng.php6
2 files changed, 25 insertions, 18 deletions
diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc
index 66b5a313..0eb3ff43 100644
--- a/config/pfblockerng/pfblockerng.inc
+++ b/config/pfblockerng/pfblockerng.inc
@@ -350,13 +350,21 @@ function sync_package_pfblockerng($cron = "") {
}
log_error("[pfBlockerNG] Starting sync process.");
+ // Force Update - Set 'Save' variable when 'No Updates' found.
+ if ($cron == "noupdates") {
+ $pfb['save'] = TRUE;
+ }
+
# Start of pfBlockerNG Logging to 'pfblockerng.log'
if ($pfb['enable'] == "on" && !$pfb['save']) {
$log = " UPDATE PROCESS START [ NOW ]\n";
+ pfb_logger("{$log}","1");
} else {
- $log = "\n**Saving Configuration [ NOW ] ...\n";
+ if ($cron != "noupdates") {
+ $log = "\n**Saving Configuration [ NOW ] ...\n";
+ pfb_logger("{$log}","1");
+ }
}
- pfb_logger("{$log}","1");
# TBC if Required ! (Fetch Timeout in 2.2)
@@ -2561,18 +2569,19 @@ function pfblockerng_do_xmlrpc_sync($sync_to_ip, $port, $protocol, $username, $p
$xml = array();
// If User Disabled, remove 'General Tab Customizations' from Sync
if ($config['installedpackages']['pfblockerngsync']['config'][0]['syncinterfaces'] == "")
- $xml['pfblockerng'] = $config['installedpackages']['pfblockerng'];
- $xml['pfblockerngreputation'] = $config['installedpackages']['pfblockerngreputation'];
- $xml['pfblockernglistsv4'] = $config['installedpackages']['pfblockernglistsv4'];
- $xml['pfblockernglistsv6'] = $config['installedpackages']['pfblockernglistsv6'];
- $xml['pfblockerngtopspammers'] = $config['installedpackages']['pfblockerngtopspammers'];
- $xml['pfblockerngafrica'] = $config['installedpackages']['pfblockerngafrica'];
- $xml['pfblockerngantartica'] = $config['installedpackages']['pfblockerngantartica'];
- $xml['pfblockerngasia'] = $config['installedpackages']['pfblockerngasia'];
- $xml['pfblockerngeurope'] = $config['installedpackages']['pfblockerngeurope'];
- $xml['pfblockerngnorthamerica'] = $config['installedpackages']['pfblockerngnorthamerica'];
- $xml['pfblockerngoceania'] = $config['installedpackages']['pfblockerngoceania'];
- $xml['pfblockerngsouthamerica'] = $config['installedpackages']['pfblockerngsouthamerica'];
+ $xml['pfblockerng'] = $config['installedpackages']['pfblockerng'];
+ $xml['pfblockerngreputation'] = $config['installedpackages']['pfblockerngreputation'];
+ $xml['pfblockernglistsv4'] = $config['installedpackages']['pfblockernglistsv4'];
+ $xml['pfblockernglistsv6'] = $config['installedpackages']['pfblockernglistsv6'];
+ $xml['pfblockerngtopspammers'] = $config['installedpackages']['pfblockerngtopspammers'];
+ $xml['pfblockerngafrica'] = $config['installedpackages']['pfblockerngafrica'];
+ $xml['pfblockerngantartica'] = $config['installedpackages']['pfblockerngantartica'];
+ $xml['pfblockerngasia'] = $config['installedpackages']['pfblockerngasia'];
+ $xml['pfblockerngeurope'] = $config['installedpackages']['pfblockerngeurope'];
+ $xml['pfblockerngnorthamerica'] = $config['installedpackages']['pfblockerngnorthamerica'];
+ $xml['pfblockerngoceania'] = $config['installedpackages']['pfblockerngoceania'];
+ $xml['pfblockerngsouthamerica'] = $config['installedpackages']['pfblockerngsouthamerica'];
+ $xml['pfblockerngproxyandsatellite'] = $config['installedpackages']['pfblockerngproxyandsatellite'];
/* assemble xmlrpc payload */
$params = array(
diff --git a/config/pfblockerng/pfblockerng.php b/config/pfblockerng/pfblockerng.php
index ca8a23a9..0ca3aa7d 100644
--- a/config/pfblockerng/pfblockerng.php
+++ b/config/pfblockerng/pfblockerng.php
@@ -418,13 +418,11 @@ if ($argv[1] == 'cron') {
if ($pfb['update_cron']) {
sync_package_pfblockerng("cron");
} else {
- $log = "\n No Updates required. \n\n";
+ sync_package_pfblockerng("noupdates");
+ $log = "\n No Updates required.\n CRON PROCESS ENDED\n UPDATE PROCESS ENDED\n";
pfb_logger("{$log}","1");
}
- $log = " CRON PROCESS ENDED [ NOW ]\n";
- pfb_logger("{$log}","1");
-
# Call Log Mgmt Function
// If Update GUI 'Manual view' is selected. Last output will be missed. So sleep for 5 secs.
sleep(5);