&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;'>";
&Header::openbigbox('', 'center');
&Header::openbox('100%', 'center', &Header::cleanhtml(`/bin/uname -n`,"y"));
-if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) {
+if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) {
if (open(IPADDR,"${General::swroot}/ddns/ipcache")) {
$ipaddr = <IPADDR>;
close IPADDR;
<!-- 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'>
}
}
$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)$/ ) ) {
+ if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
print <<END;
</select>
<input type='submit' name='ACTION' value='$Lang::tr{'dial profile'}' $dialButtonDisabled />
}
print <<END;
</table>
+
END
+
+require "${General::swroot}/net-traffic/net-traffic-admin.pl";
+
+if($NETTRAFF::settings{'SHOW_AT_HOME'} eq 'on')
+{
+ my %calc = ();
+ $calc{'CALC_VOLUME_TOTAL'} = 0;
+ $calc{'CALC_VOLUME_IN'} = 0;
+ $calc{'CALC_VOLUME_OUT'} = 0;
+ $calc{'CALC_WEEK_TOTAL'} = 0;
+ $calc{'CALC_WEEK_IN'} = 0;
+ $calc{'CALC_WEEK_OUT'} = 0;
+ $calc{'CALC_LAST_RUN'} = 0;
+ $calc{'CALC_PERCENT'} = 0;
+
+ &General::readhash($NETTRAFF::logfile, \%calc);
+
+ my $calctime = &NETTRAFF::getFormatedDate($calc{'CALC_LAST_RUN'});
+
+ print <<END;
+ <hr /><br />
+
+ <table width='80%'>
+ <tr>
+ <td colspan='4' align='center' nowrap='nowrap' >$Lang::tr{'traffic monitor'} ($Lang::tr{'traffic calc time'} $calctime)</td>
+ </tr>
+ <tr>
+ <td align='center' nowrap='nowrap' > </td>
+ <td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficin'}</b></font></td>
+ <td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficout'}</b></font></td>
+ <td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficsum'}</b></font></td>
+ </tr>
+ <tr>
+ <td align='center' nowrap='nowrap' >$Lang::tr{'this weeks volume'} (MB):</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_IN'}</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_OUT'}</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_TOTAL'}</td>
+ </tr>
+ <tr>
+ <td align='center' nowrap='nowrap' >$Lang::tr{'this months volume'} (MB):</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_IN'}</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_OUT'}</td>
+ <td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_TOTAL'}</td>
+ </tr>
+END
+
+ if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
+ {
+print "<tr><td align='center'>max. $NETTRAFF::settings{'MONTHLY_VOLUME'} MB</td><td align='left' colspan='3' nowrap='nowrap'>";
+&NETTRAFF::traffPercentbar("$calc{'CALC_PERCENT'}%");
+print "</td><td align='left' nowrap='nowrap'> $calc{'CALC_PERCENT'}%</td></tr>";
+ }
+ print "</table>";
+}
+
&Header::closebox();
&Header::closebigbox();