]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/index.cgi
DNS: Show DNSSEC status on index page if deavtivated
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / index.cgi
index c5ccae809e88bd9dc4a1c204621b4593c38ad449..7c1746259d34bf653f86bd0033d801bfe3d09e09 100644 (file)
@@ -200,26 +200,20 @@ END
 END
        }
 
-       my @dns_servers = ();
-       foreach my $f ("${General::swroot}/red/dns1", "${General::swroot}/red/dns2") {
-               open(DNS, "<$f");
-               my $dns_server = <DNS>;
-               close(DNS);
-
-               chomp($dns_server);
-               if ($dns_server) {
-                       push(@dns_servers, $dns_server);
-               }
+       my $dns_servers;
+       if ( -e "${General::swroot}/red/dns" ) {
+               open (TMP, "<${General::swroot}/red/dns");
+               $dns_servers = <TMP>;
+               chomp($dns_servers);
+               close TMP;
        }
-       my $dns_servers_str = join(", ", @dns_servers);
-
        print <<END;
                <tr>
                        <td>
                                <b>$Lang::tr{'dns servers'}:</b>
                        </td>
                        <td style='text-align:center;'>
-                               $dns_servers_str
+                               $dns_servers
                        </td>
                        <td></td>
                </tr>
@@ -228,8 +222,6 @@ END
 
 #Dial profiles
 if ( $netsettings{'RED_TYPE'} ne "STATIC" && $netsettings{'RED_TYPE'} ne "DHCP" ){
-       # The dialctrl.pl script outputs html
-       print `/usr/local/bin/dialctrl.pl show`;
        if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
                print <<END;
                <br/>
@@ -303,7 +295,7 @@ END
                print '</td>';
                print '</tr>';
        }
-if ( $netsettings{'BLUE_DEV'} ) {
+if (&Header::blue_used()) {
                my $sub=&General::iporsubtocidr($netsettings{'BLUE_NETMASK'});
                print <<END;
                <tr>
@@ -320,7 +312,7 @@ END
                print '</td>';
                print '</tr>';
        }
-if ( $netsettings{'ORANGE_DEV'} ) {
+if (&Header::orange_used()) {
                my $sub=&General::iporsubtocidr($netsettings{'ORANGE_NETMASK'});
                print <<END;
                <tr>
@@ -358,7 +350,7 @@ if (($confighash{'ENABLED'} eq "on") ||
        $ovpnip="$ovpnip/$sub";
 print <<END;
        <tr>
-               <td style='width:25%; text-align:center; background-color:$Header::colourvpn;'>
+               <td style='width:25%; text-align:center; background-color:$Header::colourovpn;'>
                        <a href='/cgi-bin/ovpnmain.cgi' style='color:white'><b>OpenVPN</b></a>
                </td>
                <td style='width:30%; text-align:center;'>$ovpnip</td>
@@ -372,7 +364,7 @@ print"</table>";
 #Check if there are any vpns configured (ipsec and openvpn)
 &General::readhasharray("${General::swroot}/vpn/config", \%vpnconfig);
 foreach my $key (sort { ncmp($vpnconfig{$a}[1],$vpnconfig{$b}[1]) } keys %vpnconfig) {
-       if ($vpnconfig{$key}[0] eq 'on'){
+       if ($vpnconfig{$key}[0] eq 'on' && $vpnconfig{$key}[3] ne 'host'){
                $showipsec=1;
                $showbox=1;
                last;
@@ -409,7 +401,7 @@ if ($showbox){
                </tr>
 END
                foreach my $key (sort { uc($vpnconfig{$a}[1]) cmp uc($vpnconfig{$b}[1]) } keys %vpnconfig) {
-                       if ($vpnconfig{$key}[0] eq 'on') {
+                       if ($vpnconfig{$key}[0] eq 'on' && $vpnconfig{$key}[3] ne 'host') {
                                $count++;
                                my ($vpnip,$vpnsub) = split("/",$vpnconfig{$key}[11]);
                                $vpnsub=&General::iporsubtocidr($vpnsub);
@@ -420,8 +412,8 @@ END
                                        $col = $color{'color20'};
                                }
                                print "<tr>";
-                               print "<td style='text-align:left; color:white; background-color:$Header::colourovpn;'>$vpnconfig{$key}[1]</td>";
-                               print "<td style='text-align:left; background-color:$col'>$vpnip</td>";
+                               print "<td style='text-align:left; color:white; background-color:$Header::colourvpn;'>$vpnconfig{$key}[1]</td>";
+                               print "<td style='text-align:center; background-color:$col'>$vpnip</td>";
 
                                my $activecolor = $Header::colourred;
                                my $activestatus = $Lang::tr{'capsclosed'};
@@ -433,6 +425,9 @@ END
                                                if (($line =~ /\"$vpnconfig{$key}[1]\".*IPsec SA established/) || ($line =~/$vpnconfig{$key}[1]\{.*INSTALLED/ )){
                                                        $activecolor = $Header::colourgreen;
                                                        $activestatus = $Lang::tr{'capsopen'};
+                                               } elsif ($line =~ /$vpnconfig{$key}[1]\{.*ROUTED/) {
+                                                       $activecolor = $Header::colourorange;
+                                                       $activestatus = $Lang::tr{'vpn on-demand'};
                                                }
                                        }
                                }
@@ -505,6 +500,11 @@ END
 &Header::closebox();
 }
 
+my $dnssec_status = &General::dnssec_status();
+if ($dnssec_status eq "off") {
+       $warnmessage .= "<li>$Lang::tr{'dnssec disabled warning'}</li>";
+}
+
 # Fireinfo
 if ( ! -e "/var/ipfire/main/send_profile") {
        $warnmessage .= "<li><a style='color: white;' href='fireinfo.cgi'>$Lang::tr{'fireinfo please enable'}</a></li>";