X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=philter%2Fphilter%2Finclude%2Frule.inc.php;fp=philter%2Fphilter%2Finclude%2Frule.inc.php;h=e18d47064ce9704c616951ad19928d2e5302e078;hb=fd96b13fe3c1a82b2f4c041ff3fd81a6bcd71dbc;hp=218e59cb8bc8e8719e6196d3ff0fd5b906651eb5;hpb=f03530ce96970815720671b9b4afa3870f702f0d;p=old-projects.git diff --git a/philter/philter/include/rule.inc.php b/philter/philter/include/rule.inc.php index 218e59c..e18d470 100644 --- a/philter/philter/include/rule.inc.php +++ b/philter/philter/include/rule.inc.php @@ -89,34 +89,30 @@ class Rule { function to_string() { global $philter; + $bloc = "{\n"; + foreach($this->actions as $action) + $bloc .= $philter->config['action_plugins'][$action[0]]->to_string($action); + $bloc.= " :0\n" + . " /dev/null\n" + . "}\n"; + $res = $this->block ? ":0\n" : ":0 c\n"; if($this->all) { foreach($this->matches as $match) $res .= $philter->config['match_plugins'][$match[0]]->to_string($match); + $res .= $bloc; } else { $i = 0; $res = ''; foreach($this->matches as $match) { - $res .= (empty($i) ? ":0 f\n" : ":0 fE\n"); + $res .= (empty($i) ? ":0\n" : ":0 E\n"); $res .= $philter->config['match_plugins'][$match[0]]->to_string($match); - $res .= "| formail -I'X-Philter-Or: yes'\n"; + $res .= $bloc; $i++; } - - $res.= ":0 f\n" - . "* ^X-Philter-Or: yes\n" - . "| formail -I'X-Philter-Or'\n" - . ($this->block ? ":0 A\n" : ":0 Ac\n"); } - $res.= "{\n"; - foreach($this->actions as $action) - $res .= $philter->config['action_plugins'][$action[0]]->to_string($action); - $res.= " :0\n" - . " /dev/null\n" - . "}\n\n"; - - return $res; + return $res."\n"; } function sql_clean($_uid, $_rid) {