&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'}</option>
+END
+ foreach my $alias (sort keys %aliases) {
+ print "<option value='$alias' $selected{'dnat'}{$alias}>$alias</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</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);
+
print "<option value='$defaultNetworks{$network}{'NAME'}'";
print " selected='selected'" if ($fwdfwsettings{$fwdfwsettings{'nat'}} eq $defaultNetworks{$network}{'NAME'});
print ">$network</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 '') {
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;
<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>
my $prot;
if ($$hash{$key}[8]){
if ($$hash{$key}[8] eq "IPv6"){
- push (@protocols,"IPv6 Encap")
+ push (@protocols,$Lang::tr{'fwdfw prot41 short'})
}else{
push (@protocols,$$hash{$key}[8]);
}
#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]);