move skip_rules_gw_down feature to rule processing

This commit is contained in:
Ad Schellevis 2017-06-11 19:35:36 +02:00 committed by Franco Fichtner
parent b4553f0454
commit 1a3cd61dee
2 changed files with 8 additions and 0 deletions

View File

@ -313,6 +313,11 @@ class FilterRule
if (!empty($interface) && empty($this->interfaceMapping[$interface]['if'])) {
$tmp['disabled'] = true;
}
// disable rules when gateway is down and skip_rules_gw_down is set
if (!empty($tmp['skip_rules_gw_down']) && !empty($tmp['gateway']) &&
empty($this->gatewayMapping[$tmp['gateway']])) {
$tmp['disabled'] = true;
}
if (!isset($tmp['quick'])) {
// all rules are quick by default except floating
$tmp['quick'] = !isset($rule['floating']) ? true : false;

View File

@ -51,6 +51,9 @@ class Plugin
if (!empty(Config::getInstance()->object()->system->disablereplyto)) {
$this->systemDefaults['disablereplyto'] = true;
}
if (!empty(Config::getInstance()->object()->system->skip_rules_gw_down)) {
$this->systemDefaults['skip_rules_gw_down'] = true;
}
}
/**