Commit e6cb541f authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Fixed disabling of greylisting, it showed up always as inherited and not disabled

parent 82de8b2b
......@@ -284,7 +284,7 @@ if ($_POST['frmaction'] == "add") {
$AWLCount = $_POST['greylisting_awlcount'];
}
# AWL percentage
if (empty($_POST['greylisting_awlpercentage'])) {
if (!isset($_POST['greylisting_awlpercentage']) || $_POST['greylisting_awlpercentage'] == "") {
$AWLPercentage = null;
} else {
$AWLPercentage = $_POST['greylisting_awlpercentage'];
......@@ -315,7 +315,7 @@ if ($_POST['frmaction'] == "add") {
$ABLCount = $_POST['greylisting_ablcount'];
}
# ABL percentage
if (empty($_POST['greylisting_ablpercentage'])) {
if (!isset($_POST['greylisting_ablpercentage']) || $_POST['greylisting_ablpercentage'] == "") {
$ABLPercentage = null;
} else {
$ABLPercentage = $_POST['greylisting_ablpercentage'];
......
......@@ -281,7 +281,15 @@ if ($_POST['frmaction'] == "change") {
<?php tooltip('greylisting_awl_percentage'); ?>
</td>
<td class="oldval">
<?php echo is_null($row->autowhitelistpercentage) ? '*inherited*' : $row->autowhitelistpercentage ?>
<?php
if (is_null($row->autowhitelistpercentage)) {
echo '*inherited*';
} elseif ($row->autowhitelistpercentage == "0") {
echo '*disabled*';
} else {
echo $row->autowhitelistpercentage;
}
?>
</td>
<td>
<input type="text" name="greylisting_awlpercentage" />
......@@ -360,7 +368,15 @@ if ($_POST['frmaction'] == "change") {
<?php tooltip('greylisting_abl_percentage'); ?>
</td>
<td class="oldval">
<?php echo is_null($row->autoblacklistpercentage) ? '*inherited*' : $row->autoblacklistpercentage ?>
<?php
if (is_null($row->autoblacklistpercentage)) {
echo '*inherited*';
} elseif ($row->autoblacklistpercentage == "0") {
echo '*disabled*';
} else {
echo $row->autoblacklistpercentage;
}
?>
</td>
<td>
<input type="text" name="greylisting_ablpercentage" />
......@@ -505,7 +521,7 @@ if ($_POST['frmaction'] == "change") {
if (!empty($_POST['greylisting_awlpercentage_m'])) {
if ($_POST['greylisting_awlpercentage_m'] == "1") {
$awlpercentage = null;
} elseif ($_POST['greylisting_awlpercentage_m'] == "2") {
} else {
$awlpercentage = $_POST['greylisting_awlpercentage'];
}
array_push($updates,"AutoWhitelistPercentage = ".$db->quote($awlpercentage));
......@@ -546,7 +562,7 @@ if ($_POST['frmaction'] == "change") {
if (!empty($_POST['greylisting_ablpercentage_m'])) {
if ($_POST['greylisting_ablpercentage_m'] == "1") {
$ablpercentage = null;
} elseif ($_POST['greylisting_ablpercentage_m'] == "2") {
} else {
$ablpercentage = $_POST['greylisting_ablpercentage'];
}
array_push($updates,"AutoBlacklistPercentage = ".$db->quote($ablpercentage));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment