require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
-require "${General::swroot}/forward/bin/firewall-lib.pl";
+require "${General::swroot}/firewall/bin/firewall-lib.pl";
-unless (-d "${General::swroot}/forward") { system("mkdir ${General::swroot}/forward"); }
-unless (-e "${General::swroot}/forward/settings") { system("touch ${General::swroot}/forward/settings"); }
-unless (-e "${General::swroot}/forward/config") { system("touch ${General::swroot}/forward/config"); }
-unless (-e "${General::swroot}/forward/input") { system("touch ${General::swroot}/forward/input"); }
-unless (-e "${General::swroot}/forward/outgoing") { system("touch ${General::swroot}/forward/outgoing"); }
+unless (-d "${General::swroot}/firewall") { system("mkdir ${General::swroot}/firewall"); }
+unless (-e "${General::swroot}/firewall/settings") { system("touch ${General::swroot}/firewall/settings"); }
+unless (-e "${General::swroot}/firewall/config") { system("touch ${General::swroot}/firewall/config"); }
+unless (-e "${General::swroot}/firewall/input") { system("touch ${General::swroot}/firewall/input"); }
+unless (-e "${General::swroot}/firewall/outgoing") { system("touch ${General::swroot}/firewall/outgoing"); }
my %fwdfwsettings=();
my %selected=() ;
my $configccdhost = "${General::swroot}/ovpn/ovpnconfig";
my $configipsec = "${General::swroot}/vpn/config";
my $configipsecrw = "${General::swroot}/vpn/settings";
-my $configfwdfw = "${General::swroot}/forward/config";
-my $configinput = "${General::swroot}/forward/input";
-my $configoutgoing = "${General::swroot}/forward/outgoing";
+my $configfwdfw = "${General::swroot}/firewall/config";
+my $configinput = "${General::swroot}/firewall/input";
+my $configoutgoing = "${General::swroot}/firewall/outgoing";
my $configovpn = "${General::swroot}/ovpn/settings";
my $fwoptions = "${General::swroot}/optionsfw/settings";
my $ifacesettings = "${General::swroot}/ethernet/settings";
my $tdcolor='';
my $checkorange='';
my @protocols;
-&General::readhash("${General::swroot}/forward/settings", \%fwdfwsettings);
+&General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
&General::readhash($fwoptions, \%optionsfw);
{
&error;
- &Header::openbox('100%', 'left', $Lang::tr{'fwdfw menu'});
+ &Header::openbox('100%', 'left', "");
print <<END;
<form method="POST" action="">
<table border='0' width="100%">
<tr>
- <td>
+ <td align='center'>
<input type='submit' name='ACTION' value='$Lang::tr{'fwdfw newrule'}'>
- </td>
- <td align="right">
END
if (&General::firewall_needs_reload()) {
</table>
</form>
- <hr>
+ <br>
END
+
&Header::closebox();
&viewtablerule;
}
}elsif ($val eq 'IPFire' ){
$tdcolor="style='background-color: $Header::colourred;color:white;'";
return;
+ }elsif ($val eq 'OpenVPN-Dyn' ){
+ $tdcolor="style='background-color: $Header::colourovpn;color:white;'";
+ return;
+ }elsif ($val eq 'IPsec RW' ){
+ $tdcolor="style='background-color: $Header::colourvpn;color:white;'";
+ return;
}elsif($val =~ /^(.*?)\/(.*?)$/){
my ($sip,$scidr) = split ("/",$val);
if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){
&gen_dd_block('src','grp1');
print"<hr>";
&Header::closebox();
+
#---SNAT / DNAT ------------------------------------------------
&Header::openbox('100%', 'left', 'NAT');
print<<END;
<div class="NAT">
<table width='100%' border='0'>
<tr>
- <td colspan='2'></td>
- <td width='1%'>
- <input type='radio' name='nat' id='dnat' value='dnat' checked>
+ <td width='5%'></td>
+ <td width='40%'>
+ <label>
+ <input type='radio' name='nat' id='dnat' value='dnat' checked>
+ $Lang::tr{'fwdfw dnat'}
+ </label>
+ </td>
+END
+
+ if (%aliases) {
+ print <<END;
+ <td width='25%' align='right'>$Lang::tr{'dnat address'}:</td>
+ <td width='30%'>
+ <select name='dnat' style='width: 100%;'>
+ <option value='Default IP' $selected{'dnat'}{'Default IP'}>$Lang::tr{'default ip'} ($netsettings{'RED_ADDRESS'})</option>
+END
+ foreach my $alias (sort keys %aliases) {
+ print "<option value='$alias' $selected{'dnat'}{$alias}>$alias ($aliases{$alias}{'IPT'})</option>";
+ }
+
+ print "</select>";
+ } else {
+ print <<END;
+ <td colspan="2" width='55%'>
+ <input type='hidden' name='dnat' value='Default IP'>
</td>
- <td width='50%'>$Lang::tr{'fwdfw dnat'}</td>
END
- print"<td width='8%'>Firewall: </td><td width='20%' align='right'><select name='dnat' style='width:140px;'>";
- print "<option value='ALL' $selected{'dnat'}{$Lang::tr{'all'}}>$Lang::tr{'all'}</option>";
- print "<option value='Default IP' $selected{'dnat'}{'Default IP'}>Default IP</option>";
- foreach my $alias (sort keys %aliases)
- {
- print "<option value='$alias' $selected{'dnat'}{$alias}>$alias</option>";
}
- print"</select></td></tr>";
+ print "</tr>";
+
#SNAT
- print"<tr><td colspan='2'></td><td width='1%'><input type='radio' name='nat' id='snat' value='snat' $checked{'nat'}{'snat'}></td><td width='20%'>$Lang::tr{'fwdfw snat'}</td>";
- print"<td width='8%'>Firewall: </td><td width='20%' align='right'><select name='snat' style='width:140px;'>";
- foreach my $alias (sort keys %aliases)
- {
- print "<option value='$alias' $selected{'snat'}{$alias}>$alias</option>";
- }
- foreach my $network (sort keys %defaultNetworks)
- {
+ print <<END;
+ <tr>
+ <td width='5%'></td>
+ <td width='40%'>
+ <label>
+ <input type='radio' name='nat' id='snat' value='snat' $checked{'nat'}{'snat'}>
+ $Lang::tr{'fwdfw snat'}
+ </label>
+ </td>
+ <td width='25%' align='right'>$Lang::tr{'snat new source ip address'}:</td>
+ <td width='30%'>
+ <select name='snat' style='width: 100%;'>
+END
+
+ foreach my $alias (sort keys %aliases) {
+ print "<option value='$alias' $selected{'snat'}{$alias}>$alias ($aliases{$alias}{'IPT'})</option>";
+ }
+
+ # XXX this is composed in a very ugly fashion
+ foreach my $network (sort keys %defaultNetworks) {
next if($defaultNetworks{$network}{'NAME'} eq "IPFire");
next if($defaultNetworks{$network}{'NAME'} eq "ALL");
next if($defaultNetworks{$network}{'NAME'} =~ /OpenVPN/i);
+ next if($defaultNetworks{$network}{'NAME'} =~ /IPsec/i);
+
print "<option value='$defaultNetworks{$network}{'NAME'}'";
print " selected='selected'" if ($fwdfwsettings{$fwdfwsettings{'nat'}} eq $defaultNetworks{$network}{'NAME'});
- print ">$network</option>";
+ print ">$network ($defaultNetworks{$network}{'NET'})</option>";
}
- print"</select></td></tr></table>";
- print"</div>";
+
+ print <<END;
+ </select>
+ </td>
+ </tr>
+ </table>
+ </div>
+END
&Header::closebox();
+
#---TARGET------------------------------------------------------
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
print<<END;
print"<hr>";
&Header::closebox;
#---PROTOCOL------------------------------------------------------
+ $fwdfwsettings{'SRC_PORT'} =~ s/\|/,/g;
+ $fwdfwsettings{'TGT_PORT'} =~ s/\|/,/g;
+ $fwdfwsettings{'dnatport'} =~ tr/|/,/;
+
+ # The dnatport may be empty, if it matches TGT_PORT
+ if ($fwdfwsettings{'dnatport'} eq $fwdfwsettings{'TGT_PORT'}) {
+ $fwdfwsettings{'dnatport'} = "";
+ }
+
&Header::openbox('100%', 'left', $Lang::tr{'fwhost prot'});
#Fix Protocol for JQuery
if ($fwdfwsettings{'grp3'} eq 'cust_srv' || $fwdfwsettings{'grp3'} eq 'cust_srvgrp'){
$fwdfwsettings{'PROT'} = 'template';
}
print<<END;
- <div id="prt">
- <table width='15%' border='0' style="float:left;">
+ <table width='100%' border='0'>
<tr>
- <td>
- <select name='PROT' id='protocol'>
+ <td width="25%">
+ <select name='PROT' id='protocol' style="width: 95px;">
END
print "<option value=\"\"";
if ($fwdfwsettings{'PROT'} eq '') {
if ($_ eq $fwdfwsettings{'PROT'}) {
print " selected=\"selected\"";
}
- print ">$_</option>";
+ if($_ eq "IPv6"){
+ print ">$Lang::tr{'fwdfw prot41'}</option>";
+ }else{
+ print ">$_</option>";
+ }
}
+
print<<END;
</select>
</td>
- </tr>
- </table>
- </div>
-
- <div id="PROTOCOL_ICMP_TYPES">
- <table width='50%' border='0' style="float:left;">
- <tr>
- <td width='20%'>$Lang::tr{'fwhost icmptype'}</td>
- <td colspan='2'>
- <select name='ICMP_TYPES' style='min-width:230px;'>
+ <td width="75%">
+ <table width='100%' border='0' id="PROTOCOL_ICMP_TYPES">
+ <tr>
+ <td width='20%'>$Lang::tr{'fwhost icmptype'}</td>
+ <td colspan='2'>
+ <select name='ICMP_TYPES' style='min-width:230px;'>
END
&General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes);
print"<option value='All ICMP-Types'>$Lang::tr{'fwdfw all icmp'}</option>";
}
print <<END;
- </select>
- </td>
- </tr>
- </table>
- </div>
+ </select>
+ </td>
+ </tr>
+ </table>
+
+ <table width="100%" border="0" id="PROTOCOL_PORTS">
+ <tr>
+ <!-- #SOURCEPORT -->
+ <td>
+ $Lang::tr{'fwdfw use srcport'}
+ </td>
+ <td>
+ <input type='text' name='SRC_PORT' value='$fwdfwsettings{'SRC_PORT'}' maxlength='20' size='18'>
+ </td>
+ <td width='10%'>
+ </td>
+
+ <!-- #TARGETPORT -->
+ <td>
+ $Lang::tr{'fwdfw use srv'}
+ </td>
+
+ <td>
+ <input type='text' name='TGT_PORT' value='$fwdfwsettings{'TGT_PORT'}' maxlength='20' size='18'>
+ </td>
+ </tr>
+ <tr class="NAT">
+ <td colspan='3'></td>
+ <td>$Lang::tr{'fwdfw external port nat'}:</td>
+ <td>
+ <input type='text' name='dnatport' value=\"$fwdfwsettings{'dnatport'}\" maxlength='20' size='18'>
+ </td>
+ </tr>
+ </table>
+
+ <table width="100%" border="0" id="PROTOCOL_TEMPLATE">
+ <tr>
+ <td>
+ <input type='radio' name='grp3' id='cust_srv' value='cust_srv' checked>
+ $Lang::tr{'fwhost cust service'}
+ </td>
+ <td>
+ <select name='cust_srv' style='min-width: 230px;'>
END
- $fwdfwsettings{'SRC_PORT'} =~ s/\|/,/g;
- $fwdfwsettings{'TGT_PORT'} =~ s/\|/,/g;
- $fwdfwsettings{'dnatport'} =~ tr/|/,/;
-
- # The dnatport may be empty, if it matches TGT_PORT
- if ($fwdfwsettings{'dnatport'} eq $fwdfwsettings{'TGT_PORT'}) {
- $fwdfwsettings{'dnatport'} = "";
- }
-
- print <<END;
-
- <div id="PROTOCOL_PORTS">
- <table border="0">
- <tr>
- <!-- #SOURCEPORT -->
- <td>
- $Lang::tr{'fwdfw use srcport'}
- </td>
- <td>
- <input type='text' name='SRC_PORT' value='$fwdfwsettings{'SRC_PORT'}' maxlength='20' size='18'>
- </td>
- <td width='10%'>
- </td>
-
- <!-- #TARGETPORT -->
- <td>
- $Lang::tr{'fwdfw use srv'}
- </td>
-
- <td>
- <input type='text' name='TGT_PORT' value='$fwdfwsettings{'TGT_PORT'}' maxlength='20' size='18'>
- </td>
- </tr>
- <tr class="NAT">
- <td colspan='3'></td>
- <td>$Lang::tr{'fwdfw external port nat'}:</td>
- <td>
- <input type='text' name='dnatport' value=\"$fwdfwsettings{'dnatport'}\" maxlength='20' size='18'>
- </td>
- </tr>
- </table>
- </div>
-
- <div id="PROTOCOL_TEMPLATE">
- <table border="0">
- <tr>
- <td>
- <input type='radio' name='grp3' id='cust_srv' value='cust_srv' checked>
- $Lang::tr{'fwhost cust service'}
- </td>
- <td>
- <select name='cust_srv' style='min-width: 230px;'>
-END
&General::readhasharray("$configsrv", \%customservice);
foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){
print"<option ";
print"value='$customservice{$key}[0]'>$customservice{$key}[0]</option>";
}
- print<<END;
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <input type='radio' name='grp3' id='cust_srvgrp' value='cust_srvgrp' $checked{'grp3'}{'cust_srvgrp'}>
- $Lang::tr{'fwhost cust srvgrp'}
- </td>
- <td>
- <select name='cust_srvgrp' style='min-width:230px;'>
+ print <<END;
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type='radio' name='grp3' id='cust_srvgrp' value='cust_srvgrp' $checked{'grp3'}{'cust_srvgrp'}>
+ $Lang::tr{'fwhost cust srvgrp'}
+ </td>
+ <td>
+ <select name='cust_srvgrp' style='min-width:230px;'>
END
&General::readhasharray("$configsrvgrp", \%customservicegrp);
print">$customservicegrp{$key}[0]</option>";
}
$helper=$customservicegrp{$key}[0];
- }
+ }
+
print<<END;
- </select>
+ </select>
+ </td>
+ </tr>
+ </table>
</td>
</tr>
</table>
- </div>
-
- <br><br><br>
END
&Header::closebox;
if ($remark !~ /^[a-zäöüA-ZÖÄÜ0-9-.:;\|_()\/\s]*$/) {
return 0;}
# First character can only be a letter or a digit
- if (substr ($remark, 0, 1) !~ /^[a-zäöüA-ZÖÄÜ0-9]*$/) {
+ if (substr ($remark, 0, 1) !~ /^[a-zäöüA-ZÖÄÜ0-9(]*$/) {
return 0;}
# Last character can only be a letter or a digit
if (substr ($remark, -1, 1) !~ /^[a-zöäüA-ZÖÄÜ0-9.:;_)]*$/) {
return 0;}
return 1;
}
-sub viewtablerule
-{
+
+sub viewtablerule {
&General::readhash("/var/ipfire/ethernet/settings", \%netsettings);
- &viewtablenew(\%configfwdfw,$configfwdfw,"","Forward" );
- &viewtablenew(\%configinputfw,$configinput,"",$Lang::tr{'fwdfw xt access'} );
- &viewtablenew(\%configoutgoingfw,$configoutgoing,"","Outgoing" );
+
+ &viewtablenew(\%configfwdfw, $configfwdfw, $Lang::tr{'firewall rules'});
+ &viewtablenew(\%configinputfw, $configinput, $Lang::tr{'external access'});
+ &viewtablenew(\%configoutgoingfw, $configoutgoing, $Lang::tr{'outgoing firewall'});
}
+
sub viewtablenew
{
my $hash=shift;
my $config=shift;
my $title=shift;
- my $title1=shift;
my $go='';
+
+ my $show_box = (! -z $config) || ($optionsfw{'SHOWTABLES'} eq 'on');
+ return if (!$show_box);
+
&General::get_aliases(\%aliases);
&General::readhasharray("$confighost", \%customhost);
&General::readhasharray("$config", $hash);
&General::readhasharray("$configccdnet", \%ccdnet);
&General::readhasharray("$configccdhost", \%ccdhost);
- if( ! -z $config){
- &Header::openbox('100%', 'left',$title);
+
+ &Header::openbox('100%', 'left', $title);
+ print "<table width='100%' cellspacing='0' border='0'>";
+
+ if (! -z $config) {
my $count=0;
my ($gif,$log);
my $ruletype;
my $tooltip;
my @tmpsrc=();
my $coloryellow='';
- print <<END;
- <b>$title1</b>
- <br>
- <table width='100%' cellspacing='0' border='0'>
+ print <<END;
<tr>
<th align='right' width='3%'>
#
<b>$Lang::tr{'fwdfw source'}</b>
</th>
<th align='center'>
- Log <!-- XXX UNTRANSLATED STRING -->
+ <b>$Lang::tr{'fwdfw log'}</b>
</th>
<th align='center' width='30%'>
<b>$Lang::tr{'fwdfw target'}</b>
#Get Protocol
my $prot;
if ($$hash{$key}[8]){
- push (@protocols,$$hash{$key}[8]);
+ if ($$hash{$key}[8] eq "IPv6"){
+ push (@protocols,$Lang::tr{'fwdfw prot41 short'})
+ }else{
+ push (@protocols,$$hash{$key}[8]);
+ }
}elsif($$hash{$key}[14] eq 'cust_srv'){
&get_serviceports("service",$$hash{$key}[15]);
}elsif($$hash{$key}[14] eq 'cust_srvgrp'){
#SOURCE
my $ipfireiface;
&getcolor($$hash{$key}[3],$$hash{$key}[4],\%customhost);
- print"<td align='center' width='160' $tdcolor>";
+ print"<td align='center' width='30%' $tdcolor>";
if ($$hash{$key}[3] eq 'ipfire_src'){
- $ipfireiface='Interface ';
+ $ipfireiface=$Lang::tr{'fwdfw iface'};
}
if ($$hash{$key}[3] eq 'std_net_src'){
print &get_name($$hash{$key}[4]);
if ($$hash{$key}[5] eq 'std_net_tgt' || $$hash{$key}[5] eq 'ipfire' || $$hash{$key}[6] eq 'RED1' || $$hash{$key}[6] eq 'GREEN' || $$hash{$key}[6] eq 'ORANGE' || $$hash{$key}[6] eq 'BLUE' ){
if ($$hash{$key}[6] eq 'RED1'){
print "$ipfireiface $Lang::tr{'red1'}";
- }elsif ($$hash{$key}[6] eq 'GREEN' || $$hash{$key}[6] eq 'ORANGE' || $$hash{$key}[6] eq 'BLUE'|| $$hash{$key}[6] eq 'ALL')
+ }elsif ($$hash{$key}[6] eq 'GREEN' || $$hash{$key}[6] eq 'ORANGE' || $$hash{$key}[6] eq 'BLUE'|| $$hash{$key}[6] eq 'ALL' || $$hash{$key}[6] eq 'RED')
{
print "$ipfireiface ".&get_name($$hash{$key}[6]);
}else{
}
print"<tr bgcolor='FFFFFF'><td colspan='13' height='1'></td></tr>";
}
- print"</table>";
- #SHOW FINAL RULE
- print "<table width='100%'rules='cols' border='1'>";
- my $col;
- if ($config eq '/var/ipfire/forward/config'){
- my $pol='fwdfw '.$fwdfwsettings{'POLICY'};
- if ($fwdfwsettings{'POLICY'} eq 'MODE1'){
- $col="bgcolor='darkred'";
- }else{
- $col="bgcolor='green'";
- }
- &show_defaultrules($col,$pol);
- }elsif ($config eq '/var/ipfire/forward/outgoing'){
- if ($fwdfwsettings{'POLICY1'} eq 'MODE1'){
- $col="bgcolor='darkred'";
- print"<tr><td $col width='20%' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td $col align='center'><font color='#FFFFFF' >$Lang::tr{'fwdfw pol block'}</font></td></tr>";
- }else{
- $col="bgcolor='green'";
- print"<tr><td $col width='20%' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td $col align='center'><font color='#FFFFFF' >$Lang::tr{'fwdfw pol allow'}</font></td></tr>";
- }
- }else{
- print"<tr><td bgcolor='darkred' width='20%' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td bgcolor='darkred' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol block'}</font></td></tr>";
+ } elsif ($optionsfw{'SHOWTABLES'} eq 'on') {
+ print <<END;
+ <tr>
+ <td colspan='7' height='30' bgcolor=$color{'color22'} align='center'>$Lang::tr{'fwhost empty'}</td>
+ </tr>
+END
+ }
+
+ #SHOW FINAL RULE
+ my $policy = 'fwdfw ' . $fwdfwsettings{'POLICY'};
+ my $colour = "bgcolor='green'";
+ if ($fwdfwsettings{'POLICY'} eq 'MODE1') {
+ $colour = "bgcolor='darkred'";
+ }
+
+ my $message;
+ if (($config eq '/var/ipfire/firewall/config') && ($fwdfwsettings{'POLICY'} ne 'MODE1')) {
+ print <<END;
+ <tr>
+ <td colspan='13'> </td>
+ </tr>
+ <tr>
+ <td colspan='13'>
+ <table width="100%" border='1' rules="cols" cellspacing='0'>
+END
+
+ # GREEN
+ print <<END;
+ <tr>
+ <td align='center'>
+ <font color="$Header::colourgreen">$Lang::tr{'green'}</font>
+ </td>
+ <td align='center'>
+ <font color="$Header::colourred">$Lang::tr{'red'}</font>
+ ($Lang::tr{'fwdfw pol allow'})
+ </td>
+END
+
+ if (&Header::orange_used()) {
+ print <<END;
+ <td align='center'>
+ <font color="$Header::colourorange">$Lang::tr{'orange'}</font>
+ ($Lang::tr{'fwdfw pol allow'})
+ </td>
+END
}
- print"</table>";
- print "<hr>";
- print "<br><br>";
- &Header::closebox();
- }else{
- if ($optionsfw{'SHOWTABLES'} eq 'on'){
- print "<b>$title1</b><br>";
- print"<table width='100%' border='0' rules='none'><tr><td height='30' bgcolor=$color{'color22'} align='center'>$Lang::tr{'fwhost empty'}</td></tr></table>";
- my $col;
- if ($config eq '/var/ipfire/forward/config'){
- my $pol='fwdfw '.$fwdfwsettings{'POLICY'};
- if ($fwdfwsettings{'POLICY'} eq 'MODE1'){
- $col="bgcolor='darkred'";
- }else{
- $col="bgcolor='green'";
- }
- &show_defaultrules($col,$pol);
- }elsif ($config eq '/var/ipfire/forward/outgoing'){
- print "<table width='100%' rules='cols' border='1'>";
- my $pol='fwdfw '.$fwdfwsettings{'POLICY1'};
- if ($fwdfwsettings{'POLICY1'} eq 'MODE1'){
- $col="bgcolor='darkred'";
- print"<tr><td $col align='center' width='20%'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol block'}</font></td></tr>";
- }else{
- $col="bgcolor='green'";
- print"<tr><td $col align='center' width='20%'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol allow'}</font></td></tr>";
- }
- }else{
- print "<table width='100%' rules='cols' border='1'>";
- print"<tr><td bgcolor='darkred' align='center' width='20%'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td align='center' bgcolor='darkred'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol block'}</font></td></tr>";
- }
- print"</table><br><br>";
+
+ if (&Header::blue_used()) {
+ print <<END;
+ <td align='center'>
+ <font color="$Header::colourblue">$Lang::tr{'blue'}</font>
+ ($Lang::tr{'fwdfw pol allow'})
+ </td>
+END
}
- }
-}
-&Header::closebigbox();
-&Header::closepage();
-sub show_defaultrules
-{
- my $col=shift;
- my $pol=shift;
- #STANDARD RULES (From WIKI)
- print"</table>";
- if ($col eq "bgcolor='green'"){
- print "<br><table width='100%' rules='cols' border='1' >";
- my $blue = "<font color=$Header::colourblue> $Lang::tr{'blue'}</font> ($Lang::tr{'fwdfw pol block'})" if (&Header::blue_used());
- my $orange = "<font color=$Header::colourorange> $Lang::tr{'orange'}</font> ($Lang::tr{'fwdfw pol block'})" if (&Header::orange_used());
- my $blue1 = "<font color=$Header::colourblue> $Lang::tr{'blue'}</font> ($Lang::tr{'fwdfw pol allow'})" if (&Header::blue_used());
- my $orange1 = "<font color=$Header::colourorange> $Lang::tr{'orange'}</font> ($Lang::tr{'fwdfw pol allow'})" if (&Header::orange_used());
- print"<tr><td align='center'><font color='#000000'>$Lang::tr{'green'}</td><td align='center'> <font color=$Header::colourred> $Lang::tr{'red'}</font> ($Lang::tr{'fwdfw pol allow'})</td>";
- print"<td align='center'>$orange1</td>" if (&Header::orange_used());
- print"<td align='center'>$blue1</td>" if (&Header::blue_used());
print"</tr>";
- if (&Header::orange_used()){
- print"<tr><td align='center' width='20%'><font color='#000000'>$Lang::tr{'orange'}</td><td align='center'> <font color=$Header::colourred> $Lang::tr{'red'}</font> ($Lang::tr{'fwdfw pol allow'})</td><td align='center'><font color=$Header::colourgreen> $Lang::tr{'green'}</font> ($Lang::tr{'fwdfw pol block'})</td>";
- print"<td align='center'>$blue</td>" if (&Header::blue_used());
+
+ # ORANGE
+ if (&Header::orange_used()) {
+ print <<END;
+ <tr>
+ <td align='center' width='20%'>
+ <font color="$Header::colourorange">$Lang::tr{'orange'}</font>
+ </td>
+ <td align='center'>
+ <font color="$Header::colourred">$Lang::tr{'red'}</font>
+ ($Lang::tr{'fwdfw pol allow'})
+ </td>
+ <td align='center'>
+ <font color="$Header::colourgreen">$Lang::tr{'green'}</font>
+ ($Lang::tr{'fwdfw pol block'})
+ </td>
+END
+
+ if (&Header::blue_used()) {
+ print <<END;
+ <td align='center'>
+ <font color="$Header::colourblue">$Lang::tr{'blue'}</font>
+ ($Lang::tr{'fwdfw pol block'})
+ </td>
+END
+ }
+
print"</tr>";
}
- if (&Header::blue_used()){
- print"<tr><td align='center'><font color='#000000'>$Lang::tr{'blue'}</td><td align='center'> <font color=$Header::colourred> $Lang::tr{'red'}</font> ($Lang::tr{'fwdfw pol allow'})</td>";
- print"<td align='center'>$orange</td>" if (&Header::orange_used());
- print"<td align='center'><font color=$Header::colourgreen> $Lang::tr{'green'}</font> ($Lang::tr{'fwdfw pol block'})</td>";
+
+ if (&Header::blue_used()) {
+ print <<END;
+ <tr>
+ <td align='center'>
+ <font color="$Header::colourblue">$Lang::tr{'blue'}</font>
+ </td>
+ <td align='center'>
+ <font color="$Header::colourred">$Lang::tr{'red'}</font>
+ ($Lang::tr{'fwdfw pol allow'})
+ </td>
+END
+
+ if (&Header::orange_used()) {
+ print <<END;
+ <td align='center'>
+ <font color="$Header::colourorange">$Lang::tr{'orange'}</font>
+ ($Lang::tr{'fwdfw pol block'})
+ </td>
+ <td align='center'>
+ <font color="$Header::colourgreen">$Lang::tr{'green'}</font>
+ ($Lang::tr{'fwdfw pol block'})
+ </td>
+END
+ }
+
print"</tr>";
}
- print"<tr><td $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} </font></td><td $col colspan='3' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol allow'}</font></td></tr>";
- }elsif($col eq "bgcolor='darkred'"){
- print "<table width='100%' rules='cols' border='1' >";
- print"<tr><td $col width='20%' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'}</td><td $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw pol block'}</font></td></tr>";
+
+ print <<END;
+ </table>
+ </td>
+ </tr>
+END
+
+ $message = $Lang::tr{'fwdfw pol allow'};
+
+ } elsif ($config eq '/var/ipfire/firewall/outgoing') {
+ $message = $Lang::tr{'fwdfw pol allow'};
+
+ } else {
+ $message = $Lang::tr{'fwdfw pol block'};
+ $colour = "bgcolor='darkred'";
}
+
+ if ($message) {
+ print <<END;
+ <tr>
+ <td $colour align='center' colspan='13'>
+ <font color='#FFFFFF'>$Lang::tr{'policy'}: $message</font>
+ </td>
+ </tr>
+END
+ }
+
+ print "</table>";
+ print "<br>";
+
+ &Header::closebox();
}
+
+&Header::closebigbox();
+&Header::closepage();