aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng.inc
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2014-12-18 17:44:12 -0500
committerBBcan177 <bbcan177@gmail.com>2014-12-18 17:44:12 -0500
commit249e28266b5ddd9002a07f4f1a36e613a8bb0da6 (patch)
treecaec1023f071cd5afc05ff79d14754f75e1c420e /config/pfblockerng/pfblockerng.inc
parent76f6a350d08df3ee84d2e5bea2c69256a433c0bd (diff)
downloadpfsense-packages-249e28266b5ddd9002a07f4f1a36e613a8bb0da6.tar.gz
pfsense-packages-249e28266b5ddd9002a07f4f1a36e613a8bb0da6.tar.bz2
pfsense-packages-249e28266b5ddd9002a07f4f1a36e613a8bb0da6.zip
Mods to inc file.
- Remove redundant $row['format'] variable - When "Keep Settings" is enabled and a full uninstall is performed, the widget does not uninstall cleanly. These changes fix this issue.
Diffstat (limited to 'config/pfblockerng/pfblockerng.inc')
-rw-r--r--config/pfblockerng/pfblockerng.inc40
1 files changed, 22 insertions, 18 deletions
diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc
index 9f35397a..69baceeb 100644
--- a/config/pfblockerng/pfblockerng.inc
+++ b/config/pfblockerng/pfblockerng.inc
@@ -1109,8 +1109,7 @@ function sync_package_pfblockerng($cron = "") {
if (file_exists($pfbfolder . '/' . $header_url . '.txt') && $pfb['reuse'] == "") {
if ($row['state'] == "Hold") {
- $log = "\n[ {$header_url} ] {$log_tab} Static Hold [ NOW ]\n";
- $row['format'] = "Hold";
+ $log = "\n[ {$header_url} ] {$log_tab} Static Hold [ NOW ]\n";
} else {
$log = "\n[ {$header_url} ] {$log_tab} exists, Reloading File [ NOW ]\n";
}
@@ -2257,12 +2256,17 @@ function pfblockerng_php_install_command() {
# Add Widget to Dashboard
update_output_window(gettext("Adding pfBlockerNG Widget to Dashboard."));
- $widgets = $config['widgets']['sequence'];
- if (!preg_match("/pfblockerng-container/", $widgets)) {
- if (empty($widgets)) {
- $config['widgets']['sequence'] = "pfblockerng-container:col2:show";
- } else {
- $config['widgets']['sequence'] .= ",pfblockerng-container:col2:show";
+ if ($pfb['keep'] == "on" && !empty($pfb['widgets'])) {
+ // Restore previous Widget setting if "Keep" is enabled.
+ $config['widgets']['sequence'] = $pfb['widgets'];
+ } else {
+ $widgets = $config['widgets']['sequence'];
+ if (!preg_match("/pfblockerng-container/", $widgets)) {
+ if (empty($widgets)) {
+ $config['widgets']['sequence'] = "pfblockerng-container:col2:show";
+ } else {
+ $config['widgets']['sequence'] .= ",pfblockerng-container:col2:show";
+ }
}
}
}
@@ -2325,19 +2329,19 @@ function pfblockerng_php_deinstall_command() {
unlink_if_exists("{$pfb_file}.txt");
}
}
+ }
- # Remove Widget (code from Snort deinstall)
- $widgets = $config['widgets']['sequence'];
- if (!empty($widgets)) {
- $widgetlist = explode(",", $widgets);
- foreach ($widgetlist as $key => $widget) {
- if (strstr($widget, "pfblockerng-container")) {
- unset($widgetlist[$key]);
- break;
- }
+ # Remove Widget (code from Snort deinstall)
+ $pfb['widgets'] = $config['widgets']['sequence'];
+ if (!empty($pfb['widgets'])) {
+ $widgetlist = explode(",", $pfb['widgets']);
+ foreach ($widgetlist as $key => $widget) {
+ if (strstr($widget, "pfblockerng-container")) {
+ unset($widgetlist[$key]);
+ break;
}
- $config['widgets']['sequence'] = implode(",", $widgetlist);
}
+ $config['widgets']['sequence'] = implode(",", $widgetlist);
}
update_output_window(gettext("pfBlockerNG has been Uninstalled"));
}