]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/dns.cgi
Merge remote-tracking branch 'ms/next-dns-ng' into next
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / dns.cgi
index 69ab7bb7b8f0a40c5aa8b6758ef48cdc43d4cd18..ff228422bc3c00a42d41d78681591625673dc1f1 100755 (executable)
@@ -87,11 +87,20 @@ if ($cgiparams{'GENERAL'} eq $Lang::tr{'save'}) {
                $cgiparams{'ENABLE_SAFE_SEARCH'} = "off";
        }
 
-       # Store settings into settings file.
-       &General::writehash("$settings_file", \%cgiparams);
+       # 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'}
+       }
 
-       # Call function to handle unbound restart, etc.
-       &_handle_unbound_and_more()
+       # Check if there was an error.
+       if ( ! $errormessage) {
+
+               # Store settings into settings file.
+               &General::writehash("$settings_file", \%cgiparams);
+
+               # Call function to handle unbound restart, etc.
+               &_handle_unbound_and_more()
+       }
 }
 
 ###
@@ -168,7 +177,7 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
 
                        # The first allowed id is 3 to keep space for
                        # possible ISP assigned DNS servers.
-                       if ($id le "2") {
+                       if ($id <= "2") {
                                $id = "3";
                        }
                }
@@ -544,7 +553,7 @@ END
                                        $status = &check_nameserver("$nameserver", "ping.ipfire.org", "$settings{'PROTO'}", "$tls_hostname");
                                }
 
-                               if (!$status) {
+                               if (!defined $status) {
                                        $status_short = "$Lang::tr{'disabled'}";
 
                                # DNSSEC Not supported
@@ -803,7 +812,7 @@ END
 # Private function to handle the restart of unbound and more.
 sub _handle_unbound_and_more () {
        # Restart unbound
-       system('/usr/local/bin/unboundctrl restart >/dev/null');
+       system('/usr/local/bin/unboundctrl reload >/dev/null');
 
        # Check if the IDS is running.
        if(&IDS::ids_is_running()) {