###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2005-2010 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
my $uqfile = "${General::swroot}/urlfilter/userquota";
my $dbdir = "${General::swroot}/urlfilter/blacklists";
my $editdir = "${General::swroot}/urlfilter/editor";
-my $repository = "/home/httpd/html/repository";
+my $repository = "/var/urlrepo";
my $hintcolour = '#FFFFCC';
my $sourceurlfile = "${General::swroot}/urlfilter/autoupdate/autoupdate.urls";
my $updconffile = "${General::swroot}/urlfilter/autoupdate/autoupdate.conf";
my $updflagfile = "${General::swroot}/urlfilter/blacklists/.autoupdate.last";
-my $upd_cron_dly = "${General::swroot}/urlfilter/autoupdate/cron.daily";
-my $upd_cron_wly = "${General::swroot}/urlfilter/autoupdate/cron.weekly";
-my $upd_cron_mly = "${General::swroot}/urlfilter/autoupdate/cron.monthly";
my $errormessage='';
my $updatemessage='';
print FILE "CUSTOM_UPDATE_URL=$filtersettings{'CUSTOM_UPDATE_URL'}\n";
close FILE;
- if (-e $upd_cron_dly) { unlink($upd_cron_dly); }
- if (-e $upd_cron_wly) { unlink($upd_cron_wly); }
- if (-e $upd_cron_mly) { unlink($upd_cron_mly); }
if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && ($filtersettings{'UPDATE_SCHEDULE'} eq 'daily'))
{
- symlink("../bin/autoupdate.pl",$upd_cron_dly)
- } else {
- symlink("/bin/false",$upd_cron_dly)
+ system('/usr/local/bin/urlfilterctrl cron daily >/dev/null 2>&1');
}
if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && ($filtersettings{'UPDATE_SCHEDULE'} eq 'weekly'))
{
- symlink("../bin/autoupdate.pl",$upd_cron_wly)
- } else {
- symlink("/bin/false",$upd_cron_wly)
+ system('/usr/local/bin/urlfilterctrl cron weekly >/dev/null 2>&1');
}
if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && ($filtersettings{'UPDATE_SCHEDULE'} eq 'monthly'))
{
- symlink("../bin/autoupdate.pl",$upd_cron_mly)
- } else {
- symlink("/bin/false",$upd_cron_mly)
+ system('/usr/local/bin/urlfilterctrl cron monthly >/dev/null 2>&1');
}
}
}
<td colspan='2'>$Lang::tr{'urlfilter blocked domains'} <img src='/blob.gif' alt='*' /></td>
<td colspan='2'>$Lang::tr{'urlfilter blocked urls'} <img src='/blob.gif' alt='*' /></td>
</tr>
+<tr>
+ <td colspan='2'>$Lang::tr{'urlfilter example'}</td>
+ <td colspan='2'>$Lang::tr{'urlfilter example ads'}</td>
+</tr>
<tr>
<td colspan='2' width='50%'><textarea name='CUSTOM_BLACK_DOMAINS' cols='32' rows='6' wrap='off'>
END
<td colspan='2'>$Lang::tr{'urlfilter allowed domains'} <img src='/blob.gif' alt='*' /></td>
<td colspan='2'>$Lang::tr{'urlfilter allowed urls'} <img src='/blob.gif' alt='*' /></td>
</tr>
+<tr>
+ <td colspan='2'>$Lang::tr{'urlfilter example'}</td>
+ <td colspan='2'>$Lang::tr{'urlfilter example ads'}</td>
+</tr>
<tr>
<td colspan='2' width='50%'><textarea name='CUSTOM_WHITE_DOMAINS' cols='32' rows='6' wrap='off'>
END
foreach $category (@categories) {
$blacklist = $category;
$category =~ s/\//_/g;
- #if ( $filtersettings{"FILTER_".uc($category)} ne "on" ){next;}
+
+ if ( $filtersettings{"FILTER_".uc($category)} ne "on" ){
+ my $constraintrule = "false";
+
+ foreach (@tclist){
+ chomp;
+ @tc = split(/\,/);
+ $tc[13] =~ s/\//_/g;
+ if ($tc[15] eq 'on' && $tc[13] =~ $category){
+ $constraintrule = "true";
+ }
+ }
+
+ if ( $constraintrule eq "false"){
+ next;
+ }
+ }
+
print FILE "dest $category {\n";
if (-e "$dbdir/$blacklist/domains") {
print FILE " domainlist $blacklist\/domains\n";