Merge commit '961f3dbcd8675f8b62ecd2404a709e47ec2ae343' into fifteen

This commit is contained in:
Michael Tremer
2014-01-08 15:01:24 +01:00
23 changed files with 587 additions and 428 deletions

View File

@@ -367,16 +367,16 @@ sub PrintActualLeases
{
&openbox('100%', 'left', $tr{'current dynamic leases'});
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IPADDR'><b>$tr{'ip address'}</b></a></td>
<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ETHER'><b>$tr{'mac address'}</b></a></td>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOSTNAME'><b>$tr{'hostname'}</b></a></td>
<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ENDTIME'><b>$tr{'lease expires'} (local time d/m/y)</b></a></td>
<td width='5%' align='center'><b>Add to fix leases<b></td>
<th width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IPADDR'><b>$tr{'ip address'}</b></a></th>
<th width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ETHER'><b>$tr{'mac address'}</b></a></th>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOSTNAME'><b>$tr{'hostname'}</b></a></th>
<th width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ENDTIME'><b>$tr{'lease expires'} (local time d/m/y)</b></a></th>
<th width='5%' align='center'><b>Add to fix leases<b></th>
</tr>
END
;
;
open(LEASES,"/var/state/dhcp/dhcpd.leases") or die "Can't open dhcpd.leases";
while ($line = <LEASES>) {
@@ -418,24 +418,27 @@ END
close(LEASES);
my $id = 0;
my $col="";
foreach my $key (sort leasesort keys %entries) {
print "<form method='post' action='/cgi-bin/dhcp.cgi'>\n";
my $hostname = &cleanhtml($entries{$key}->{HOSTNAME},"y");
if ($id % 2) {
print "<tr bgcolor='$table1colour'>";
print "<tr>";
$col="bgcolor='$table1colour'";
}
else {
print "<tr bgcolor='$table2colour'>";
print "<tr>";
$col="bgcolor='$table2colour'";
}
print <<END
<td align='center'><input type='hidden' name='FIX_ADDR' value='$entries{$key}->{IPADDR}' />$entries{$key}->{IPADDR}</td>
<td align='center'><input type='hidden' name='FIX_MAC' value='$entries{$key}->{ETHER}' />$entries{$key}->{ETHER}</td>
<td align='center'><input type='hidden' name='FIX_REMARK' value='$hostname' />&nbsp;$hostname</td>
<td align='center'><input type='hidden' name='FIX_ENABLED' value='on' />
<td align='center' $col><input type='hidden' name='FIX_ADDR' value='$entries{$key}->{IPADDR}' />$entries{$key}->{IPADDR}</td>
<td align='center' $col><input type='hidden' name='FIX_MAC' value='$entries{$key}->{ETHER}' />$entries{$key}->{ETHER}</td>
<td align='center' $col><input type='hidden' name='FIX_REMARK' value='$hostname' />&nbsp;$hostname</td>
<td align='center' $col><input type='hidden' name='FIX_ENABLED' value='on' />
END
;
;
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $dst) = localtime ($entries{$key}->{ENDTIME});
$enddate = sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday,$mon+1,$year+1900,$hour,$min,$sec);
@@ -446,10 +449,10 @@ END
print "$enddate";
}
print <<END
<td><input type='hidden' name='ACTION' value='$Lang::tr{'add'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'add'}' />
</td></td></tr></form>
</td><td $col><input type='hidden' name='ACTION' value='$Lang::tr{'add'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'add'}' />
</td></tr></form>
END
;
;
$id++;
}

View File

