]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Forward Firewall: added an option to firewall-options to show all dropdowns on rulecr...
authorAlexander Marx <amarx@ipfire.org>
Thu, 28 Feb 2013 05:05:32 +0000 (06:05 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:09:17 +0000 (14:09 +0200)
html/cgi-bin/forwardfw.cgi
html/cgi-bin/optionsfw.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/configroot

index b93557d8375870a9dbf326f63d1450bdec6d9bbe..f48c2401b8f4d32d84451f561bd2107f5189d9aa 100755 (executable)
@@ -1026,7 +1026,7 @@ print<<END;
                <table width='100%' border='0'>
                <tr><td width='50%' valign='top'>
                <table width='100%' border='0'>
                <table width='100%' border='0'>
                <tr><td width='50%' valign='top'>
                <table width='100%' border='0'>
-               <tr><td width='1%'><input type='radio' name='$grp' value='std_net_$srctgt' $checked{$grp}{'std_net_'.$srctgt}></td><td>$Lang::tr{'fwhost stdnet'}</td><td><select name='std_net_$srctgt' style='min-width:185px;'>
+               <tr><td width='1%'><input type='radio' name='$grp' value='std_net_$srctgt' $checked{$grp}{'std_net_'.$srctgt}></td><td>$Lang::tr{'fwhost stdnet'}</td><td align='right'><select name='std_net_$srctgt' style='min-width:185px;'>
 END
        foreach my $network (sort keys %defaultNetworks)
                {
 END
        foreach my $network (sort keys %defaultNetworks)
                {
@@ -1038,20 +1038,20 @@ END
                }
        print"</select></td></tr>";
        #custom networks
                }
        print"</select></td></tr>";
        #custom networks
-       if (! -z $confignet){
-               print"<tr><td><input type='radio' name='$grp' value='cust_net_$srctgt' $checked{$grp}{'cust_net_'.$srctgt}></td><td>$Lang::tr{'fwhost cust net'}</td><td><select name='cust_net_$srctgt' style='min-width:185px;'>";
+       if (! -z $confignet || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
+               print"<tr><td><input type='radio' name='$grp' value='cust_net_$srctgt' $checked{$grp}{'cust_net_'.$srctgt}></td><td>$Lang::tr{'fwhost cust net'}</td><td align='right'><select name='cust_net_$srctgt' style='min-width:185px;'>";
                &fillselect(\%customnetwork,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td>";
        }
        #custom hosts
                &fillselect(\%customnetwork,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td>";
        }
        #custom hosts
-       if (! -z $confighost){
-               print"<tr><td><input type='radio' name='$grp' value='cust_host_$srctgt' $checked{$grp}{'cust_host_'.$srctgt}></td><td>$Lang::tr{'fwhost cust addr'}</td><td><select name='cust_host_$srctgt' style='min-width:185px;'>";
+       if (! -z $confighost || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
+               print"<tr><td><input type='radio' name='$grp' value='cust_host_$srctgt' $checked{$grp}{'cust_host_'.$srctgt}></td><td>$Lang::tr{'fwhost cust addr'}</td><td align='right'><select name='cust_host_$srctgt' style='min-width:185px;'>";
                &fillselect(\%customhost,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td>";
        }
        #custom groups
                &fillselect(\%customhost,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td>";
        }
        #custom groups
-       if (! -z $configgrp){
-               print"<tr><td valign='top'><input type='radio' name='$grp' value='cust_grp_$srctgt' $checked{$grp}{'cust_grp_'.$srctgt}></td><td >$Lang::tr{'fwhost cust grp'}</td><td><select name='cust_grp_$srctgt' style='min-width:185px;'>";
+       if (! -z $configgrp || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
+               print"<tr><td valign='top'><input type='radio' name='$grp' value='cust_grp_$srctgt' $checked{$grp}{'cust_grp_'.$srctgt}></td><td >$Lang::tr{'fwhost cust grp'}</td><td align='right'><select name='cust_grp_$srctgt' style='min-width:185px;'>";
                foreach my $key (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } keys %customgrp) {
                        if($helper ne $customgrp{$key}[0]){
                                print"<option ";
                foreach my $key (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } keys %customgrp) {
                        if($helper ne $customgrp{$key}[0]){
                                print"<option ";
@@ -1065,43 +1065,52 @@ END
        #End left table. start right table (vpn)
        print"</tr></table></td><td valign='top'><table width='100%' border='0'><tr>";
        # CCD networks
        #End left table. start right table (vpn)
        print"</tr></table></td><td valign='top'><table width='100%' border='0'><tr>";
        # CCD networks
-       if( ! -z $configccdnet){
-               print"<td width='1%'><input type='radio' name='$grp' value='ovpn_net_$srctgt'  $checked{$grp}{'ovpn_net_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdnet'}</td><td nowrap='nowrap' width='1%'><select name='ovpn_net_$srctgt' style='min-width:185px;'>";
+       if( ! -z $configccdnet || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
+               print"<td width='1%'><input type='radio' name='$grp' value='ovpn_net_$srctgt'  $checked{$grp}{'ovpn_net_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdnet'}</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_net_$srctgt' style='min-width:185px;'>";
                &fillselect(\%ccdnet,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td></tr>";
        }
        #OVPN CCD Hosts
        foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost){
                &fillselect(\%ccdnet,$fwdfwsettings{$fwdfwsettings{$grp}});
                print"</select></td></tr>";
        }
        #OVPN CCD Hosts
        foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost){
-               if ($ccdhost{$key}[33] ne ''){
-                       print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_host_$srctgt' $checked{$grp}{'ovpn_host_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdhost'}</td><td nowrap='nowrap' width='1%'><select name='ovpn_host_$srctgt' style='min-width:185px;'>" if ($show eq '');
+               if ($ccdhost{$key}[33] ne '' ){
+                       print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_host_$srctgt' $checked{$grp}{'ovpn_host_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdhost'}</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_host_$srctgt' style='min-width:185px;'>" if ($show eq '');
                        $show='1';
                        print "<option value='$ccdhost{$key}[1]'";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ccdhost{$key}[1]);
                        print ">$ccdhost{$key}[1]</option>";
                }
        }
                        $show='1';
                        print "<option value='$ccdhost{$key}[1]'";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ccdhost{$key}[1]);
                        print ">$ccdhost{$key}[1]</option>";
                }
        }
+       if($optionsfw{'SHOWDROPDOWN'} eq 'on' && $show eq ''){
+               print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_host_$srctgt' $checked{$grp}{'ovpn_host_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdhost'}</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_host_$srctgt' style='min-width:185px;'></select></td></tr>" ;
+       }
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        #OVPN N2N
        foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost){
                if ($ccdhost{$key}[3] eq 'net'){
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        #OVPN N2N
        foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost){
                if ($ccdhost{$key}[3] eq 'net'){
-                       print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_n2n_$srctgt' $checked{$grp}{'ovpn_n2n_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ccdhost'}</td><td nowrap='nowrap' width='1%'><select name='ovpn_n2n_$srctgt' style='min-width:185px;'>" if ($show eq '');
-                       my $show='1';
+                       print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_n2n_$srctgt' $checked{$grp}{'ovpn_n2n_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ovpn_n2n'}:</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_n2n_$srctgt' style='min-width:185px;'>" if ($show eq '');
+                       $show='1';
                        print "<option value='$ccdhost{$key}[1]'";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ccdhost{$key}[1]);
                        print ">$ccdhost{$key}[1]</option>";
                }
        }
                        print "<option value='$ccdhost{$key}[1]'";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ccdhost{$key}[1]);
                        print ">$ccdhost{$key}[1]</option>";
                }
        }
+       if($optionsfw{'SHOWDROPDOWN'} eq 'on' && $show eq ''){
+               print"<tr><td width='1%'><input type='radio' name='$grp' value='ovpn_n2n_$srctgt' $checked{$grp}{'ovpn_n2n_'.$srctgt}></td><td nowrap='nowrap' width='16%'>$Lang::tr{'fwhost ovpn_n2n'}</td><td nowrap='nowrap' width='1%' align='right'><select name='ovpn_n2n_$srctgt' style='min-width:185px;'></select></td></tr>" ;
+       }
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        #IPsec netze
        foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        #IPsec netze
        foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
-               if ($ipsecconf{$key}[3] eq 'net'){
-                       print"<tr><td valign='top'><input type='radio' name='$grp' value='ipsec_net_$srctgt' $checked{$grp}{'ipsec_net_'.$srctgt}></td><td >$Lang::tr{'fwhost ipsec net'}</td><td><select name='ipsec_net_$srctgt' style='min-width:185px;'>" if ($show eq '');
+               if ($ipsecconf{$key}[3] eq 'net' || $optionsfw{'SHOWDROPDOWN'} eq 'on'){
+                       print"<tr><td valign='top'><input type='radio' name='$grp' value='ipsec_net_$srctgt' $checked{$grp}{'ipsec_net_'.$srctgt}></td><td >$Lang::tr{'fwhost ipsec net'}</td><td align='right'><select name='ipsec_net_$srctgt' style='min-width:185px;'>" if ($show eq '');
                        $show='1';
                        print "<option ";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ipsecconf{$key}[1]);
                        print ">$ipsecconf{$key}[1]</option>";
                }
        }
                        $show='1';
                        print "<option ";
                        print "selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $ipsecconf{$key}[1]);
                        print ">$ipsecconf{$key}[1]</option>";
                }
        }
