]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
dns.cgi: Show ISP name servers as disabled
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 14:49:54 +0000 (14:49 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 14:49:54 +0000 (14:49 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/dns.cgi

index a878f1786b29fc3cdf8de4b63f422231528d48ad..6ec295dea78d846736b0e8558fd4d263834f48e3 100755 (executable)
@@ -421,22 +421,22 @@ print <<END;
 END
 
                # Check the usage of ISP assigned nameservers is enabled.
-               if ($settings{'USE_ISP_NAMESERVERS'} eq "on") {
-                       my $id="1";
-
-                       # Loop through the array which stores the files.
-                       foreach my $file (@ISP_nameserver_files) {
-                               # Grab the address of the nameserver.
-                               my $address = &grab_address_from_file($file);
-
-                               # Check if we got an address.
-                               if ($address) {
-                                       # Add the address to the hash of nameservers.
-                                       $dns_servers{$id} = [ "$address", "none", "enabled", "$Lang::tr{'dns isp assigned nameserver'}" ];
-
-                                       # Increase id by one.
-                                       $id++;
-                               }
+               my $id = 1;
+
+               # Loop through the array which stores the files.
+               foreach my $file (@ISP_nameserver_files) {
+                       # Grab the address of the nameserver.
+                       my $address = &grab_address_from_file($file);
+
+                       # Check if we got an address.
+                       if ($address) {
+                               # Add the address to the hash of nameservers.
+                               $dns_servers{$id} = [ "$address", "none",
+                                       ($settings{'USE_ISP_NAMESERVERS'} eq "on") ? "enabled" : "disabled",
+                                       "$Lang::tr{'dns isp assigned nameserver'}" ];
+
+                               # Increase id by one.
+                               $id++;
                        }
                }
 
@@ -524,6 +524,11 @@ END
 
                                if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; }
 
+                               # Mark ISP name servers as disabled
+                               if ($id <= 2 && $enabled eq "disabled") {
+                                       $nameserver = "<del>$nameserver</del>";
+                               }
+
 print <<END;
                        <tr>
                                <td align="center" $col>