aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2015-01-07 13:13:15 -0500
committerBBcan177 <bbcan177@gmail.com>2015-01-07 13:13:15 -0500
commite972b644be1226be1e756334c43062e7b83bdbb1 (patch)
tree136f186862db0d13650f8d1d10687db98cf69d39
parent16b1354f5ded71763ee05a9ceae298c5e48f566a (diff)
downloadpfsense-packages-e972b644be1226be1e756334c43062e7b83bdbb1.tar.gz
pfsense-packages-e972b644be1226be1e756334c43062e7b83bdbb1.tar.bz2
pfsense-packages-e972b644be1226be1e756334c43062e7b83bdbb1.zip
Improve Alert Tab - Suppression Code
When the user clicked "Cancel" in the second JS Prompt, it would not cancel the Suppression process. This change fixes that issue.
-rw-r--r--config/pfblockerng/pfblockerng_alerts.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/config/pfblockerng/pfblockerng_alerts.php b/config/pfblockerng/pfblockerng_alerts.php
index 1b54f8f2..541d1e03 100644
--- a/config/pfblockerng/pfblockerng_alerts.php
+++ b/config/pfblockerng/pfblockerng_alerts.php
@@ -143,9 +143,14 @@ if (isset($_POST['addsuppress'])) {
$ip = $_POST['ip'];
$table = $_POST['table'];
$descr = $_POST['descr'];
- if (empty($descr))
- $descr = sprintf(gettext("Entry added %s"), date('r'));
$cidr = $_POST['cidr'];
+
+ // If Description or CIDR field is empty, exit.
+ if (empty($descr) || empty($cidr)) {
+ header("Location: " . $_SERVER['PHP_SELF']);
+ exit;
+ }
+
if (is_ipaddr($ip)) {
$savemsg1 = "Host IP address {$ip}";
@@ -730,8 +735,10 @@ function hostruleid(host,table) {
var description = prompt("Please enter Suppression Description");
document.getElementById("descr").value = description;
- var cidr = prompt("Please enter CIDR [ 32 or 24 CIDR only supported ]","32");
- document.getElementById("cidr").value = cidr;
+ if (description.value != "") {
+ var cidr = prompt("Please enter CIDR [ 32 or 24 CIDR only supported ]","32");
+ document.getElementById("cidr").value = cidr;
+ }
}
// Auto-Resolve of Alerted Hostnames