+       if($optionsfw{'SHOWDROPDOWN'} eq 'on' && $show eq ''){
+               print"<tr><td valign='top'><input type='radio' name='$grp' value='ipsec_net_$srctgt' $checked{$grp}{'ipsec_net_'.$srctgt}></td><td >$Lang::tr{'fwhost ipsec net'}</td><td align='right'><select name='ipsec_net_$srctgt' style='min-width:185px;'><select></td></tr>";
+       }
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        
        print"</tr></table>";
        if ($show eq '1'){$show='';print"</select></td></tr>";}
        
        print"</tr></table>";
index 90c3a32a01546c4151f834e126b7d9ad17ddcacd..898ee286fe65c677b2ddbebed6bd674dd1582171 100644 (file)
@@ -38,6 +38,7 @@ $settings{'DROPWIRELESSFORWARD'} = 'on';
 $settings{'SHOWCOLORS'} = 'off';
 $settings{'SHOWREMARK'} = 'on';
 $settings{'SHOWTABLES'} = 'on';
 $settings{'SHOWCOLORS'} = 'off';
 $settings{'SHOWREMARK'} = 'on';
 $settings{'SHOWTABLES'} = 'on';
+$settings{'SHOWDROPDOWN'} = 'off';
 
 my $errormessage = '';
 my $warnmessage = '';
 
 my $errormessage = '';
 my $warnmessage = '';
