firewall: Move NAT port field to the protocol section.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2013 15:23:23 +0000 (17:23 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2013 15:23:23 +0000 (17:23 +0200)
doc/language_issues.de
doc/language_issues.en
doc/language_missings
html/cgi-bin/forwardfw.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index c59345d..3393acd 100644 (file)
@@ -189,6 +189,7 @@ WARNING: translation string unused: from warn email bad
 WARNING: translation string unused: fwdfw MODE1
 WARNING: translation string unused: fwdfw MODE2
 WARNING: translation string unused: fwdfw err tgt_port
+WARNING: translation string unused: fwdfw external port nat
 WARNING: translation string unused: fwdfw from
 WARNING: translation string unused: fwdfw ipsec network
 WARNING: translation string unused: fwdfw man port
index 53c09b7..77e825d 100644 (file)
@@ -212,6 +212,7 @@ WARNING: translation string unused: from warn email bad
 WARNING: translation string unused: fwdfw MODE1
 WARNING: translation string unused: fwdfw MODE2
 WARNING: translation string unused: fwdfw err tgt_port
+WARNING: translation string unused: fwdfw external port nat
 WARNING: translation string unused: fwdfw from
 WARNING: translation string unused: fwdfw ipsec network
 WARNING: translation string unused: fwdfw man port
index c14623f..c5f8ac0 100644 (file)
 < fwdfw err tgt_mac
 < fwdfw err tgt_port
 < fwdfw err time
+< fwdfw external port nat
 < fwdfw final_rule
 < fwdfw from
 < fwdfw hint ip1
 < fwdfw err tgt_mac
 < fwdfw err tgt_port
 < fwdfw err time
+< fwdfw external port nat
 < fwdfw final_rule
 < fwdfw from
 < fwdfw hint ip1
 < fwdfw err tgt_mac
 < fwdfw err tgt_port
 < fwdfw err time
+< fwdfw external port nat
 < fwdfw final_rule
 < fwdfw from
 < fwdfw hint ip1
 < fwdfw err tgt_mac
 < fwdfw err tgt_port
 < fwdfw err time
+< fwdfw external port nat
 < fwdfw final_rule
 < fwdfw from
 < fwdfw hint ip1
index ecd8c24..48e12e1 100755 (executable)
@@ -138,12 +138,12 @@ print<<END;
 
                // When nat not used, hide it
                if (! \$("#USE_NAT").attr("checked")) {
-                       \$("#NAT").hide();
+                       \$(".NAT").hide();
                }
 
                // Show NAT area when "use nat" checkbox is clicked
                \$("#USE_NAT").change(function() {
-                       \$("#NAT").toggle();
+                       \$(".NAT").toggle();
                });
 
                // Time constraints
@@ -1660,7 +1660,7 @@ END
                                <input type='checkbox' name='USE_NAT' id='USE_NAT' $checked{'USE_NAT'}{'ON'}>
                                $Lang::tr{'fwdfw use nat'}
                        </label>
-                       <div id="NAT">
+                       <div class="NAT">
                                <table width='100%' border='0'>
                                        <tr>
                                                <td colspan='2'></td>
@@ -1677,9 +1677,6 @@ END
                        print "<option value='$alias' $selected{'dnat'}{$alias}>$alias</option>";
                }
                print"</select></td></tr>";
-               $fwdfwsettings{'dnatport'}=~ tr/|/,/;
-               print"<tr><td colspan='4'></td><td>Port: </td><td align='right'><input type='text' name='dnatport' style='width:130px;' value=\"$fwdfwsettings{'dnatport'}\"> </td></tr>";
-               print"<tr><td colspan='8'><br></td></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;'>";
@@ -1788,6 +1785,12 @@ 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;
 
@@ -1813,6 +1816,13 @@ END
                                                <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>
 
index dd0a39a..0bd2dc3 100644 (file)
 'fwdfw err tgt_mac' => 'MAC-Adressen können nicht als Ziel defininert werden',
 'fwdfw err tgt_port' => 'Ungültiger Zielport',
 'fwdfw err time' => 'Es muss mindestens ein Tag ausgewählt werden',
+'fwdfw external port nat' => 'Externer Port (NAT)',
 'fwdfw final_rule' => 'Letzte Regel: ',
 'fwdfw from' => 'Von:',
 'fwdfw hint ip1' => 'Die zuletzt erzeugte Regel mag eventuell niemals zutreffen, da sich Quelle und Ziel überlappen.',
index e682026..6d43a6c 100644 (file)
 'fwdfw err tgt_mac' => 'A MAC addresses cannot be used as destination.',
 'fwdfw err tgt_port' => 'Invalid destination port.',
 'fwdfw err time' => 'You have to select at least one day.',
+'fwdfw external port nat' => 'External port (NAT)',
 'fwdfw final_rule' => 'Last rule: ',
 'fwdfw from' => 'From:',
 'fwdfw hint ip1' => 'The last generated rule may never match, because source and destination subnets may overlap.',