diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-05-06 14:01:14 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-05-06 14:01:14 -0300 |
commit | 12cf0d301455c8a4261f62f9c7c6c2383999d53e (patch) | |
tree | 817eacb05b7583e26547ca9f97d4aa4bf3ddf23c /config | |
parent | 2fd9a33b52bddc572e285603226f01749e155ba2 (diff) | |
download | pfsense-packages-12cf0d301455c8a4261f62f9c7c6c2383999d53e.tar.gz pfsense-packages-12cf0d301455c8a4261f62f9c7c6c2383999d53e.tar.bz2 pfsense-packages-12cf0d301455c8a4261f62f9c7c6c2383999d53e.zip |
Simplify logic
Diffstat (limited to 'config')
-rwxr-xr-x | config/squid3/34/squid.inc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc index d81f36b5..f5cd1c31 100755 --- a/config/squid3/34/squid.inc +++ b/config/squid3/34/squid.inc @@ -425,19 +425,20 @@ function squid_before_form_general(&$pkg) { function squid_validate_antivirus($post, &$input_errors) { global $config; - if ($post['enable']=="on") { - if ($post['squidclamav'] && preg_match("/(\S+proxy.domain\S+)/",$post['squidclamav'],$a_match)) { - $input_errors[] ="Squidclamav warns redirect points to sample config domain ({$a_match[1]})"; - $input_errors[] ="Change redirect info on 'squidclamav.conf' field to pfsense gui or an external host. "; - } - if ($post['c-icap_conf']) { - if (!preg_match("/squid_clamav/",$post['c-icap_conf'])) { - $input_errors[] ="c-icap Squidclamav service definition is no present."; - $input_errors[] ="Add 'Service squid_clamav squidclamav.so'(without quotes) to 'c-icap.conf' field in order to get it working."; - } - if (preg_match("/(Manager:Apassword\S+)/",$post['c-icap_conf'],$c_match)) { - $input_errors[] ="Remove ldap configuration'{$c_match[1]}' from 'c-icap.conf' field."; - } + if ($post['enable'] != "on") + return; + + if ($post['squidclamav'] && preg_match("/(\S+proxy.domain\S+)/",$post['squidclamav'],$a_match)) { + $input_errors[] ="Squidclamav warns redirect points to sample config domain ({$a_match[1]})"; + $input_errors[] ="Change redirect info on 'squidclamav.conf' field to pfsense gui or an external host. "; + } + if ($post['c-icap_conf']) { + if (!preg_match("/squid_clamav/",$post['c-icap_conf'])) { + $input_errors[] ="c-icap Squidclamav service definition is no present."; + $input_errors[] ="Add 'Service squid_clamav squidclamav.so'(without quotes) to 'c-icap.conf' field in order to get it working."; + } + if (preg_match("/(Manager:Apassword\S+)/",$post['c-icap_conf'],$c_match)) { + $input_errors[] ="Remove ldap configuration'{$c_match[1]}' from 'c-icap.conf' field."; } } } |