@@ -103,12 +104,11 @@ $checked{'SHOWREMARK'}{$settings{'SHOWREMARK'}} = "checked='checked'";
 $checked{'SHOWTABLES'}{'off'} = '';
 $checked{'SHOWTABLES'}{'on'} = '';
 $checked{'SHOWTABLES'}{$settings{'SHOWTABLES'}} = "checked='checked'";
 $checked{'SHOWTABLES'}{'off'} = '';
 $checked{'SHOWTABLES'}{'on'} = '';
 $checked{'SHOWTABLES'}{$settings{'SHOWTABLES'}} = "checked='checked'";
-$checked{'FWPOLICY'}{'DROP'} = '';
-$checked{'FWPOLICY'}{'REJECT'} = '';
-$checked{'FWPOLICY'}{$settings{'FWPOLICY'}} = "checked='checked'";
-$checked{'FWPOLICY1'}{'DROP'} = '';
-$checked{'FWPOLICY1'}{'REJECT'} = '';
-$checked{'FWPOLICY1'}{$settings{'FWPOLICY1'}} = "checked='checked'";
+$checked{'SHOWDROPDOWN'}{'off'} = '';
+$checked{'SHOWDROPDOWN'}{'on'} = '';
+$checked{'SHOWDROPDOWN'}{$settings{'SHOWDROPDOWN'}} = "checked='checked'";
+$selected{'FWPOLICY'}{$settings{'FWPOLICY'}}= 'selected';
+$selected{'FWPOLICY1'}{$settings{'FWPOLICY1'}}= 'selected';
 
 
 &Header::openbox('100%', 'center', $Lang::tr{'options fw'});
 
 
 &Header::openbox('100%', 'center', $Lang::tr{'options fw'});
