]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/dns.cgi
dns.cgi: Show error when trying to use ISP nameservers and TLS at the same time.
[ipfire-2.x.git] / html / cgi-bin / dns.cgi
index d35bc4eabba600cccc1938ae2fd697a69b566d39..a16d6971db9ac8d22b49960c67b53497b963d85a 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()
+       }
 }
 
 ###