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 c59345df6c7b9aa4bdc518ef8fe810d0a57bf372..3393acdc07998b4069712ebd4d57cddcd692526f 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 53c09b7cc65d4ae430eaee69b3fbd7898cf794da..77e825dca6b720cd42cc6f13cbb1cb320e304847 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 c14623f16a97de21a811b3d4734e0eca322921dc..c5f8ac079dd07e4e3c08a6fb4e05addad98d6a81 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 ecd8c24ec66dc6e34f084cd36778a912f49a24a3..48e12e1a2eeca9e8296465dd1e116b1baf0386f3 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 dd0a39a065de3e87da10332c5008fc655adf112f..0bd2dc3b2091a1ff818bc27bef9fb540c7aefa55 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 e682026cb0c19300f4ded10ee59d10056b16167d..6d43a6c5a0f7252124c8907cb660f1486b741f3d 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.',