Forwarding hosts: don’t add configuration if none are defined
parent
08612f0aef
commit
affa52edcf
|
@ -31,8 +31,6 @@ catch (PDOException $e) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
settings {
|
settings {
|
||||||
whitelist_forwarding_hosts {
|
|
||||||
priority = high;
|
|
||||||
<?php
|
<?php
|
||||||
try {
|
try {
|
||||||
$stmt = $pdo->query("SELECT `host` FROM `forwarding_hosts`");
|
$stmt = $pdo->query("SELECT `host` FROM `forwarding_hosts`");
|
||||||
|
@ -42,6 +40,12 @@ catch (PDOException $e) {
|
||||||
$rows = array();
|
$rows = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($rows)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
whitelist_forwarding_hosts {
|
||||||
|
priority = high;
|
||||||
|
<?php
|
||||||
foreach ($rows as $host) {
|
foreach ($rows as $host) {
|
||||||
echo "\t\t" . 'ip = "' . $host . '";' . "\n";
|
echo "\t\t" . 'ip = "' . $host . '";' . "\n";
|
||||||
}
|
}
|
||||||
|
@ -56,6 +60,7 @@ foreach ($rows as $host) {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
$stmt = $pdo->query("SELECT DISTINCT `object` FROM `filterconf` WHERE `option` = 'highspamlevel' OR `option` = 'lowspamlevel'");
|
$stmt = $pdo->query("SELECT DISTINCT `object` FROM `filterconf` WHERE `option` = 'highspamlevel' OR `option` = 'lowspamlevel'");
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue