]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/index.cgi
makegraphs umgebaut, sodass nurnoch rrd daten geschrieben werden die graphen
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / index.cgi
index 6e85043ca4c32ab97be57394025e8cae66946ce6..8904246a87a3d9cd3fef778b257bb9efb6516c9f 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";
@@ -37,6 +37,11 @@ $pppsettings{'PROFILENAME'} = 'None';
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
 &General::readhash("${General::swroot}/ddns/settings", \%ddnssettings);
 
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
 my $connstate = &Header::connectionstatus();
 if ($connstate =~ /$Lang::tr{'dod waiting'}/ || -e "${General::swroot}/main/refreshindex") {
        $refresh = "<meta http-equiv='refresh' content='30;'>";
@@ -74,7 +79,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);
        }
@@ -98,12 +103,15 @@ print <<END;
 
 <!-- Table of networks -->
 <table border='0' width=80%>
-  <tr> <th bgcolor='lightgrey'>$Lang::tr{'network'}
-       <th bgcolor='lightgrey'>IP
-       <th bgcolor='lightgrey'>$Lang::tr{'status'}
+  <tr> <th bgcolor='$color{'color20'}'>$Lang::tr{'network'}
+       <th bgcolor='$color{'color20'}'>IP
+       <th bgcolor='$color{'color20'}'>$Lang::tr{'status'}
   <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'>
@@ -136,6 +144,21 @@ 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);
@@ -267,7 +290,9 @@ if ($warnmessage) {
 }
 print <<END;
 </table>
+
 END
+
 &Header::closebox();
 
 &Header::closebigbox();