$Lang::tr{'urlfilter block ip'}: |
|
- $Lang::tr{'urlfilter children'}: |
- |
$Lang::tr{'urlfilter block all'}: |
@@ -2562,6 +2515,13 @@ sub savesettings
delete $filtersettings{'BACKGROUND'};
delete $filtersettings{'UPDATEFILE'};
+ system("chown -R nobody.nobody $dbdir");
+ system('/usr/bin/squidGuard -C custom/allowed/domains >/dev/null 2>&1');
+ system('/usr/bin/squidGuard -C custom/allowed/urls >/dev/null 2>&1');
+ system('/usr/bin/squidGuard -C custom/blocked/domains >/dev/null 2>&1');
+ system('/usr/bin/squidGuard -C custom/blocked/urls >/dev/null 2>&1 ');
+ &setpermissions ($dbdir);
+
&General::writehash("${General::swroot}/urlfilter/settings", \%filtersettings);
}
@@ -2578,7 +2538,7 @@ sub readblockcategories
@filtergroups = @categories;
foreach (@filtergroups) {
- s/\//_SLASH_/g;
+ s/\//_/g;
tr/a-z/A-Z/;
$_ = "FILTER_".$_;
}
@@ -2783,7 +2743,7 @@ sub writeconfigfile
if ($filtersettings{'SHOW_URL'} eq 'on') { $redirect .= "&url=%u"; }
if ($filtersettings{'SHOW_IP'} eq 'on') { $redirect .= "&ip=%a"; }
$redirect =~ s/^&/?/;
- $redirect = "http:\/\/$netsettings{'GREEN_ADDRESS'}:$http_port\/redirect.cgi".$redirect;
+ $redirect = "http:\/\/$netsettings{'GREEN_ADDRESS'}:$http_port\/redirect.cgi".$redirect;
} else {
$redirect="http:\/\/$netsettings{'GREEN_ADDRESS'}:$http_port\/redirect.cgi";
}
@@ -3001,6 +2961,24 @@ sub writeconfigfile
foreach $category (@categories) {
$blacklist = $category;
$category =~ s/\//_/g;
+
+ 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";
@@ -3027,7 +3005,7 @@ sub writeconfigfile
print FILE "}\n\n";
$category = $blacklist;
}
-
+
print FILE "dest files {\n";
print FILE " expressionlist custom\/blocked\/files\n";
if ($filtersettings{'ENABLE_LOG'} eq 'on')