DNS: Make YouTube configurable for Safe Search

When safe search is enabled, it is being enabled on YouTube, too.

This creates problems in some scenarios like schools where politics
is being tought as well as other subjects that might be censored by
YouTube (i.e. election TV spots).

Therefore it is now possible to exclude YouTube from Safe Search
but keep it enabled for the search engines.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2020-11-07 12:59:08 +00:00
parent f60ae20cc8
commit 65ef52a335
13 changed files with 73 additions and 38 deletions

View File

@@ -87,6 +87,10 @@ if ($cgiparams{'GENERAL'} eq $Lang::tr{'save'}) {
$cgiparams{'ENABLE_SAFE_SEARCH'} = "off";
}
if ($cgiparams{'ENABLE_SAFE_SEARCH_YOUTUBE'} ne "on") {
$cgiparams{'ENABLE_SAFE_SEARCH_YOUTUBE'} = "off";
}
# Check if using ISP nameservers and TLS is enabled at the same time.
if (($cgiparams{'USE_ISP_NAMESERVERS'} eq "on") && ($cgiparams{'PROTO'} eq "TLS")) {
$errormessage = $Lang::tr{'dns isp nameservers and tls not allowed'}
@@ -259,6 +263,7 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
# Hash to store the generic DNS settings.
my %settings = ();
$settings{"ENABLE_SAFE_SEARCH_YOUTUBE"} = "on";
# Read-in general DNS settings.
&General::readhash("$settings_file", \%settings);
@@ -310,6 +315,10 @@ $checked{'ENABLE_SAFE_SEARCH'}{'off'} = '';
$checked{'ENABLE_SAFE_SEARCH'}{'on'} = '';
$checked{'ENABLE_SAFE_SEARCH'}{$settings{'ENABLE_SAFE_SEARCH'}} = "checked='checked'";
$checked{'ENABLE_SAFE_SEARCH_YOUTUBE'}{'off'} = '';
$checked{'ENABLE_SAFE_SEARCH_YOUTUBE'}{'on'} = '';
$checked{'ENABLE_SAFE_SEARCH_YOUTUBE'}{$settings{'ENABLE_SAFE_SEARCH_YOUTUBE'}} = "checked='checked'";
$selected{'PROTO'}{'UDP'} = '';
$selected{'PROTO'}{'TLS'} = '';
$selected{'PROTO'}{'TCP'} = '';
@@ -381,6 +390,16 @@ sub show_general_dns_configuration () {
</td>
</tr>
<tr>
<td width="33%">
&raquo; $Lang::tr{'dns enable safe-search youtube'}
</td>
<td>
<input type="checkbox" name="ENABLE_SAFE_SEARCH_YOUTUBE" $checked{'ENABLE_SAFE_SEARCH_YOUTUBE'}{'on'}>
</td>
</tr>
<tr>
<td colspan="2">
<br>