diff options
author | saxonbeta <saxonbeta@gmail.com> | 2012-03-29 18:19:01 -0600 |
---|---|---|
committer | saxonbeta <saxonbeta@gmail.com> | 2012-03-29 18:19:01 -0600 |
commit | 63f8ba46162fc25d5512fdcfe91d9f622de6e52e (patch) | |
tree | 5a5ad206edfca999a5017d772ab3a61d2ce8ff5d | |
parent | b1e79dec2f2cd22ba1cb5b15fb02f84bb8121c9d (diff) | |
download | pfsense-packages-63f8ba46162fc25d5512fdcfe91d9f622de6e52e.tar.gz pfsense-packages-63f8ba46162fc25d5512fdcfe91d9f622de6e52e.tar.bz2 pfsense-packages-63f8ba46162fc25d5512fdcfe91d9f622de6e52e.zip |
When creating conf file, check if dest definition contains _adv or _ads and if F_ADV_BLANKIMG is on, then add a redirect to get a blank image instead of the default block page
-rw-r--r-- | config/squidGuard/squidguard_configurator.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc index 3347b48b..c69ef0ee 100644 --- a/config/squidGuard/squidguard_configurator.inc +++ b/config/squidGuard/squidguard_configurator.inc @@ -273,6 +273,9 @@ define('F_ENABLELOG', 'enablelog'); define('F_ENABLEGUILOG', 'enableguilog'); define('F_LOGROTATION', 'logrotation'); +#Clean adversiting +define('F_ADV_BLANKIMG', 'adv_blankimg'); + # transparent mode define('F_SQUID_TRANSPARENT_MODE', 'squid_transparent_mode'); define('F_CURRENT_LAN_IP', 'current_lan_ip'); @@ -910,6 +913,13 @@ function sg_create_config() if ($ent_state[F_DOMAINS]) $sg_tag->items[] = "domainlist $ent/domains"; if ($ent_state[F_EXPRESSIONS]) $sg_tag->items[] = "expressionlist $ent/expressions"; if ($ent_state[F_URLS]) $sg_tag->items[] = "urllist $ent/urls"; + + # Check if $ent contains adv or ads, and F_ADV_BLANKIMG is on then add a custom redirect + $adv_pos = strpos($ent,'_adv'); + $ads_pos = strpos($ent, '_ads'); + if ( ($ads_pos > 0 || $adv_pos > 0) && $squidguard_config[F_ADV_BLANKIMG] == 'on') + $sg_tag->items[] = "redirect " . sg_redirector_base_url($dst[F_REDIRECT], RMOD_INT_BLANKIMG); + if ($squidguard_config[F_ENABLELOG] == 'on' ) { $sg_tag->items[] = "log ". SQUIDGUARD_LOGFILE; } @@ -2450,4 +2460,4 @@ class TSgTag } } -?> +?>
\ No newline at end of file |