]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/index.cgi
Zeitanzeige fuer PPP-Verbindungen...
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / index.cgi
index 921e299e2e5a53a72bbe937607c7f9eee2893d3d..6491c039226183b5a23ee764dcb1f91334c6f172 100644 (file)
@@ -10,8 +10,8 @@
 use strict;
 
 # enable only the following on debugging purpose
-#use warnings;
-#use CGI::Carp 'fatalsToBrowser';
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
@@ -74,7 +74,7 @@ if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || (
            chomp ($ipaddr);
        }
        if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) {
-           my $ipaddr = <IPADDR>;
+           $ipaddr = <IPADDR>;
            close IPADDR;
            chomp ($ipaddr);
        }
@@ -104,6 +104,9 @@ print <<END;
   <tr> <td bgcolor='$Header::colourred' width='25%'><a href="/cgi-bin/pppsetup.cgi"><font size='2' color='white'><b>$Lang::tr{'internet'}:</b></font></a><br>
        <td width='30%'>$ipaddr 
        <td width='45%'>$connstate
+END
+print `/usr/local/bin/dialctrl.pl show`;
+print <<END;
        <tr><td colspan='2'>
                <form method='post' action='/cgi-bin/dial.cgi'>$Lang::tr{'profile'}:
                        <select name='PROFILE'>
@@ -115,7 +118,7 @@ END
                        print "\t<option value='$c' $selected{'PROFILE'}{$c}>$c. $profilenames[$c]</option>\n";
                }
        }
-       $dialButtonDisabled = "disabled='disabled'" if (-e '/var/run/ppp-ipcop.pid' || -e "${General::swroot}/red/active");
+       $dialButtonDisabled = "disabled='disabled'" if (-e '/var/run/ppp-ipfire.pid' || -e "${General::swroot}/red/active");
        if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
                print <<END;
                                </select>
@@ -136,6 +139,38 @@ END
        print "$Lang::tr{'profile has errors'}\n </b></font>\n";
        }
 
+       my $HOSTNAME = (gethostbyaddr(pack("C4", split(/\./, $ipaddr)), 2))[0];
+       if ( "$HOSTNAME" ne "" ) {
+               print <<END;
+       <tr><td><b>Hostname:</b><td>$HOSTNAME<td>&nbsp;
+END
+       }
+
+       if ( -e "/var/ipfire/red/remote-ipaddress" ) {
+               my $GATEWAY = `cat /var/ipfire/red/remote-ipaddress`;
+               chomp($GATEWAY);
+               print <<END;
+       <tr><td><b>Gateway:</b><td>$GATEWAY<td>&nbsp;
+END
+       }
+
+       my $DNS1 = `cat /var/ipfire/red/dns1`;
+       my $DNS2 = `cat /var/ipfire/red/dns2`;
+       chomp($DNS1);
+       chomp($DNS1);
+
+       if ( $DNS1 ) { print <<END;
+       <tr><td><b>DNS-Server:</b><td>$DNS1
+END
+       }
+       if ( $DNS2 ) { print <<END;
+       <td>$DNS2
+END
+       } else { print <<END;
+       <td>&nbsp;
+END
+       }
+
        if ( $netsettings{'GREEN_DEV'} ) { print <<END;
                <tr><td bgcolor='$Header::colourgreen' width='25%'><a href="/cgi-bin/dhcp.cgi"><font size='2' color='white'><b>$Lang::tr{'lan'}:</b></font></a>
                <td width='30%'>$netsettings{'GREEN_ADDRESS'}
@@ -207,15 +242,6 @@ END
                <td width='45%'><font color=$Header::colourgreen>Online</font>
 END
        }
-       if ( $netsettings{'DNS1'} ) { print <<END;
-       <tr><td>DNS-Server: <td>$netsettings{'DNS1'}
-END
-       }
-       if ( $netsettings{'DNS2'} ) { print <<END;
-       <td>$netsettings{'DNS2'}
-END
-       }
-
 
 # Memory usage warning
 my @free = `/usr/bin/free`;
@@ -259,7 +285,9 @@ if ($warnmessage) {
 }
 print <<END;
 </table>
+
 END
+
 &Header::closebox();
 
 &Header::closebigbox();