@@ -148,18 +148,23 @@ print <<END
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings color'}</td><td align='left'>on <input type='radio' name='SHOWCOLORS' value='on' $checked{'SHOWCOLORS'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='SHOWCOLORS' value='off' $checked{'SHOWCOLORS'}{'off'} /> off</td></tr>
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings remark'}</td><td align='left'>on <input type='radio' name='SHOWREMARK' value='on' $checked{'SHOWREMARK'}{'on'} />/
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings color'}</td><td align='left'>on <input type='radio' name='SHOWCOLORS' value='on' $checked{'SHOWCOLORS'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='SHOWCOLORS' value='off' $checked{'SHOWCOLORS'}{'off'} /> off</td></tr>
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings remark'}</td><td align='left'>on <input type='radio' name='SHOWREMARK' value='on' $checked{'SHOWREMARK'}{'on'} />/
-                                                                                                                                                                               <input type='radio' name='SHOWREMARK' value='off' $checked{'SHOWREMARK'}{'off'} /> off</td></tr>
+                                                                                                                                                                               <input type='radio' name='SHOWREMARK' value='off' $checked{'SHOWREMARK'}{'off'} /> off</td></tr>                
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings ruletable'}</td><td align='left'>on <input type='radio' name='SHOWTABLES' value='on' $checked{'SHOWTABLES'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='SHOWTABLES' value='off' $checked{'SHOWTABLES'}{'off'} /> off</td></tr>
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings ruletable'}</td><td align='left'>on <input type='radio' name='SHOWTABLES' value='on' $checked{'SHOWTABLES'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='SHOWTABLES' value='off' $checked{'SHOWTABLES'}{'off'} /> off</td></tr>
-</table>
+<tr><td align='left' width='60%'>$Lang::tr{'fw settings dropdown'}</td><td align='left'>on <input type='radio' name='SHOWDROPDOWN' value='on' $checked{'SHOWDROPDOWN'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='SHOWDROPDOWN' value='off' $checked{'SHOWDROPDOWN'}{'off'} /> off</td></tr>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+</table>                                                                                                                                                                               
 <br />
 <table width='95%' cellspacing='0'>
 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'fw default drop'}</b></td></tr>
 <br />
 <table width='95%' cellspacing='0'>
 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'fw default drop'}</b></td></tr>
