Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make html validate for three files #18

Merged
merged 4 commits into from
Feb 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions html/cgi-bin/aliases.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,16 @@ my %checked =(); # Checkbox manipulations

if ($errormessage) {
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
print "<font class='base'>$errormessage&nbsp;</font>";
print "$errormessage&nbsp;";
&Header::closebox();
}
unless (( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ ) && ($netsettings{'RED_TYPE'} eq 'STATIC'))
{
&Header::openbox('100%', 'left', $Lang::tr{'capswarning'});
print <<END
<table width='100%'>
<table style='width:100%;'>
<tr>
<td width='100%' class='boldbase' align='center'><font color='${Header::colourred}'><b>$Lang::tr{'aliases not active'}</b></font></td>
<td class='boldbase' style='color:${Header::colourred};'><b>$Lang::tr{'aliases not active'}</b></td>
</tr>
</table>
END
Expand All @@ -275,23 +275,22 @@ if ($settings{'KEY1'} ne '') {
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='KEY1' value='$settings{'KEY1'}' />
<table width='100%'>
<table style='width:100%;'>
<tr>
<td class='base'><font color='${Header::colourred}'>$Lang::tr{'name'}:&nbsp;<img src='/blob.gif' alt='*' /></font></td>
<td class='base' style='color:${Header::colourred};'>$Lang::tr{'name'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
<td><input type='text' name='NAME' value='$settings{'NAME'}' size='32' /></td>
<td class='base' align='right'><font color='${Header::colourred}'>$Lang::tr{'alias ip'}:&nbsp;</font></td>
<td class='base' style='text-align:right; color:${Header::colourred};'>$Lang::tr{'alias ip'}:&nbsp;</td>
<td><input type='text' name='IP' value='$settings{'IP'}' size='16' /></td>
<td class='base' align='right'>$Lang::tr{'enabled'}&nbsp;</td>
<td class='base' style='text-align:right;'>$Lang::tr{'enabled'}&nbsp;</td>
<td><input type='checkbox' name='ENABLED' $checked{'ENABLED'}{'on'} /></td>
</tr>
</table>
<br>
<hr />
<table width='100%'>
<table style='width:100%;'>
<tr>
<td class='base' width='55%'><img src='/blob.gif' align='top' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td>
<td width='40%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /><input type='submit' name='SUBMIT' value='$buttontext' /></td>
</td>
<td><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td>
<td style='text-align:right;'><input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /><input type='submit' name='SUBMIT' value='$buttontext' /></td>
</tr>
</table>
</form>
Expand Down Expand Up @@ -320,11 +319,11 @@ if ($netsettings{'SORT_ALIASES'} eq 'NAMERev') {
#
&Header::openbox('100%', 'left', $Lang::tr{'current aliases'});
print <<END
<table width='100%' class='tbl'>
<table class='tbl' style='width:100%;'>
<tr>
<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>
<th style='width:55%; text-align:center;'><a href='$ENV{'SCRIPT_NAME'}?NAME'><b>$Lang::tr{'name'}</b></a> $sortarrow1</th>
<th style='width:45%; text-align:center;'><a href='$ENV{'SCRIPT_NAME'}?IP'><b>$Lang::tr{'alias ip'}</b></a> $sortarrow2</th>
<th colspan='3' class='boldbase' style='width:5%; text-align:center;'><b>$Lang::tr{'action'}</b></th>
</tr>
END
;
Expand Down Expand Up @@ -354,37 +353,35 @@ foreach my $line (@current) {

#Colorize each line
if ($settings{'KEY1'} eq $key) {
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
$col="background-color:${Header::colouryellow};";
} elsif ($key % 2) {
print "<tr>";
$col="bgcolor='${Header::table2colour}'";
$col="background-color:${Header::table2colour};";
} else {
print "<tr>";
$col="bgcolor='${Header::table1colour}'";
$col="background-color:${Header::table1colour};";
}
print "<tr style='$col'>";

print <<END
<td align='center' $col>$temp[2]</td>
<td align='center' $col>$temp[0]</td>
<td style='text-align:center; $col'>$temp[2]</td>
<td style='text-align:center; $col'>$temp[0]</td>

<td align='center' $col>
<td style='text-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' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>

<td align='center' $col>
<td style='text-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'}' />
<input type='hidden' name='KEY1' value='$key' />
</form>
</td>

<td align='center' $col>
<td style='text-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'}' />
Expand Down Expand Up @@ -514,3 +511,4 @@ sub BuildConfiguration {
# Restart service associated with this
system '/usr/local/bin/setaliases';
}

144 changes: 72 additions & 72 deletions html/cgi-bin/connections.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -282,34 +282,34 @@ if (-e "${General::swroot}/ovpn/n2nconf") {

# Print legend.
print <<END;
<table width='100%'>
<table style='width:100%'>
<tr>
<td align='center'>
<b>$Lang::tr{'legend'} : </b>
<td style='text-align:center;'>
<b>$Lang::tr{'legend'} :</b>
</td>
<td align='center' bgcolor='${Header::colourgreen}'>
<b><font color='#FFFFFF'>$Lang::tr{'lan'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourgreen}; font-weight:bold;'>
<b>$Lang::tr{'lan'}</b>
</td>
<td align='center' bgcolor='${Header::colourred}'>
<b><font color='#FFFFFF'>$Lang::tr{'internet'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourred};'>
<b>$Lang::tr{'internet'}</b>
</td>
<td align='center' bgcolor='${Header::colourorange}'>
<b><font color='#FFFFFF'>$Lang::tr{'dmz'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourorange};'>
<b>$Lang::tr{'dmz'}</b>
</td>
<td align='center' bgcolor='${Header::colourblue}'>
<b><font color='#FFFFFF'>$Lang::tr{'wireless'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourblue};'>
<b>$Lang::tr{'wireless'}</b>
</td>
<td align='center' bgcolor='${Header::colourfw}'>
<b><font color='#FFFFFF'>IPFire</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourfw};'>
<b>IPFire</b>
</td>
<td align='center' bgcolor='${Header::colourvpn}'>
<b><font color='#FFFFFF'>$Lang::tr{'vpn'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourvpn};'>
<b>$Lang::tr{'vpn'}</b>
</td>
<td align='center' bgcolor='${Header::colourovpn}'>
<b><font color='#FFFFFF'>$Lang::tr{'OpenVPN'}</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:${Header::colourovpn};'>
<b>$Lang::tr{'OpenVPN'}</b>
</td>
<td align='center' bgcolor='$colour_multicast'>
<b><font color='#FFFFFF'>Multicast</font></b>
<td style='text-align:center; color:#FFFFFF; background-color:$colour_multicast;'>
<b>Multicast</b>
</td>
</tr>
</table>
Expand Down Expand Up @@ -345,60 +345,60 @@ END

# Print table header.
print <<END;
<table width='100%'>
<tr valign="top"">
<th align='center'>
<a href="?sort_field=5&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=5&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<table style='width:100%'>
<tr>
<th style='text-align:center'>
<a href="?sort_field=5&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=5&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
<th align='center' colspan="2">
<a href="?sort_field=1&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=1&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<th style='text-align:center' colspan='2'>
<a href="?sort_field=1&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=1&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="?sort_field=3&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=3&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<a href="?sort_field=3&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=3&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
<th align='center' colspan="2">
<a href="?sort_field=2&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=2&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<th style='text-align:center' colspan='2'>
<a href="?sort_field=2&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=2&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="?sort_field=4&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=4&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<a href="?sort_field=4&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=4&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
<th align='center'>
<a href="?sort_field=8&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=8&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<th style='text-align:center'>
<a href="?sort_field=8&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=8&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="?sort_field=9&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=9&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<a href="?sort_field=9&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=9&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
<th align='center'>
<a href="?sort_field=6&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=6&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<th style='text-align:center'>
<a href="?sort_field=6&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=6&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
<th align='center'>
<a href="?sort_field=7&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
<a href="?sort_field=7&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
<th style='text-align:center'>
<a href="?sort_field=7&amp;sort_order=d"><img style="width:10px" src="/images/up.gif" alt=""></a>
<a href="?sort_field=7&amp;sort_order=a"><img style="width:10px" src="/images/down.gif" alt=""></a>
</th>
</tr>
<tr valign="top"">
<th align='center'>
<tr>
<th style='text-align:center'>
$Lang::tr{'protocol'}
</th>
<th align='center' colspan="2">
<th style='text-align:center' colspan='2'>
$Lang::tr{'source ip and port'}
</th>
<th align='center' colspan="2">
<th style='text-align:center' colspan='2'>
$Lang::tr{'dest ip and port'}
</th>
<th align='center'>
<th style='text-align:center'>
$Lang::tr{'download'} /
<br>$Lang::tr{'upload'}
</th>
<th align='center'>
<th style='text-align:center'>
$Lang::tr{'connection'}<br>$Lang::tr{'status'}
</th>
<th align='center'>
<th style='text-align:center'>
$Lang::tr{'expires'}<br>($Lang::tr{'seconds'})
</th>
</tr>
Expand Down Expand Up @@ -523,17 +523,17 @@ foreach my $line (@conntrack) {

my $sip_extra;
if ($sip ne $sip_ret) {
$sip_extra = "<font color='#FFFFFF'>&gt;</font> ";
$sip_extra = "<span style='color:#FFFFFF;'>&gt;</span> ";
$sip_extra .= "<a href='/cgi-bin/ipinfo.cgi?ip=$sip_ret'>";
$sip_extra .= " <font color='#FFFFFF'>$sip_ret</font>";
$sip_extra .= " <span style='color:#FFFFFF;'>$sip_ret</span>";
$sip_extra .= "</a>";
}

my $dip_extra;
if ($dip ne $dip_ret) {
$dip_extra = "<font color='#FFFFFF'>&gt;</font> ";
$dip_extra = "<span style='color:#FFFFFF;'>&gt;</span> ";
$dip_extra .= "<a href='/cgi-bin/ipinfo.cgi?ip=$dip_ret'>";
$dip_extra .= " <font color='#FFFFFF'>$dip_ret</font>";
$dip_extra .= " <span style='color:#FFFFFF;'>$dip_ret</span>";
$dip_extra .= "</a>";
}

Expand All @@ -545,9 +545,9 @@ foreach my $line (@conntrack) {
$sserv_ret = uc(getservbyport($sport_ret, lc($l4proto)));
}

$sport_extra = "<font color='#FFFFFF'>&gt;</font> ";
$sport_extra = "<span style='color:#FFFFFF;'>&gt;</span> ";
$sport_extra .= "<a href='http://isc.sans.org/port_details.php?port=$sport_ret' target='top' title='$sserv_ret'>";
$sport_extra .= " <font color='#FFFFFF'>$sport_ret</font>";
$sport_extra .= " <span style='color:#FFFFFF;'>$sport_ret</span>";
$sport_extra .= "</a>";
}

Expand All @@ -558,44 +558,44 @@ foreach my $line (@conntrack) {
$dserv_ret = uc(getservbyport($dport_ret, lc($l4proto)));
}

$dport_extra = "<font color='#FFFFFF'>&gt;</font> ";
$dport_extra = "<span style='color:#FFFFFF;'>&gt;</span> ";
$dport_extra .= "<a href='http://isc.sans.org/port_details.php?port=$dport_ret' target='top' title='$dserv_ret'>";
$dport_extra .= " <font color='#FFFFFF'>$dport_ret</font>";
$dport_extra .= " <span style='color:#FFFFFF;'>$dport_ret</span>";
$dport_extra .= "</a>";
}

print <<END;
<tr>
<td align='center'>$l4proto</td>
<td align='center' bgcolor='$sip_colour'>
<td style='text-align:center'>$l4proto</td>
<td style='text-align:center; background-color:$sip_colour;'>
<a href='/cgi-bin/ipinfo.cgi?ip=$sip'>
<font color='#FFFFFF'>$sip</font>
<span style='color:#FFFFFF;'>$sip</span>
</a>
$sip_extra
</td>
<td align='center' bgcolor='$sip_colour'>
<td style='text-align:center; background-color:$sip_colour;'>
<a href='http://isc.sans.org/port_details.php?port=$sport' target='top' title='$sserv'>
<font color='#FFFFFF'>$sport</font>
<span style='color:#FFFFFF;'>$sport</span>
</a>
$sport_extra
</td>
<td align='center' bgcolor='$dip_colour'>
<td style='text-align:center; background-color:$dip_colour;'>
<a href='/cgi-bin/ipinfo.cgi?ip=$dip'>
<font color='#FFFFFF'>$dip</font>
<span style='color:#FFFFFF;'>$dip</span>
</a>
$dip_extra
</td>
<td align='center' bgcolor='$dip_colour'>
<td style='text-align:center; background-color:$dip_colour;'>
<a href='http://isc.sans.org/port_details.php?port=$dport' target='top' title='$dserv'>
<font color='#FFFFFF'>$dport</font>
<span style='color:#FFFFFF;'>$dport</span>
</a>
$dport_extra
</td>
<td align='center'>
<td style='text-align:center'>
$bytes_in / $bytes_out
</td>
<td align='center'>$state</td>
<td align='center'>$ttl</td>
<td style='text-align:center'>$state</td>
<td style='text-align:center'>$ttl</td>
</tr>
END
}
Expand Down
Loading