@@ -320,11 +320,11 @@ if ($netsettings{'SORT_ALIASES'} eq 'NAMERev') {
#
&Header::openbox('100%', 'left', $Lang::tr{'current aliases'});
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='50%' align='center'><a href='$ENV{'SCRIPT_NAME'}?NAME'><b>$Lang::tr{'name'}</b></a> $sortarrow1</td>
<td width='45%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'alias ip'}</b></a> $sortarrow2</td>
<td width='5%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='50%' align='center'><a href='$ENV{'SCRIPT_NAME'}?NAME'><b>$Lang::tr{'name'}</b></a> $sortarrow1</th>
<th width='45%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'alias ip'}</b></a> $sortarrow2</th>
<th width='5%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -336,6 +336,7 @@ END
#
my $key = 0;
my $col="";
foreach my $line (@current) {
chomp($line);
my @temp = split(/\,/,$line);
@@ -353,18 +354,21 @@ foreach my $line (@current) {
#Colorize each line
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
} elsif ($key % 2) {
print "<tr bgcolor='${Header::table2colour}'>";
print "<tr>";
$col="bgcolor='${Header::table2colour}'";
} else {
print "<tr bgcolor='${Header::table1colour}'>";
print "<tr>";
$col="bgcolor='${Header::table1colour}'";
}
print <<END
<td align='center'>$temp[2]</td>
<td align='center'>$temp[0]</td>
<td align='center' $col>$temp[2]</td>
<td align='center' $col>$temp[0]</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
@@ -372,7 +376,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -380,7 +384,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -399,67 +399,67 @@ END
&Header::openbox('100%', 'left', $Lang::tr{'ConnSched scheduled actions'});
print <<END
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
<table width='100%' cellspacing='1' cellpadding='0' class='tbl'>
<tr>
<td align='center' width='10%'><b>$Lang::tr{'time'}</b></td>
<td width='15%'>&nbsp;</td>
<td align='center' width='60%'><b>$Lang::tr{'remark'}</b></td>
<td align='center' colspan='5' width='5%'><b>$Lang::tr{'action'}</b></td>
<th align='center' width='10%'><b>$Lang::tr{'time'}</b></th>
<th width='15%'>&nbsp;</th>
<th align='center' width='60%'><b>$Lang::tr{'remark'}</b></th>
<th align='center' colspan='5' width='5%'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
my $col="";
for my $id ( 0 .. $#CONNSCHED::config )
{
my $trcolor;
if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) )
{
$trcolor = "<tr bgcolor='${Header::colouryellow}'>";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
elsif ( $id % 2 )
{
$trcolor = "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else
{
$trcolor = "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
$trcolor
<td align='center'>$CONNSCHED::config[$id]{'TIME'}</td>
<td>$Lang::tr{"ConnSched $CONNSCHED::config[$id]{'ACTION'}"}&nbsp;$CONNSCHED::config[$id]{'PROFILENR'}</td>
<td>$CONNSCHED::config[$id]{'COMMENT'}</td>
<td align='center'>
<td align='center' $col>$CONNSCHED::config[$id]{'TIME'}</td>
<td $col>$Lang::tr{"ConnSched $CONNSCHED::config[$id]{'ACTION'}"}&nbsp;$CONNSCHED::config[$id]{'PROFILENR'}</td>
<td $col>$CONNSCHED::config[$id]{'COMMENT'}</td>
<td align='center' $col>
<form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='toggle' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$CONNSCHED::config[$id]{'ACTIVE'}.gif' alt='$Lang::tr{'toggle enable disable'}' title='$Lang::tr{'toggle enable disable'}' />
<input type='hidden' name='ID' value='$id' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='edit' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
<input type='hidden' name='ID' value='$id' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='remove' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />
<input type='hidden' name='ID' value='$id' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='up' />
<input type='image' name='$Lang::tr{'ConnSched up'}' src='/images/up.gif' alt='$Lang::tr{'ConnSched up'}' title='$Lang::tr{'ConnSched up'}' />
<input type='hidden' name='ID' value='$id' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frm$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='down' />
<input type='image' name='$Lang::tr{'ConnSched down'}' src='/images/down.gif' alt='$Lang::tr{'ConnSched down'}' title='$Lang::tr{'ConnSched down'}' />
@@ -467,9 +467,9 @@ $trcolor
</form>
</td>
</tr>
$trcolor
<td>&nbsp;</td>
<td colspan='7'>$CONNSCHED::config[$id]{'DAYS'}$CONNSCHED::config[$id]{'WEEKDAYS_PR'}&nbsp;</td>
<tr>
<td $col>&nbsp;</td>
<td colspan='7' $col>$CONNSCHED::config[$id]{'DAYS'}$CONNSCHED::config[$id]{'WEEKDAYS_PR'}&nbsp;</td>
</tr>
END
;

View File

@@ -40,14 +40,14 @@ require "${General::swroot}/header.pl";
&Header::openbigbox('100%', 'LEFT');
&Header::openbox('100%', 'LEFT', 'Flags & Country Codes:');
print "<TABLE WIDTH='100%'>";
print "<tr><td width='5%'><b>Flag</b></td>";
print "<td width='5%'><b>Code</b></td>";
print "<td width='40%'><b>Country</b></td>";
print "<td><b>&nbsp;</b></td>";
print "<td width='5%'><b>Flag</b></td>";
print "<td width='5%'><b>Code</b></td>";
print "<td width='40%'><b>Country</b></td></tr>";
print "<TABLE WIDTH='100%' border='0' class='tbl'>";
print "<tr><th width='5%'><b>Flag</b></th>";
print "<th width='5%'><b>Code</b></th>";
print "<th width='40%'><b>Country</b></th>";
print "<th><b>&nbsp;</b></th>";
print "<th width='5%'><b>Flag</b></th>";
print "<th width='5%'><b>Code</b></th>";
print "<th width='40%'><b>Country</b></th></tr>";
@flaglist = <$flagdir/*>;
@@ -57,35 +57,36 @@ foreach (@flaglist)
{
if (!-d) { push(@flaglistfiles,substr($_,rindex($_,"/")+1)); }
}
my $col="";
foreach $flag (@flaglistfiles)
{
$lines++;
my $flagcode = uc(substr($flag, 0, 2));
my $fcode = lc($flagcode);
my $flagcode = uc(substr($flag, 0, 2));
my $fcode = lc($flagcode);
my $country = Locale::Country::code2country($fcode);
if($fcode eq 'eu') { $country = 'Europe'; }
if($fcode eq 'tp') { $country = 'East Timor'; }
if($fcode eq 'yu') { $country = 'Yugoslavia'; }
if ($lines % 2) {
print "<td><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
print "<td>$flagcode</td>";
print "<td>$country</td></tr>\n";
}
else {
if($fcode eq 'eu') { $country = 'Europe'; }
if($fcode eq 'tp') { $country = 'East Timor'; }
if($fcode eq 'yu') { $country = 'Yugoslavia'; }
if ($lines % 2) {
print "<td $col><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
print "<td $col>$flagcode</td>";
print "<td $col>$country</td></tr>\n";
}
else {
$lines2++;
if($lines2 % 2) {
print "<tr bgcolor='${Header::table1colour}'>";
print "<tr>";
$col="bgcolor='${Header::table2colour}'";
} else {
print "<tr bgcolor='${Header::table2colour}'>";
print "<tr>";
$col="bgcolor='${Header::table1colour}'";
}
print "<td $col><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
print "<td $col>$flagcode</td>";
print "<td $col>$country</td>";
print "<td $col>&nbsp;</td>";
}
print "<td><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
print "<td>$flagcode</td>";
print "<td>$country</td>";
#print "<td><img src='/blob.gif' alt='*' /></td>";
print "<td>&nbsp;</td>";
}
}

View File

@@ -256,7 +256,6 @@ $checked{'SERVICE'}{'selfhost.de'} = '';
$checked{'SERVICE'}{'strato.com'} = '';
$checked{'SERVICE'}{'tzo.com'} = '';
$checked{'SERVICE'}{'zoneedit.com'} = '';
$checked{'SERVICE'}{'udmedia.de'} = '';
$checked{'SERVICE'}{$settings{'SERVICE'}} = "selected='selected'";
$checked{'BEHINDROUTER'}{'RED_IP'} = '';
@@ -352,7 +351,6 @@ print <<END
<option $checked{'SERVICE'}{'selfhost.de'}>selfhost.de</option>
<option $checked{'SERVICE'}{'strato.com'}>strato.com</option>
<!-- <option $checked{'SERVICE'}{'tzo.com'}>tzo.com</option> comment this service out until a working fix is developed -->
<option $checked{'SERVICE'}{'udmedia.de'}>udmedia.de</option>
<option $checked{'SERVICE'}{'zoneedit.com'}>zoneedit.com</option>
</select></td>
<td width='20%' class='base'>$Lang::tr{'hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
@@ -400,14 +398,14 @@ END
#
&Header::openbox('100%', 'left', $Lang::tr{'current hosts'});
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='15%' align='center' class='boldbase'><b>$Lang::tr{'service'}</b></td>
<td width='25%' align='center' class='boldbase'><b>$Lang::tr{'hostname'}</b></td>
<td width='30%' align='center' class='boldbase'><b>$Lang::tr{'domain'}</b></td>
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'proxy'}</b></td>
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'wildcards'}</b></td>
<td width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='15%' align='center' class='boldbase'><b>$Lang::tr{'service'}</b></th>
<th width='25%' align='center' class='boldbase'><b>$Lang::tr{'hostname'}</b></th>
<th width='30%' align='center' class='boldbase'><b>$Lang::tr{'domain'}</b></th>
<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'proxy'}</b></th>
<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'wildcards'}</b></th>
<th width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -430,7 +428,7 @@ foreach my $line (@current) {
$descproxy = $Lang::tr{'click to disable'};
} else {
$gifproxy = 'off.gif';
$descproxy = $Lang::tr{'click to enable'};
$descproxy = $Lang::tr{'click to enable'};
}
my $gifwildcard='';
@@ -454,26 +452,30 @@ foreach my $line (@current) {
$gif = 'off.gif';
$gdesc = $Lang::tr{'click to enable'};
}
my $col="";
#Colorize each line
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
#if a field is empty, replace it with a '---' to see colorized info!
$temp[1] = '---' if (!$temp[1]);
$temp[2] = '---' if (!$temp[2]);
print <<END
<td align='center'><a href='http://$temp[0]'>$temp[0]</a></td>
<td align='center'>$sync$temp[1]</td>
<td align='center'>$sync$temp[2]</td>
<td align='center' $col><a href='http://$temp[0]'>$temp[0]</a></td>
<td align='center' $col>$sync$temp[1]</td>
<td align='center' $col>$sync$temp[2]</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gifproxy' alt='$descproxy' title='$descproxy' />
@@ -482,7 +484,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gifwildcard' alt='$descwildcard' title='$descwildcard' />
@@ -491,7 +493,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
@@ -500,7 +502,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -508,7 +510,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -864,15 +864,15 @@ END
print <<END
<hr />
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FETHER'><b>$Lang::tr{'mac address'}</b></a></td>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FIPADDR'><b>$Lang::tr{'ip address'}</b></a></td>
<td width='15%' align='center'><b>$Lang::tr{'remark'}</b></td>
<td width='15%' class='boldbase' align='center'><b>next-server</b></td>
<td width='15%' class='boldbase' align='center'><b>filename</b></td>
<td width='15%' class='boldbase' align='center'><b>root path</b></td>
<td colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FETHER'><b>$Lang::tr{'mac address'}</b></a></th>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FIPADDR'><b>$Lang::tr{'ip address'}</b></a></th>
<th width='15%' align='center'><b>$Lang::tr{'remark'}</b></th>
<th width='15%' class='boldbase' align='center'><b>next-server</b></th>
<th width='15%' class='boldbase' align='center'><b>filename</b></th>
<th width='15%' class='boldbase' align='center'><b>root path</b></th>
<th colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -904,6 +904,7 @@ foreach my $line (@current2) {
}
$key = 0;
my $col="";
foreach my $line (@current2) {
my $gif = '';
my $gdesc = '';
@@ -919,11 +920,14 @@ foreach my $line (@current2) {
}
if ($dhcpsettings{'KEY2'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
my $TAG0 = '';
my $TAG1 = '';
@@ -943,14 +947,14 @@ foreach my $line (@current2) {
}
print <<END
<td align='center'>$TAG2$temp[0]$TAG3</td>
<td align='center' $TAG4>$TAG0$temp[1]$TAG1</td>
<td align='center'>$temp[6]&nbsp;</td>
<td align='center'>$temp[3]&nbsp;</td>
<td align='center'>$temp[4]&nbsp;</td>
<td align='center'>$temp[5]&nbsp;</td>
<td align='center' $col>$TAG2$temp[0]$TAG3</td>
<td align='center' $col $TAG4>$TAG0$temp[1]$TAG1</td>
<td align='center' $col>$temp[6]&nbsp;</td>
<td align='center' $col>$temp[3]&nbsp;</td>
<td align='center' $col>$temp[4]&nbsp;</td>
<td align='center' $col>$temp[5]&nbsp;</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}2' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
@@ -958,7 +962,7 @@ foreach my $line (@current2) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}2' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -966,7 +970,7 @@ foreach my $line (@current2) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}2' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -252,12 +252,12 @@ print "</form>\n";
#
&Header::openbox('100%', 'left', $Lang::tr{'dnsforward entries'});
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='35%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward zone'}</b></td>
<td width='30%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward forward_server'}</b></td>
<td width='30%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></td>
<td width='5%' class='boldbase' colspan='3' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='35%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward zone'}</b></th>
<th width='30%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward forward_server'}</b></th>
<th width='30%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></th>
<th width='5%' class='boldbase' colspan='3' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -274,6 +274,7 @@ if($cgiparams{'ACTION'} ne '' or $changed ne 'no')
# Re-read entries and highlight selected item for editing.
#
my $id = 0;
my $col="";
foreach my $line (@current)
{
$id++;
@@ -285,11 +286,14 @@ foreach my $line (@current)
my $toggle = '';
if($cgiparams{'ACTION'} eq $Lang::tr{'edit'} && $cgiparams{'ID'} eq $id) {
print "<tr bgcolor='${Header::colouryellow}'>\n"; }
print "<tr>";
$col="bgcolor='${Header::colouryellow}'"; }
elsif ($id % 2) {
print "<tr bgcolor='$color{'color22'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color22'}'"; }
else {
print "<tr bgcolor='$color{'color20'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color20'}'"; }
if ($temp[0] eq 'on') { $gif='on.gif'; $toggle='off'; $gdesc=$Lang::tr{'click to disable'};}
else { $gif='off.gif'; $toggle='on'; $gdesc=$Lang::tr{'click to enable'}; }
@@ -298,10 +302,10 @@ foreach my $line (@current)
# Display edit page.
#
print <<END
<td align='center'>$temp[1]</td>
<td align='center'>$temp[2]</td>
<td align='center'>$temp[3]</td>
<td align='center'>
<td align='center' $col>$temp[1]</td>
<td align='center' $col>$temp[2]</td>
<td align='center' $col>$temp[3]</td>
<td align='center' $col>
<form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' title='$gdesc' alt='$gdesc' />
<input type='hidden' name='ID' value='$id' />
@@ -309,14 +313,14 @@ print <<END
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmb$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' title='$Lang::tr{'edit'}' alt='$Lang::tr{'edit'}' />
<input type='hidden' name='ID' value='$id' />
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmc$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' title='$Lang::tr{'remove'}' alt='$Lang::tr{'remove'}' />
<input type='hidden' name='ID' value='$id' />

View File

@@ -2303,7 +2303,7 @@ sub viewtablenew
&General::readhasharray("$configccdhost", \%ccdhost);
&Header::openbox('100%', 'left', $title);
print "<table width='100%' cellspacing='0' border='0'>";
print "<table width='100%' cellspacing='0' class='tbl'>";
if (! -z $config) {
my $count=0;

View File

@@ -1159,7 +1159,7 @@ sub addnet
$fwhostsettings{'orgname'}=$fwhostsettings{'HOSTNAME'};
$fwhostsettings{'orgnetremark'}=$fwhostsettings{'NETREMARK'};
print<<END;
<table border='0' width='100%'>
<table border='0' width='100%' >
<tr><td width='15%'>$Lang::tr{'name'}:</td><td><form method='post'><input type='TEXT' name='HOSTNAME' id='textbox1' value='$fwhostsettings{'HOSTNAME'}' $fwhostsettings{'BLK_HOST'} size='20'><script>document.getElementById('textbox1').focus()</script></td></tr>
<tr><td>$Lang::tr{'fwhost netaddress'}:</td><td><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} size='20' maxlength='15'></td></tr>
<tr><td>$Lang::tr{'netmask'}:</td><td><input type='TEXT' name='SUBNET' value='$fwhostsettings{'SUBNET'}' $fwhostsettings{'BLK_IP'} size='20' maxlength='15'></td></tr>
@@ -1168,10 +1168,10 @@ sub addnet
END
if ($fwhostsettings{'ACTION'} eq 'editnet' || $fwhostsettings{'error'} eq 'on')
{
print "<td colspan='6' align='right' ><input type='submit' value='$Lang::tr{'update'}' style='min-width:100px;'><input type='hidden' name='ACTION' value='updatenet'><input type='hidden' name='orgnetremark' value='$fwhostsettings{'orgnetremark'}' ><input type='hidden' name='orgname' value='$fwhostsettings{'orgname'}' ><input type='hidden' name='update' value='on'><input type='hidden' name='newnet' value='$fwhostsettings{'newnet'}'></td>";
print "<td colspan='6' align='right'><input type='submit' value='$Lang::tr{'update'}' style='min-width:100px;'><input type='hidden' name='ACTION' value='updatenet'><input type='hidden' name='orgnetremark' value='$fwhostsettings{'orgnetremark'}' ><input type='hidden' name='orgname' value='$fwhostsettings{'orgname'}' ><input type='hidden' name='update' value='on'><input type='hidden' name='newnet' value='$fwhostsettings{'newnet'}'>";
}else{
print "<td colspan='6' align='right'><input type='submit' value='$Lang::tr{'save'}' style='min-width:100px;'/><input type='hidden' name='ACTION' value='savenet'><input type='hidden' name='newnet' value='on'>";
}
print "<td colspan='6' align='right'><input type='submit' value='$Lang::tr{'save'}' style='min-width:100px;'><input type='hidden' name='ACTION' value='savenet'><input type='hidden' name='newnet' value='on'>";
}
print "</form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;' ><input type='hidden' name='ACTION' value='resetnet'></form></td></tr></table>";
&Header::closebox();
}
@@ -1465,26 +1465,30 @@ sub viewtablenet
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table border='0' width='100%' cellspacing='0'>
<tr><td align='center'><b>$Lang::tr{'name'}</b></td><td align='center'><b>$Lang::tr{'fwhost netaddress'}</b></td><td align='center'><b>$Lang::tr{'remark'}</b></td><td align='center'><b>$Lang::tr{'used'}</b></td><td></td><td width='3%'></td></tr>
<table width='100%' cellspacing='0' class='tbl'>
<tr><th align='center'><b>$Lang::tr{'name'}</b></th><th align='center'><b>$Lang::tr{'fwhost netaddress'}</b></th><th align='center'><b>$Lang::tr{'remark'}</b></th><th align='center'><b>$Lang::tr{'used'}</b></th><th></th><th width='3%'></th></tr>
END
}
my $count=0;
my $col='';
foreach my $key (sort {ncmp($a,$b)} keys %customnetwork) {
if ($fwhostsettings{'ACTION'} eq 'editnet' && $fwhostsettings{'HOSTNAME'} eq $customnetwork{$key}[0]) {
print" <tr bgcolor='${Header::colouryellow}'>";
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count % 2)
{
print" <tr bgcolor='$color{'color22'}'>";
$col="bgcolor='$color{'color20'}'";
print" <tr>";# bgcolor='$color{'color20'}'>";
}else
{
print" <tr bgcolor='$color{'color20'}'>";
$col="bgcolor='$color{'color22'}'";
print" <tr>";# bgcolor='$color{'color22'}'>";
}
my $colnet="$customnetwork{$key}[1]/".&General::subtocidr($customnetwork{$key}[2]);
my $netcount=&getnetcount($customnetwork{$key}[0]);
print"<td width='20%'><form method='post'>$customnetwork{$key}[0]</td><td width='15%' align='center'>".&Header::colorize($colnet)."</td><td width='40%'>$customnetwork{$key}[3]</td><td align='center'>$netcount x</td>";
print"<td width='20%' $col><form method='post'>$customnetwork{$key}[0]</td><td width='15%' align='center' $col>".&Header::colorize($colnet)."</td><td width='40%' $col>$customnetwork{$key}[3]</td><td align='center' $col>$netcount x</td>";
print<<END;
<td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
<td width='1%' $col><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
<input type='hidden' name='ACTION' value='editnet'>
<input type='hidden' name='HOSTNAME' value='$customnetwork{$key}[0]' />
<input type='hidden' name='IP' value='$customnetwork{$key}[1]' />
@@ -1494,9 +1498,9 @@ END
END
if($netcount == '0')
{
print"<td width='1%'><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delnet' /><input type='hidden' name='key' value='$customnetwork{$key}[0]' /></td></form></tr>";
print"<td width='1%' $col><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delnet' /><input type='hidden' name='key' value='$customnetwork{$key}[0]' /></td></form></tr>";
}else{
print"<td></td></tr>";
print"<td $col></td></tr>";
}
$count++;
}
@@ -1569,23 +1573,30 @@ sub viewtablehost
print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table border='0' width='100%' cellspacing='0'>
<tr><td align='center'><b>$Lang::tr{'name'}</b></td><td align='center'><b>$Lang::tr{'fwhost ip_mac'}</b></td><td align='center'><b>$Lang::tr{'remark'}</b></td><td align='center'><b>$Lang::tr{'used'}</b></td><td></td><td width='3%'></td></tr>
<table width='100%' cellspacing='0' class='tbl'>
<tr><th align='center'><b>$Lang::tr{'name'}</b></th><th align='center'><b>$Lang::tr{'fwhost ip_mac'}</b></th><th align='center'><b>$Lang::tr{'remark'}</b></th><th align='center'><b>$Lang::tr{'used'}</b></th><th></th><th width='3%'></th></tr>
END
}
my $count=0;
my $col='';
foreach my $key (sort { ncmp ($customhost{$a}[0],$customhost{$b}[0])} keys %customhost) {
if ( ($fwhostsettings{'ACTION'} eq 'edithost' || $fwhostsettings{'error'}) && $fwhostsettings{'HOSTNAME'} eq $customhost{$key}[0]) {
print" <tr bgcolor='${Header::colouryellow}'>";
}elsif ($count % 2){ print" <tr bgcolor='$color{'color22'}'>";}
else{ print" <tr bgcolor='$color{'color20'}'>";}
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count % 2){
print" <tr>";
$col="bgcolor='$color{'color20'}'";
}else{
$col="bgcolor='$color{'color22'}'";
print" <tr>";
}
my ($ip,$sub)=split(/\//,$customhost{$key}[2]);
$customhost{$key}[4]=~s/\s+//g;
my $hostcount=0;
$hostcount=&gethostcount($customhost{$key}[0]);
print"<td width='20%'>$customhost{$key}[0]</td><td width='20%' align='center' ".&getcolor($ip).">".&Header::colorize($ip)."</td><td width='50%' align='left'>$customhost{$key}[3]</td><td align='center'>$hostcount x</td>";
print"<td width='20%' $col>$customhost{$key}[0]</td><td width='20%' align='center' $col ".&getcolor($ip).">".&Header::colorize($ip)."</td><td width='50%' align='left' $col>$customhost{$key}[3]</td><td align='center' $col>$hostcount x</td>";
print<<END;
<td width='1%'><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
<td width='1%' $col><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
<input type='hidden' name='ACTION' value='edithost' />
<input type='hidden' name='HOSTNAME' value='$customhost{$key}[0]' />
<input type='hidden' name='IP' value='$ip' />
@@ -1595,9 +1606,9 @@ END
END
if($hostcount == '0')
{
print"<td width='1%'><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delhost' /><input type='hidden' name='key' value='$customhost{$key}[0]' /></td></form></tr>";
print"<td width='1%' $col><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delhost' /><input type='hidden' name='key' value='$customhost{$key}[0]' /></td></form></tr>";
}else{
print"<td width='1%'></td></tr>";
print"<td width='1%' $col></td></tr>";
}
$count++;
}
@@ -1656,30 +1667,36 @@ sub viewtablegrp
print"<form method='post' style='display:inline'><input type='image' src='/images/delete.gif' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} align='right' /><input type='hidden' name='grp_name' value='$grpname' ><input type='hidden' name='ACTION' value='delgrp'></form>";
}
print"<form method='post' style='display:inline'><input type='image' src='/images/edit.gif' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} align='right' /><input type='hidden' name='grp_name' value='$grpname' ><input type='hidden' name='remark' value='$remark' ><input type='hidden' name='ACTION' value='editgrp'></form>";
print"<table width='100%' style='border: 1px solid #CCCCCC;' rules='none' cellspacing='0'><tr><td align='center'><b>Name</b></td><td align='center'><b>$Lang::tr{'ip address'}</b></td><td align='center' width='25%'><b>$Lang::tr{'fwhost type'}</td><td></td></tr>";
print"<table width='100%' cellspacing='0' class='tbl'><tr><th align='center'><b>Name</b></th><th align='center'><b>$Lang::tr{'ip address'}</b></th><th align='center' width='25%'><b>$Lang::tr{'fwhost type'}</th><th></th></tr>";
}
my $col='';
if ( ($fwhostsettings{'ACTION'} eq 'editgrp' || $fwhostsettings{'update'} ne '') && $fwhostsettings{'grp_name'} eq $customgrp{$key}[0]) {
print" <tr bgcolor='${Header::colouryellow}'>";
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count %2 == 0){
print"<tr bgcolor='$color{'color22'}'>";
print"<tr>";
$col="bgcolor='$color{'color22'}'";
}else{
print"<tr bgcolor='$color{'color20'}'>";
print"<tr>";
$col="bgcolor='$color{'color20'}'";
}
my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]);
if ($ip eq ''){print"<tr bgcolor='${Header::colouryellow}'>";}
print "<td width='39%' align='left'>";
if ($ip eq ''){
print"<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
print "<td width='39%' align='left' $col>";
if($customgrp{$key}[3] eq 'Standard Network'){
print &get_name($customgrp{$key}[2])."</td>";
}else{
print "$customgrp{$key}[2]</td>";
}
if ($ip eq '' && $customgrp{$key}[2] ne $Lang::tr{'fwhost err emptytable'}){
print "<td align='center'>$Lang::tr{'fwhost deleted'}</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
print "<td align='center' $col>$Lang::tr{'fwhost deleted'}</td><td align='center' $col>$customgrp{$key}[3]</td><td width='1%' $col><form method='post'>";
}else{
my ($colip,$colsub) = split("/",$ip);
$ip="$colip/".&General::subtocidr($colsub) if ($colsub);
print"<td align='center' ".&getcolor($colip).">".&Header::colorize($ip)."</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
print"<td align='center' $col ".&getcolor($colip).">".&Header::colorize($ip)."</td><td align='center' $col>$customgrp{$key}[3]</td><td width='1%' $col><form method='post'>";
}
if ($delflag > 1 && $ip ne ''){
print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
@@ -1708,25 +1725,33 @@ sub viewtableservice
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);
print<<END;
<table width='100%' border='0' cellspacing='0'>
<tr><td align='center'><b>$Lang::tr{'fwhost srv_name'}</b></td><td align='center'><b>$Lang::tr{'fwhost prot'}</b></td><td align='center'><b>$Lang::tr{'fwhost port'}</b></td><td align='center'><b>ICMP</b></td><td align='center'><b>$Lang::tr{'fwhost used'}</b></td><td></td><td width='3%'></td></tr>
<table width='100%' cellspacing='0' class='tbl'>
<tr><th align='center'><b>$Lang::tr{'fwhost srv_name'}</b></th><th align='center'><b>$Lang::tr{'fwhost prot'}</b></th><th align='center'><b>$Lang::tr{'fwhost port'}</b></th><th align='center'><b>ICMP</b></th><th align='center'><b>$Lang::tr{'fwhost used'}</b></th><th></th><th width='3%'></th></tr>
END
my $col='';
foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0])} keys %customservice)
{
$count++;
if ( ($fwhostsettings{'updatesrv'} eq 'on' || $fwhostsettings{'error'}) && $fwhostsettings{'SRV_NAME'} eq $customservice{$key}[0]) {
print" <tr bgcolor='${Header::colouryellow}'>";
}elsif ($count % 2){ print" <tr bgcolor='$color{'color22'}'>";}else{ print" <tr bgcolor='$color{'color20'}'>";}
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count % 2){
print" <tr>";
$col="bgcolor='$color{'color22'}'";
}else{
print" <tr>";
$col="bgcolor='$color{'color20'}'";
}
print<<END;
<td>$customservice{$key}[0]</td><td align='center'>$customservice{$key}[2]</td><td align='center'>$customservice{$key}[1]</td><td align='center'>
<td $col>$customservice{$key}[0]</td><td align='center' $col>$customservice{$key}[2]</td><td align='center' $col>$customservice{$key}[1]</td><td align='center' $col>
END
#Neuer count
$srvcount=&getsrvcount($customservice{$key}[0]);
if($customservice{$key}[3] eq 'All ICMP-Types'){print $Lang::tr{'fwdfw all icmp'};}
elsif($customservice{$key}[3] ne 'BLANK'){print $customservice{$key}[3];}
print<<END;
</td><td align='center'>$srvcount x</td>
<td width='1%'><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} /><input type='hidden' name='ACTION' value='editservice' />
</td><td align='center' $col>$srvcount x</td>
<td width='1%' $col><form method='post'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} /><input type='hidden' name='ACTION' value='editservice' />
<input type='hidden' name='SRV_NAME' value='$customservice{$key}[0]' />
<input type='hidden' name='SRV_PORT' value='$customservice{$key}[1]' />
<input type='hidden' name='PROT' value='$customservice{$key}[2]' />
@@ -1734,9 +1759,9 @@ END
END
if ($srvcount eq '0')
{
print"<td width='1%'><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delservice' /><input type='hidden' name='SRV_NAME' value='$customservice{$key}[0]'></td></tr></form>";
print"<td width='1%' $col><form method='post'><input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} /><input type='hidden' name='ACTION' value='delservice' /><input type='hidden' name='SRV_NAME' value='$customservice{$key}[0]'></td></tr></form>";
}else{
print"<td></td></tr>";
print"<td $col></td></tr>";
}
}
print"</table>";
@@ -1753,6 +1778,7 @@ sub viewtableservicegrp
my $protocol;
my $delflag;
my $grpcount=0;
my $col='';
if (! -z $configsrvgrp){
&Header::openbox('100%', 'left', $Lang::tr{'fwhost cust srvgrp'});
&General::readhasharray("$configsrvgrp", \%customservicegrp);
@@ -1792,14 +1818,17 @@ sub viewtableservicegrp
print"<form method='post' style='display:inline'><input type='image' src='/images/delete.gif' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} align='right' /><input type='hidden' name='SRVGRP_NAME' value='$grpname' ><input type='hidden' name='ACTION' value='delservicegrp'></form>";
}
print"<form method='post' style='display:inline'><input type='image' src='/images/edit.gif' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} align='right' /><input type='hidden' name='SRVGRP_NAME' value='$grpname' ><input type='hidden' name='SRVGRP_REMARK' value='$remark' ><input type='hidden' name='ACTION' value='editservicegrp'></form>";
print"<table width='100%' style='border: 1px solid #CCCCCC;' rules='none' cellspacing='0'><tr><td align='center'><b>Name</b></td><td align='center'><b>$Lang::tr{'port'}</b></td><td align='center' width='25%'><b>$Lang::tr{'fwhost prot'}</td><td></td></tr>";
print"<table width='100%' cellspacing='0' class='tbl'><tr><th align='center'><b>Name</b></th><th align='center'><b>$Lang::tr{'port'}</b></th><th align='center' width='25%'><b>$Lang::tr{'fwhost prot'}</th><th></th></tr>";
}
if( $fwhostsettings{'SRVGRP_NAME'} eq $customservicegrp{$key}[0]) {
print" <tr bgcolor='${Header::colouryellow}'>";
print"<tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count %2 == 0){
print"<tr bgcolor='$color{'color22'}'>";
print"<tr>";
$col="bgcolor='$color{'color20'}'";
}else{
print"<tr bgcolor='$color{'color20'}'>";
print"<tr>";
$col="bgcolor='$color{'color22'}'";
}
#Set fields if we use protocols in servicegroups
if ($customservicegrp{$key}[2] ne 'TCP' || $customservicegrp{$key}[2] ne 'UDP' || $customservicegrp{$key}[2] ne 'ICMP'){
@@ -1811,7 +1840,7 @@ sub viewtableservicegrp
if ($customservicegrp{$key}[2] eq 'IGMP'){$protocol='IGMP';$customservicegrp{$key}[2]="$Lang::tr{'protocol'} IGMP";}
if ($customservicegrp{$key}[2] eq 'IPIP'){$protocol='IPIP';$customservicegrp{$key}[2]="$Lang::tr{'protocol'} IPIP";}
if ($customservicegrp{$key}[2] eq 'IPV6'){$protocol='IPV6';$customservicegrp{$key}[2]="$Lang::tr{'protocol'} IPv6 encapsulation";}
print "<td width='39%'>$customservicegrp{$key}[2]</td>";
print "<td width='39%' $col>$customservicegrp{$key}[2]</td>";
foreach my $srv (sort keys %customservice){
if ($customservicegrp{$key}[2] eq $customservice{$srv}[0]){
$protocol=$customservice{$srv}[2];
@@ -1819,7 +1848,7 @@ sub viewtableservicegrp
last;
}
}
print"<td align='center'>$port</td><td align='center'>$protocol</td><td width='1%'><form method='post'>";
print"<td align='center' $col>$port</td><td align='center' $col>$protocol</td><td width='1%' $col><form method='post'>";
if ($delflag gt '1'){
print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
}

View File

@@ -283,12 +283,12 @@ END
#
&Header::openbox('100%', 'left', $Lang::tr{'current hosts'});
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'host ip'}</b></a></td>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOST'><b>$Lang::tr{'hostname'}</b></a></td>
<td width='50%' align='center'><a href='$ENV{'SCRIPT_NAME'}?DOM'><b>$Lang::tr{'domain name'}</b></a></td>
<td width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'host ip'}</b></a></th>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOST'><b>$Lang::tr{'hostname'}</b></a></th>
<th width='50%' align='center'><a href='$ENV{'SCRIPT_NAME'}?DOM'><b>$Lang::tr{'domain name'}</b></a></th>
<th width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -296,7 +296,7 @@ END
#
# Print each line of @current list
#
my $col="";
my $key = 0;
foreach my $line (@current) {
chomp($line); # remove newline
@@ -318,15 +318,17 @@ foreach my $line (@current) {
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center'>$temp[1]</td>
<td align='center'>$temp[2]</td>
<td align='center'>$temp[3]</td>
<td align='center'>
<td align='center' $col>$temp[1]</td>
<td align='center' $col>$temp[2]</td>
<td align='center' $col>$temp[3]</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
@@ -334,7 +336,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -342,7 +344,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -308,16 +308,16 @@ if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td align='center' class='boldbase'><b>$Lang::tr{'time'}</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'chain'}</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'iface'}</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'proto'}</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'source'}<br/>$Lang::tr{'destination'}</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'src port'}<br />$Lang::tr{'dst port'}</b></td>
<td align='center' class='boldbase'><b>Flag</b></td>
<td align='center' class='boldbase'><b>$Lang::tr{'mac address'}</b></td>
<th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'chain'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'iface'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'proto'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'source'}<br/>$Lang::tr{'destination'}</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'src port'}<br />$Lang::tr{'dst port'}</b></th>
<th align='center' class='boldbase'><b>Flag</b></th>
<th align='center' class='boldbase'><b>$Lang::tr{'mac address'}</b></th>
</tr>
END
;
@@ -353,26 +353,29 @@ foreach $_ (@log)
$dstport = "$dstport($servi)";}
my @mactemp = split(/:/,$macaddr);
$macaddr = "$mactemp[6]:$mactemp[7]:$mactemp[8]:$mactemp[9]:$mactemp[10]:$mactemp[11]";
my $col="";
if ($lines % 2) {
print "<tr bgcolor='$color{'color20'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color20'}'"; }
else {
print "<tr bgcolor='$color{'color22'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color22'}'"; }
print <<END
<td align='center'>$time</td>
<td align='center'>$comment</td>
<td align='center'>$iface</td>
<td align='center'>$proto</td>
<td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a><br /><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
<td align='center'>$srcport<br/>$dstport</td>
<td align='center' $col>$time</td>
<td align='center' $col>$comment</td>
<td align='center' $col>$iface</td>
<td align='center' $col>$proto</td>
<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a><br /><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
<td align='center' $col>$srcport<br/>$dstport</td>
END
;
if ( $fcode ne "" ){
print "<td align='center'><a href='../country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>";}
print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>";}
else {
print "<td align='center'></td>";}
print "<td align='center' $col></td>";}
print <<END
<td align='center'>$macaddr</td>
<td align='center' $col>$macaddr</td>
</tr>
END
;

View File

@@ -403,13 +403,13 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
}
print <<END
<TABLE WIDTH='100%'>
<TABLE WIDTH='100%' class='tbl'>
<TR>
<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'></TD>
<TD WIDTH='30%' ALIGN='CENTER' CLASS='boldbase'><B>IP</B></TD>
<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Flag</B></TD>
<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Count</B></TD>
<TD WIDTH='30%' ALIGN='CENTER' CLASS='boldbase'><B>Percent</B></TD>
<TH WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'></TH>
<TH WIDTH='30%' ALIGN='CENTER' CLASS='boldbase'><B>IP</B></TH>
<TH WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Flag</B></TH>
<TH WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Count</B></TH>
<TH WIDTH='30%' ALIGN='CENTER' CLASS='boldbase'><B>Percent</B></TH>
</TR>
END
;
@@ -419,6 +419,7 @@ my $show=0;
my $s;
my $percent;
my $col="";
for($s=0;$s<$lines;$s++)
{
@@ -426,45 +427,45 @@ for($s=0;$s<$lines;$s++)
$percent = $value[$s] * 100 / $linesjc;
$percent = sprintf("%.f", $percent);
$total = $total + $value[$s];
if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
if ( ($color % 10) == 1 ){print "<TR>"; $col="BGCOLOR='$color{'color1'}'";}
if ( ($color % 10) == 2 ){print "<TR>"; $col="BGCOLOR='$color{'color2'}'";}
if ( ($color % 10) == 3 ){print "<TR>"; $col="BGCOLOR='$color{'color3'}'";}
if ( ($color % 10) == 4 ){print "<TR>"; $col="BGCOLOR='$color{'color4'}'";}
if ( ($color % 10) == 5 ){print "<TR>"; $col="BGCOLOR='$color{'color5'}'";}
if ( ($color % 10) == 6 ){print "<TR>"; $col="BGCOLOR='$color{'color6'}'";}
if ( ($color % 10) == 7 ){print "<TR>"; $col="BGCOLOR='$color{'color7'}'";}
if ( ($color % 10) == 8 ){print "<TR>"; $col="BGCOLOR='$color{'color8'}'";}
if ( ($color % 10) == 9 ){print "<TR>"; $col="BGCOLOR='$color{'color9'}'";}
if ( ($color % 10) == 0 ){print "<TR>"; $col="BGCOLOR='$color{'color10'}'";}
my $gi = Geo::IP::PurePerl->new();
my $ccode = $gi->country_code_by_name($key[$s]);
my $fcode = lc($ccode);
$color++;
print "<TD ALIGN='CENTER'><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
print "<TD ALIGN='CENTER'><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></TD>";
print "<TD ALIGN='CENTER' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
print "<TD ALIGN='CENTER' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></TD>";
if ( $fcode ne "" ){
print "<TD ALIGN='CENTER'><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></TD>";}
print "<TD ALIGN='CENTER' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></TD>";}
else {
print "<TD ALIGN='CENTER'></TD>";}
print "<TD ALIGN='CENTER'>$value[$s]</TD>";
print "<TD ALIGN='CENTER'>$percent</TD>";
print "<TD ALIGN='CENTER' $col></TD>";}
print "<TD ALIGN='CENTER' $col>$value[$s]</TD>";
print "<TD ALIGN='CENTER' $col>$percent</TD>";
print "</TR>";
}
if($cgiparams{'otherspie'} == 2 ){}
else{
if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
if ( ($color % 10) == 1 ){print "<TR>"; $col="BGCOLOR='$color{'color1'}'";}
if ( ($color % 10) == 2 ){print "<TR>"; $col="BGCOLOR='$color{'color2'}'";}
if ( ($color % 10) == 3 ){print "<TR>"; $col="BGCOLOR='$color{'color3'}'";}
if ( ($color % 10) == 4 ){print "<TR>"; $col="BGCOLOR='$color{'color4'}'";}
if ( ($color % 10) == 5 ){print "<TR>"; $col="BGCOLOR='$color{'color5'}'";}
if ( ($color % 10) == 6 ){print "<TR>"; $col="BGCOLOR='$color{'color6'}'";}
if ( ($color % 10) == 7 ){print "<TR>"; $col="BGCOLOR='$color{'color7'}'";}
if ( ($color % 10) == 8 ){print "<TR>"; $col="BGCOLOR='$color{'color8'}'";}
if ( ($color % 10) == 9 ){print "<TR>"; $col="BGCOLOR='$color{'color9'}'";}
if ( ($color % 10) == 0 ){print "<TR>"; $col="BGCOLOR='$color{'color10'}'";}
if ( $linesjc ne "0")
{
@@ -473,11 +474,11 @@ $dif = $linesjc - $total;
$percent = $dif * 100 / $linesjc;
$percent = sprintf("%.f", $percent);
print <<END
<TD ALIGN='CENTER'></TD>
<TD ALIGN='CENTER'>$Lang::tr{'otherip'}</TD>
<TD ALIGN='CENTER'></TD>
<TD ALIGN='CENTER'>$dif</TD>
<TD ALIGN='CENTER'>$percent</TD>
<TD ALIGN='CENTER' $col></TD>
<TD ALIGN='CENTER' $col>$Lang::tr{'otherip'}</TD>
<TD ALIGN='CENTER' $col></TD>
<TD ALIGN='CENTER' $col>$dif</TD>
<TD ALIGN='CENTER' $col>$percent</TD>
</TR>
END
;

View File

@@ -406,12 +406,12 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
}
print <<END
<TABLE WIDTH='100%'>
<TABLE WIDTH='100%' CLASS='tbl'>
<TR>
<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'></TD>
<TD WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Port</B></TD>
<TD WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Count</B></TD>
<TD WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Percent</B></TD>
<TH WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'></TH>
<TH WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Port</B></TH>
<TH WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Count</B></TH>
<TH WIDTH='33%' ALIGN='CENTER' CLASS='boldbase'><B>Percent</B></TH>
</TR>
END
;
@@ -421,43 +421,45 @@ my $show=0;
my $s;
my $percent;
my $col="";
for($s=0;$s<$lines;$s++)
{
$show++;
$percent = $value[$s] * 100 / $linesjc;
$percent = sprintf("%.f", $percent);
$total = $total + $value[$s];
if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
if ( ($color % 10) == 1 ){print "<TR>"; $col="BGCOLOR='$color{'color1'}'";}
if ( ($color % 10) == 2 ){print "<TR>"; $col="BGCOLOR='$color{'color2'}'";}
if ( ($color % 10) == 3 ){print "<TR>"; $col="BGCOLOR='$color{'color3'}'";}
if ( ($color % 10) == 4 ){print "<TR>"; $col="BGCOLOR='$color{'color4'}'";}
if ( ($color % 10) == 5 ){print "<TR>"; $col="BGCOLOR='$color{'color5'}'";}
if ( ($color % 10) == 6 ){print "<TR>"; $col="BGCOLOR='$color{'color6'}'";}
if ( ($color % 10) == 7 ){print "<TR>"; $col="BGCOLOR='$color{'color7'}'";}
if ( ($color % 10) == 8 ){print "<TR>"; $col="BGCOLOR='$color{'color8'}'";}
if ( ($color % 10) == 9 ){print "<TR>"; $col="BGCOLOR='$color{'color9'}'";}
if ( ($color % 10) == 0 ){print "<TR>"; $col="BGCOLOR='$color{'color10'}'";}
$color++;
print "<TD ALIGN='CENTER'><form method='post' action='showrequestfromport.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='port' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
print "<TD ALIGN='CENTER'>$key[$s]</TD>";
print "<TD ALIGN='CENTER'>$value[$s]</TD>";
print "<TD ALIGN='CENTER'>$percent</TD>";
print "<TD ALIGN='CENTER' $col><form method='post' action='showrequestfromport.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='port' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
print "<TD ALIGN='CENTER' $col>$key[$s]</TD>";
print "<TD ALIGN='CENTER' $col>$value[$s]</TD>";
print "<TD ALIGN='CENTER' $col>$percent</TD>";
print "</TR>";
}
if($cgiparams{'otherspie'} == 2 ){}
else{
if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
if ( ($color % 10) == 1 ){print "<TR>"; $col="BGCOLOR='$color{'color1'}'";}
if ( ($color % 10) == 2 ){print "<TR>"; $col="BGCOLOR='$color{'color2'}'";}
if ( ($color % 10) == 3 ){print "<TR>"; $col="BGCOLOR='$color{'color3'}'";}
if ( ($color % 10) == 4 ){print "<TR>"; $col="BGCOLOR='$color{'color4'}'";}
if ( ($color % 10) == 5 ){print "<TR>"; $col="BGCOLOR='$color{'color5'}'";}
if ( ($color % 10) == 6 ){print "<TR>"; $col="BGCOLOR='$color{'color6'}'";}
if ( ($color % 10) == 7 ){print "<TR>"; $col="BGCOLOR='$color{'color7'}'";}
if ( ($color % 10) == 8 ){print "<TR>"; $col="BGCOLOR='$color{'color8'}'";}
if ( ($color % 10) == 9 ){print "<TR>"; $col="BGCOLOR='$color{'color9'}'";}
if ( ($color % 10) == 0 ){print "<TR>"; $col="BGCOLOR='$color{'color10'}'";}
if ( $linesjc ne "0")
{
@@ -466,10 +468,10 @@ $dif = $linesjc - $total;
$percent = $dif * 100 / $linesjc;
$percent = sprintf("%.f", $percent);
print <<END
<TD ALIGN='CENTER'></TD>
<TD ALIGN='CENTER'>$Lang::tr{'otherport'}</TD>
<TD ALIGN='CENTER'>$dif</TD>
<TD ALIGN='CENTER'>$percent</TD>
<TD ALIGN='CENTER' $col></TD>
<TD ALIGN='CENTER' $col>$Lang::tr{'otherport'}</TD>
<TD ALIGN='CENTER' $col>$dif</TD>
<TD ALIGN='CENTER' $col>$percent</TD>
</TR>
END
;

View File

@@ -354,11 +354,11 @@ if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></td>
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'section'}</b></td>
<td width='80%'>&nbsp;</td>
<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'section'}</b></th>
<th width='80%'>&nbsp;</th>
</tr>
END
;
@@ -383,13 +383,15 @@ foreach $_ (@log)
$data = substr ($data,80); #permit correct display in table cell
$d .= ' ' . substr ($data,0,80);
}
my $col="";
if ($lines % 2) {
print "<tr bgcolor='$color{'color20'}'>"; }
print "<tr>";
$col="bgcolor='$color{'color20'}'"; }
else {
print "<tr bgcolor='$color{'color22'}'>"; }
print "<td>$time<td>$sec<td>" .&Header::cleanhtml ("$d", 'y') . "</td></tr>\n";
print "<tr>";
$col="bgcolor='$color{'color22'}'"; }
print "<td $col>$time<td $col>$sec<td $col>" .&Header::cleanhtml ("$d", 'y') . "</td></tr>\n";
$lines++;
}
#print '</tt>';

View File

@@ -437,22 +437,25 @@ if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
print "<p><b>$Lang::tr{'web hits'} $daystr: $lines</b></p>";
if ($lines != 0) { &oldernewer(); }
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></td>
<td width='15%' align='center' class='boldbase'><b>$Lang::tr{'source ip'}</b></td>
<td width='12%' align='center' class='boldbase'><b>$Lang::tr{'advproxy NCSA username'}</b></td>
<td width='63%' align='center' class='boldbase'><b>$Lang::tr{'website'}</b></td>
<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
<th width='15%' align='center' class='boldbase'><b>$Lang::tr{'source ip'}</b></th>
<th width='12%' align='center' class='boldbase'><b>$Lang::tr{'advproxy NCSA username'}</b></th>
<th width='63%' align='center' class='boldbase'><b>$Lang::tr{'website'}</b></th>
</tr>
END
;
my $ll = 0;
my $col='';
foreach $_ (@log)
{
if ($ll % 2) {
print "<tr bgcolor='$color{'color20'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color20'}'"; }
else {
print "<tr bgcolor='$color{'color20'}'>\n"; }
print "<tr>";
$col="bgcolor='$color{'color22'}'"; }
my ($datetime,$ip,$so,$url) = split;
my ($SECdt, $MINdt, $HOURdt, $DAYdt, $MONTHdt, $YEARdt) = localtime($datetime);
$SECdt = sprintf ("%.02d",$SECdt);
@@ -470,10 +473,10 @@ foreach $_ (@log)
$DAYdt='';
}
print <<END
<td align='center'>$DAYdt$HOURdt:$MINdt:$SECdt</td>
<td align='center'>$ip</td>
<td align='center'>$so</td>
<td align='left'><a href='$url' title='$url' target='_new'>$part</a></td>
<td align='center' $col>$DAYdt$HOURdt:$MINdt:$SECdt</td>
<td align='center' $col>$ip</td>
<td align='center' $col>$so</td>
<td align='left' $col><a href='$url' title='$url' target='_new'>$part</a></td>
</tr>
END
;

View File

@@ -309,18 +309,19 @@ if ($lines)
$lines = 0;
print "<table width='100%'>\n";
print "<table width='100%' class='tbl'>";
unless ($cgiparams{'LOGTYPE'} eq 'squidGuard')
{
print "<tr>\n";
print "<td align='center'><b>$Lang::tr{'urlfilter time'}</b></td>\n";
print "<td align='center'><b>$Lang::tr{'urlfilter category'}</b></td>\n";
print "<td align='center'><b>$Lang::tr{'urlfilter client'}</b></td>\n";
if ($filtersettings{'ENABLE_USERNAME_LOG'} eq 'on') { print "<td align='center'><b>$Lang::tr{'urlfilter username'}</b></td>\n"; }
print "<td align='center'><b>$Lang::tr{'urlfilter dst'}</b></td>\n";
print "<th align='center'><b>$Lang::tr{'urlfilter time'}</b></th>\n";
print "<th align='center'><b>$Lang::tr{'urlfilter category'}</b></th>\n";
print "<th align='center'><b>$Lang::tr{'urlfilter client'}</b></th>\n";
if ($filtersettings{'ENABLE_USERNAME_LOG'} eq 'on') { print "<th align='center'><b>$Lang::tr{'urlfilter username'}</b></th>\n"; }
print "<th align='center'><b>$Lang::tr{'urlfilter dst'}</b></th>\n";
print "</tr>\n";
}
my $col="";
foreach (@slice)
{
undef $attr1; undef $attr2;
@@ -336,17 +337,23 @@ if ($lines)
if (@loginfo[2] =~ /emergency/) { $attr1 .= "<b><font color='$Header::colourerr'>"; $attr2 .= "</font></b>"; }
print "<tr>\n";
} else {
if ($lines % 2) { print "<tr bgcolor='$color{'color20'}'>\n"; } else { print "<tr bgcolor='$color{'color22'}'>\n"; }
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}else {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
}
if ($cgiparams{'LOGTYPE'} eq 'squidGuard') {
print "<td nowrap>$time &nbsp; $pid &nbsp; $attr1@loginfo$attr2</td>\n";
print "<td nowrap $col>$time &nbsp; $pid &nbsp; $attr1@loginfo$attr2</td>\n";
} else {
print "<td width='10%' align='center' nowrap>$time</td>\n";
print "<td width='11%' align='center' nowrap>$category[1]</td>\n";
print "<td width='15%' align='center' nowrap>$ip[0]</td>\n";
print "<td width='10%' align='center' nowrap $col>$time</td>\n";
print "<td width='11%' align='center' nowrap $col>$category[1]</td>\n";
print "<td width='15%' align='center' nowrap $col>$ip[0]</td>\n";
if ($filtersettings{'ENABLE_USERNAME_LOG'} eq 'on')
{
print "<td width='12%' align='center' nowrap>$loginfo[3]</td>\n";
print "<td width='12%' align='center' nowrap $col>$loginfo[3]</td>\n";
$site = substr($dsturl,0,55);
if (length($dsturl) > 55) { $site .= "..."; }
} else {
@@ -354,7 +361,7 @@ if ($lines)
if (length($dsturl) > 69) { $site .= "..."; }
}
#print "<td>$site</td>\n";
print "<td><a href='$dsturl' title='$dsturl' target='_blank'>$site</a></td>\n";
print "<td $col><a href='$dsturl' title='$dsturl' target='_blank'>$site</a></td>\n";
}
print "</tr>\n";
}

View File

@@ -86,17 +86,18 @@ close FILE;
&Header::openbox('100%', 'center', $Lang::tr{'p2p block'});
print <<END;
<table width='35%' border='0'>
<tr bgcolor='$color{'color22'}'>
<td align=center colspan='2' >
<table width='35%' class='tbl'>
<tr>
<th align=center colspan='2'bgcolor='$color{'color22'}' >
<b>$Lang::tr{'protocol'}</b>
</td>
<td align='center'>
</th>
<th align='center'bgcolor='$color{'color22'}' >
<b>$Lang::tr{'status'}</b>
</td>
</th>
</tr>
END
my $lines=0;
my $col="";
foreach my $p2pentry (sort @p2ps) {
my @p2pline = split( /\;/, $p2pentry);
if ($p2pline[2] eq 'on') {
@@ -104,13 +105,17 @@ foreach my $p2pentry (sort @p2ps) {
} else {
$gif = "/images/off.gif"
}
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'"; }
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'"; }
print <<END;
<tr bgcolor='$color{'color20'}'>
<td align='center' colspan='2'>
<td align='center' colspan='2' $col>
$p2pline[0]:
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='P2PROT' value='$p2pline[1]'>
<input type='image' img src='$gif' alt='$Lang::tr{'click to disable'}' title='$Lang::tr{'fwdfw toggle'}' style='padding-top: 0px; padding-left: 0px; padding-bottom: 0px ;padding-right: 0px ;display: block;'>
@@ -119,9 +124,11 @@ foreach my $p2pentry (sort @p2ps) {
</td>
</tr>
END
$lines++;
}
print <<END;
</table><table>
<tr>
<td>
<img src='/images/on.gif'>

View File

@@ -257,13 +257,13 @@ END
&Header::openbox('100%', 'left', $Lang::tr{'routing table'});
print <<END
<hr />
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'host ip'} / $Lang::tr{'network'}</b></a></td>
<td width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?GATEWAY'><b>$Lang::tr{'gateway'}</b></a></td>
<td width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?REMARK'><b>$Lang::tr{'remark'}</b></a></td>
<td width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>
<th width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'host ip'} / $Lang::tr{'network'}</b></a></th>
<th width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?GATEWAY'><b>$Lang::tr{'gateway'}</b></a></th>
<th width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?REMARK'><b>$Lang::tr{'remark'}</b></a></th>
<th width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -273,6 +273,7 @@ END
#
my $key = 0;
my $col="";
foreach my $line (@current) {
chomp($line); # remove newline
my @temp=split(/\,/,$line);
@@ -294,15 +295,17 @@ foreach my $line (@current) {
if ($settings{'KEY1'} eq $key) {
print "<tr bgcolor='${Header::colouryellow}'>";
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center'>$temp[1]</td>
<td align='center'>$temp[2]</td>
<td align='center'>$temp[3]</td>
<td align='center'>
<td align='center' $col>$temp[1]</td>
<td align='center' $col>$temp[2]</td>
<td align='center' $col>$temp[3]</td>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
@@ -310,7 +313,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -318,7 +321,7 @@ foreach my $line (@current) {
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -886,27 +886,33 @@ my %shares = config("${General::swroot}/samba/shares");
print <<END
<a name="$Lang::tr{'manage shares'}"></a>
<br />
<table width='95%' cellspacing='0'>
<tr><td bgcolor='$color{'color20'}' colspan='3' align='left'><b>$Lang::tr{'manage shares'}</b>
<tr><td align='left'><u>$Lang::tr{'sharename'}</u></td><td colspan='2' width="5%" align='center'><u>$Lang::tr{'options'}</u></td></tr>
<table width='95%' cellspacing='0' class='tbl'>
<tr><th bgcolor='$color{'color20'}' colspan='3' align='left'><b>$Lang::tr{'manage shares'}</b></th></tr>
<tr><th align='left'><u>$Lang::tr{'sharename'}</u></th><th colspan='2' width="5%" align='center'><u>$Lang::tr{'options'}</u></th></tr>
END
;
my @Shares = keys(%shares);
my $lines = 0;
my $col="";
foreach my $shareentry (sort @Shares)
{
chomp $shareentry;
if ($lines % 2) {print "<tr bgcolor='$color{'color20'}'>";} else {print "<tr bgcolor='$color{'color22'}'>";}
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
} else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='left'>$shareentry</td>
<td><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
<td align='left' $col>$shareentry</td>
<td $col><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
<input type='hidden' name='NAME' value='$shareentry' />
<input type='hidden' name='ACTION' value='sharechange' />
<input type='image' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' src='/images/edit.gif' />
</form></td>
<td><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
<td $col><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
<input type='hidden' name='NAME' value='$shareentry' />
<input type='hidden' name='ACTION' value='smbsharedel' />
<input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' />

View File

@@ -116,25 +116,33 @@ if ( $querry[0] =~ "processescpu"){
&Header::openbox('100%', 'left', $Lang::tr{'services'});
print <<END
<div align='center'>
<table width='80%' cellspacing='1' border='0'>
<tr bgcolor='$color{'color20'}'><td align='left'><b>$Lang::tr{'services'}</b></td><td align='center' ><b>$Lang::tr{'status'}</b></td><td align='center'><b>PID</b></td><td align='center'><b>$Lang::tr{'memory'}</b></td></tr>
<table width='80%' cellspacing='1' class='tbl'>
<tr bgcolor='$color{'color20'}'>
<th align='left'><b>$Lang::tr{'services'}</b></th>
<th align='center' ><b>$Lang::tr{'status'}</b></th>
<th align='center'><b>PID</b></th>
<th align='center'><b>$Lang::tr{'memory'}</b></th>
</tr>
END
;
my $key = '';
my $col="";
foreach $key (sort keys %servicenames){
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>\n<td align='left'>";
$col="bgcolor='$color{'color22'}'";
print "<tr><td align='left' $col>";
print $link{$key};
print "</td>\n";
print "</td>";
}else{
print "<tr bgcolor='$color{'color20'}'>\n<td align='left'>";
$col="bgcolor='$color{'color20'}'";
print "<tr><td align='left' $col>";
print $link{$key};
print "</td>\n";
print "</td>";
}
my $shortname = $servicenames{$key};
my $status = &isrunning($shortname);
my $status = &isrunning($shortname,$col);
print "$status\n";
print "</tr>\n";
@@ -152,14 +160,14 @@ END
print <<END
<div align='center'>
<table width='80%' cellspacing='1' border='0'>
<table width='80%' cellspacing='1' class='tbl'>
<tr bgcolor='$color{'color20'}'>
<td align='center'><b>Addon</b></td>
<td align='center'><b>Boot</b></td>
<td align='center' colspan=2><b>$Lang::tr{'action'}</b></td>
<td align='center'><b>$Lang::tr{'status'}</b></td>
<td align='center'><b>PID</b></td>
<td align='center'><b>$Lang::tr{'memory'}</b></td>
<th align='center'><b>Addon</b></th>
<th align='center'><b>Boot</b></th>
<th align='center' colspan=2><b>$Lang::tr{'action'}</b></th>
<th align='center'><b>$Lang::tr{'status'}</b></th>
<th align='center'><b>PID</b></th>
<th align='center'><b>$Lang::tr{'memory'}</b></th>
</tr>
END
;
@@ -183,16 +191,18 @@ END
if ( ($_ ne "alsa") && ($_ ne "mdadm") ) {
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}else{
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
print "<td align='left'>$_</td> ";
my $status = isautorun($_);
print "<td align='left' $col>$_</td> ";
my $status = isautorun($_,$col);
print "$status ";
print "<td align='center'><A HREF=services.cgi?$_!start><img alt='$Lang::tr{'start'}' title='$Lang::tr{'start'}' src='/images/go-up.png' border='0' /></A></td>";
print "<td align='center'><A HREF=services.cgi?$_!stop><img alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/go-down.png' border='0' /></A></td> ";
my $status = &isrunningaddon($_);
print "<td align='center' $col><A HREF=services.cgi?$_!start><img alt='$Lang::tr{'start'}' title='$Lang::tr{'start'}' src='/images/go-up.png' border='0' /></A></td>";
print "<td align='center' $col><A HREF=services.cgi?$_!stop><img alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/go-down.png' border='0' /></A></td> ";
my $status = &isrunningaddon($_,$col);
$status =~ s/\\[[0-1]\;[0-9]+m//g;
chomp($status);
@@ -219,16 +229,17 @@ END
sub isautorun{
my $cmd = $_[0];
my $status = "<td align='center'></td>";
my $col = $_[1];
my $status = "<td align='center' $col></td>";
my $init = `find /etc/rc.d/rc3.d/S??${cmd} 2>/dev/null`;
chomp ($init);
if ($init ne ''){
$status = "<td align='center'><A HREF=services.cgi?$_!disable><img alt='$Lang::tr{'deactivate'}' title='$Lang::tr{'deactivate'}' src='/images/on.gif' border='0' width='16' height='16' /></A></td>";
$status = "<td align='center' $col><A HREF=services.cgi?$_!disable><img alt='$Lang::tr{'deactivate'}' title='$Lang::tr{'deactivate'}' src='/images/on.gif' border='0' width='16' height='16' /></A></td>";
}
$init = `find /etc/rc.d/rc3.d/off/S??${cmd} 2>/dev/null`;
chomp ($init);
if ($init ne ''){
$status = "<td align='center'><A HREF=services.cgi?$_!enable><img alt='$Lang::tr{'activate'}' title='$Lang::tr{'activate'}' src='/images/off.gif' border='0' width='16' height='16' /></A></td>";
$status = "<td align='center' $col><A HREF=services.cgi?$_!enable><img alt='$Lang::tr{'activate'}' title='$Lang::tr{'activate'}' src='/images/off.gif' border='0' width='16' height='16' /></A></td>";
}
return $status;
@@ -236,7 +247,8 @@ sub isautorun{
sub isrunning{
my $cmd = $_[0];
my $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2'></td>";
my $col = $_[1];
my $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2' $col></td>";
my $pid = '';
my $testcmd = '';
my $exename;
@@ -267,7 +279,7 @@ sub isrunning{
close(FILE);
}
if ($testcmd =~ /$exename/){
$status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td><td align='center'>$pid</td><td align='center'>$memory</td>";
$status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td><td align='center' $col>$pid</td><td align='center' $col>$memory</td>";
}
}
return $status;
@@ -275,7 +287,8 @@ sub isrunning{
sub isrunningaddon{
my $cmd = $_[0];
my $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2'></td>";
my $col = $_[1];
my $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2' $col></td>";
my $pid = '';
my $testcmd = '';
my $exename;
@@ -293,7 +306,7 @@ sub isrunningaddon{
$testcmd =~ s///gi;
my @pid = split(/\s/,$testcmd);
$status .="<td align='center'>$pid[0]</td>";
$status .="<td align='center' $col>$pid[0]</td>";
my $memory = 0;
@@ -305,9 +318,9 @@ sub isrunningaddon{
}
$memory+=$memory[0];
}
$status .="<td align='center'>$memory KB</td>";
$status .="<td align='center' $col>$memory KB</td>";
}else{
$status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2'></td>";
$status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2' $col></td>";
}
return $status;
}

View File

@@ -292,16 +292,17 @@ print "</form>\n";
&Header::openbox('100%', 'left', "$Lang::tr{'current devices'}");
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td align='center' width='20%'><b>$Lang::tr{'mac address'}</b></td>
<td align='center' width='10%'><b>$Lang::tr{'interface'}</b></td>
<td align='center' width='60%'><b>$Lang::tr{'remark'}</b></td>
<td align='center' colspan='2'><b>$Lang::tr{'action'}</b></td>
<th align='center' width='20%'><b>$Lang::tr{'mac address'}</b></th>
<th align='center' width='10%'><b>$Lang::tr{'interface'}</b></th>
<th align='center' width='60%'><b>$Lang::tr{'remark'}</b></th>
<th align='center' colspan='2'><b>$Lang::tr{'action'}</b></th>
<th></th>
</tr>
END
;
my $col="";
for $i ( 0 .. $#wol_devices )
{
my $wol_mac = $wol_devices[$i]{'MAC'};
@@ -310,22 +311,25 @@ for $i ( 0 .. $#wol_devices )
if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) )
{
print "<tr bgcolor='${Header::colouryellow}'>";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
elsif ( $i % 2)
{
print "<tr bgcolor='$color{'color22'}'>";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
else
else
{
print "<tr bgcolor='$color{'color20'}'>";
print "<tr>";
$col="bgcolor='$color{'color22'}'";
}
print <<END
<td align='center'>$wol_mac</td>
<td align='center'>$Lang::tr{"$wol_iface"}</td>
<td align='left'>$wol_txt</td>
<td align='center'>
<td align='center' $col>$wol_mac</td>
<td align='center' $col>$Lang::tr{"$wol_iface"}</td>
<td align='left' $col>$wol_txt</td>
<td align='center' $col>
END
;
if ( (($wol_iface eq 'blue') && ! &haveBlueNet())
@@ -347,14 +351,14 @@ END
}
print <<END
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmb$i' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='edit' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
<input type='hidden' name='ID' value='$i' />
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmc$i' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='remove' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />

View File

@@ -260,13 +260,13 @@ my @current = <FILE>;
close (FILE);
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td align='center' width='20%'><b>$Lang::tr{'hostname'}</b></td>
<td align='center' width='20%'><b>$Lang::tr{'source ip'}</b></td>
<td align='center' width='20%'><b>$Lang::tr{'mac address'}</b></td>
<td align='center' width='35%'><b>$Lang::tr{'remark'}</b></td>
<td align='center' colspan='3'><b>$Lang::tr{'action'}</b></td>
<th align='center' width='20%'><b>$Lang::tr{'hostname'}</b></th>
<th align='center' width='20%'><b>$Lang::tr{'source ip'}</b></th>
<th align='center' width='20%'><b>$Lang::tr{'mac address'}</b></t>
<th align='center' width='35%'><b>$Lang::tr{'remark'}</b></th>
<th align='center' colspan='3'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
@@ -333,20 +333,24 @@ foreach my $line (@current)
else { $gif = 'off.gif'; $toggle='on'; $gdesc=$Lang::tr{'click to enable'};}
my $remark = &Header::cleanhtml($temp[4]);
my $col="";
if ($cgiparams{'ACTION'} eq 'edit' && $cgiparams{'ID'} eq $id) {
print "<tr bgcolor='${Header::colouryellow}'>\n";
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
} elsif ($id % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr>";
$col="bgcolor='${Header::table1colour}'";
} else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr>";
$col="bgcolor='${Header::table2colour}'";
}
print "<td align='center'>$hname</td>\n";
print "<td align='center'>$sourceip</td>\n";
print "<td align='center'>$sourcemac</td>\n";
print "<td align='center'>$remark</td>\n";
print "<td align='center' $col>$hname</td>\n";
print "<td align='center' $col>$sourceip</td>\n";
print "<td align='center' $col>$sourcemac</td>\n";
print "<td align='center' $col>$remark</td>\n";
print<<END
<td align='center'>
<td align='center' $col>
<form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />
<input type='hidden' name='ACTION' value='toggle'}' />
@@ -355,7 +359,7 @@ print<<END
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmb$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='edit' />
<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
@@ -363,7 +367,7 @@ print<<END
</form>
</td>
<td align='center'>
<td align='center' $col>
<form method='post' name='frmc$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='remove' />
<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />
@@ -405,12 +409,13 @@ sub printblueleases
&Header::openbox('100%', 'left', "$Lang::tr{'current dhcp leases on blue'}");
print <<END
<table width='100%'>
<table width='100%' class='tbl'>
<tr>
<td width='25%' align='center'><b>$Lang::tr{'ip address'}</b></td>
<td width='25%' align='center'><b>$Lang::tr{'mac address'}</b></td>
<td width='20%' align='center'><b>$Lang::tr{'hostname'}</b></td>
<td width='30%' align='center'><b>$Lang::tr{'lease expires'} (local time d/m/y)</b></td>
<th width='25%' align='center'><b>$Lang::tr{'ip address'}</b></th>
<th width='25%' align='center'><b>$Lang::tr{'mac address'}</b></th>
<th width='20%' align='center'><b>$Lang::tr{'hostname'}</b></th>
<th width='30%' align='center'><b>$Lang::tr{'lease expires'} (local time d/m/y)</b></th>
<th></th>
</tr>
END
;
@@ -459,18 +464,21 @@ END
foreach my $key (sort blueleasesort keys %entries) {
my $hostname = &Header::cleanhtml($entries{$key}->{HOSTNAME},"y");
my $col="";
if ($id % 2) {
print "<tr bgcolor='$Header::table2colour'>";
print "<tr>";
$col="bgcolor='$Header::table2colour'";
} else {
print "<tr bgcolor='$Header::table1colour'>";
print "<tr>";
$col="bgcolor='$Header::table1colour'";
}
print <<END
<td align='center'>$entries{$key}->{IPADDR}</td>
<td align='center'>$entries{$key}->{ETHER}</td>
<td align='center'>&nbsp;$hostname </td>
<td align='center'>
<td align='center' $col>$entries{$key}->{IPADDR}</td>
<td align='center' $col>$entries{$key}->{ETHER}</td>
<td align='center' $col>&nbsp;$hostname </td>
<td align='center' $col>
END
;
@@ -493,7 +501,7 @@ END
}
print <<END
<td align='center'>
<td align='center' $col>
<form method='post' name='frmd$id' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='add' />
<input type='hidden' name='SOURCE_IP' value='' />

View File

@@ -16,6 +16,56 @@ html {
height: 100%;
}
/* This decorates all tables with class="table" */
table {
*border-collapse: collapse; /* IE7 and lower */
border-spacing: 0;
}
.tbl th{
color: #000000;
font-size: 14px;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
background: #cccccc;
}
.tbl th:first-child{
border-left: 1px solid grey;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
}
.tbl th:last-child {
border-right: 1px solid grey;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
}
.tbl th:only-child{
border: 1px solid grey;
}
.tbl tr td:first-child{
border-left: 1px solid grey;
}
.tbl tr td:last-child{
border-right: 1px solid grey;
}
.tbl tr:first-child td:only-child{
border-top: 1px solid grey;
}
.tbl tr:last-child td:only-child{
border-bottom: 1px solid grey;
}
.tbl tr:last-child td:first-child{
border-bottom: 1px solid grey;
}
.tbl tr:last-child td:last-child{
border-bottom: 1px solid grey;
}
.tbl tr:last-child td{
border-bottom: 1px solid grey;
}
body {
/* SVG as background image (IE9/Chrome/Safari/Opera) */
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2ODQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMTAwJSIgeTE9IjEwMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDAwMDAwIiBvZmZzZXQ9IjAiLz48c3RvcCBzdG9wLWNvbG9yPSIjODgwNDAwIiBvZmZzZXQ9IjU3JSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c2ODQpIiAvPgo8L3N2Zz4=);
@@ -58,6 +108,7 @@ body {
font-family: "trebuchet ms", helvetica, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-size: 20px;
font-weight: normal;