-<tr><td align='left' width='60%'>$Lang::tr{'drop action'}</td><td align='left'>DROP <input type='radio' name='FWPOLICY' value='DROP' $checked{'FWPOLICY'}{'DROP'} />/
-                                                                                                                                                                               <input type='radio' name='FWPOLICY' value='REJECT' $checked{'FWPOLICY'}{'REJECT'} /> REJECT</td></tr>
-<tr><td align='left' width='60%'>$Lang::tr{'drop action1'}</td><td align='left'>DROP <input type='radio' name='FWPOLICY1' value='DROP' $checked{'FWPOLICY1'}{'DROP'} />/
-                                                                                                                                                                               <input type='radio' name='FWPOLICY1' value='REJECT' $checked{'FWPOLICY1'}{'REJECT'} /> REJECT</td></tr>
-
+<tr><td align='left' width='60%'>$Lang::tr{'drop action'}</td><td><select name='FWPOLICY'>
+<option value='DROP' $selected{'FWPOLICY'}{'DROP'}>DROP</option>
+<option value='REJECT' $selected{'FWPOLICY'}{'REJECT'}>REJECT</option></select>
+</td></tr>
+<tr><td align='left' width='60%'>$Lang::tr{'drop action1'}</td><td><select name='FWPOLICY1'>
+<option value='DROP' $selected{'FWPOLICY1'}{'DROP'}>DROP</option>
+<option value='REJECT' $selected{'FWPOLICY1'}{'REJECT'}>REJECT</option></select>
+</td></tr>
 </table>
 
 <br />
 </table>
 
 <br />
index d97739e8a09a9b2b91bbc6d463c79307932ff809..c28c2b2edd9637666b54c7ace07493a7bebf4040 100644 (file)
 'fw settings color' => 'Farben in Regeltabelle anzeigen',
 'fw settings remark' => 'Anmerkungen in Regeltabelle anzeigen',
 'fw settings ruletable' => 'Leere Regeltabellen anzeigen',
 'fw settings color' => 'Farben in Regeltabelle anzeigen',
 'fw settings remark' => 'Anmerkungen in Regeltabelle anzeigen',
 'fw settings ruletable' => 'Leere Regeltabellen anzeigen',
+'fw settings dropdown' => 'Alle Netzwerke auf Regelerstellungsseite anzeigen',
 'fw logging' => 'Firewall-Logging',
 'gateway' => 'Gateway',
 'gateway ip' => 'Gateway-IP',
 'fw logging' => 'Firewall-Logging',
 'gateway' => 'Gateway',
 'gateway ip' => 'Gateway-IP',
index 99976d12a2c6bc374989f98efae0ff148d3a3b9c..e15167ba83bc94644cf45e5d22e217c0a48db1fa 100644 (file)
 'fw settings color' => 'Show colors in ruletable',
 'fw settings remark' => 'Show remarks in ruletable',
 'fw settings ruletable' => 'Show empty ruletables',
 'fw settings color' => 'Show colors in ruletable',
 'fw settings remark' => 'Show remarks in ruletable',
 'fw settings ruletable' => 'Show empty ruletables',
+'fw settings dropdown' => 'Show all networks on rulecreation site',
 'fw logging' => 'Firewall logging',
 'g.dtm' => 'TO BE REMOVED',
 'g.lite' => 'TO BE REMOVED',
 'fw logging' => 'Firewall logging',
 'g.dtm' => 'TO BE REMOVED',
 'g.lite' => 'TO BE REMOVED',
index 1a4edb0268ce27f3f6b9c26d5a3e48d16b93e54f..77cb67659d7609ed3e70bb2fa3067fdab8c00de1 100644 (file)
@@ -123,6 +123,7 @@ $(TARGET) :
        echo  "SHOWREMARK=on"           >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "SHOWCOLORS=off"          >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "SHOWTABLES=on"           >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "SHOWREMARK=on"           >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "SHOWCOLORS=off"          >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "SHOWTABLES=on"           >> $(CONFIG_ROOT)/optionsfw/settings
+       echo  "SHOWDROPDOWN=off         >> $(CONFIG_ROOT)/optionsfw/settings
        echo  "POLICY=MODE2"            >> $(CONFIG_ROOT)/forward/settings
        echo  "POLICY1=MODE2"           >> $(CONFIG_ROOT)/forward/settings
        
        echo  "POLICY=MODE2"            >> $(CONFIG_ROOT)/forward/settings
        echo  "POLICY1=MODE2"           >> $(CONFIG_ROOT)/forward/settings