]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Forward Firewall: delted subnets from hosts in firewallgroups, colorized all ip-addre...
authorAlexander Marx <amarx@ipfire.org>
Tue, 2 Jul 2013 12:55:46 +0000 (14:55 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:15:31 +0000 (14:15 +0200)
html/cgi-bin/forwardfw.cgi
html/cgi-bin/fwhosts.cgi
langs/en/cgi-bin/en.pl

index 9bd4606f9d316a8761f994e8a857743af8a1502a..07109f2c54ce7739d9496aa86c6b2ed6050ec310 100755 (executable)
@@ -1614,7 +1614,7 @@ END
                }       
                print<<END;
                </select></td></tr>
                }       
                print<<END;
                </select></td></tr>
-               <tr><td colspan='2'></td><td><input type='radio' name='grp3' value='cust_srvgrp' $checked{'grp3'}{'cust_srvgrp'}></td><td nowrap='nowrap'>$Lang::tr{'fwhost cust srvgrp'}:</td><td colspan='2'><select name='cust_srvgrp' style='min-width:230px;' >
+               <tr><td colspan='2'></td><td><input type='radio' name='grp3' value='cust_srvgrp' $checked{'grp3'}{'cust_srvgrp'}></td><td nowrap='nowrap'>$Lang::tr{'fwhost cust srvgrp'}</td><td colspan='2'><select name='cust_srvgrp' style='min-width:230px;' >
 END
                &General::readhasharray("$configsrvgrp", \%customservicegrp);
                my $helper;
 END
                &General::readhasharray("$configsrvgrp", \%customservicegrp);
                my $helper;
@@ -1680,14 +1680,12 @@ END
                #SNAT
                print"<tr><td colspan='2'></td><td width='1%'><input type='radio' name='nat' value='snat'  $checked{'nat'}{'snat'}></td><td width='20%'>$Lang::tr{'fwdfw snat'}</td>";
                print"<td width='8%'>IPFire: </td><td width='20%' align='right'><select name='snat' style='width:140px;'>";
                #SNAT
                print"<tr><td colspan='2'></td><td width='1%'><input type='radio' name='nat' value='snat'  $checked{'nat'}{'snat'}></td><td width='20%'>$Lang::tr{'fwdfw snat'}</td>";
                print"<td width='8%'>IPFire: </td><td width='20%' align='right'><select name='snat' style='width:140px;'>";
-               print "<option value='Default IP' $selected{'snat'}{'Default IP'}>Default IP</option>";
                foreach my $alias (sort keys %aliases)
                        {
                                print "<option value='$alias' $selected{'snat'}{$alias}>$alias</option>";
                        }
                foreach my $network (sort keys %defaultNetworks)
                {
                foreach my $alias (sort keys %aliases)
                        {
                                print "<option value='$alias' $selected{'snat'}{$alias}>$alias</option>";
                        }
                foreach my $network (sort keys %defaultNetworks)
                {
-                       next if($defaultNetworks{$network}{'NAME'} eq "RED");
                        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'} eq "IPFire");
                        next if($defaultNetworks{$network}{'NAME'} eq "ALL");
                        next if($defaultNetworks{$network}{'NAME'} =~ /OpenVPN/i);
@@ -2222,14 +2220,16 @@ END
                        }elsif ($$hash{$key}[4] eq 'RED1'){
                                print "$ipfireiface $Lang::tr{'fwdfw red'}";
                        }else{
                        }elsif ($$hash{$key}[4] eq 'RED1'){
                                print "$ipfireiface $Lang::tr{'fwdfw red'}";
                        }else{
-                               print "ipfireiface $$hash{$key}[4]";
+                               print "$$hash{$key}[4]";
                        }
                        $tdcolor='';
                        #SOURCEPORT
                        &getsrcport(\%$hash,$key);
                        #Is this a SNAT rule?
                        if ($$hash{$key}[31] eq 'snat' && $$hash{$key}[28] eq 'ON'){
                        }
                        $tdcolor='';
                        #SOURCEPORT
                        &getsrcport(\%$hash,$key);
                        #Is this a SNAT rule?
                        if ($$hash{$key}[31] eq 'snat' && $$hash{$key}[28] eq 'ON'){
-                               print"<br>->$$hash{$key}[29]";
+                               my $net=&get_name($$hash{$key}[29]);
+                               if ( ! $net){ $net=$$hash{$key}[29];}
+                                       print"<br>->$net";
                                if ($$hash{$key}[30] ne ''){
                                        print": $$hash{$key}[30]";
                                }
                                if ($$hash{$key}[30] ne ''){
                                        print": $$hash{$key}[30]";
                                }
@@ -2271,9 +2271,9 @@ END
                                        print "$ipfireiface $Lang::tr{'red1'}";
                                }elsif ($$hash{$key}[6] ne 'RED')
                                {
                                        print "$ipfireiface $Lang::tr{'red1'}";
                                }elsif ($$hash{$key}[6] ne 'RED')
                                {
-                                       print "$ipfireiface $$hash{$key}[6]";
+                                       print "$ipfireiface ".&get_name($$hash{$key}[6]);
                                }else{
                                }else{
-                                       print "$$hash{$key}[6]";
+                                       print &get_name($$hash{$key}[6]);
                                }
                        }elsif ($$hash{$key}[5] eq 'tgt_addr'){
                                my ($split1,$split2) = split("/",$$hash{$key}[6]);
                                }
                        }elsif ($$hash{$key}[5] eq 'tgt_addr'){
                                my ($split1,$split2) = split("/",$$hash{$key}[6]);
index 9ae490fd560321372ad9bb34814aa71781189803..753ffbece7fb834d514a3e1a53b3460ed87ba1a8 100755 (executable)
@@ -1376,8 +1376,8 @@ END
                        {
                                print" <tr bgcolor='$color{'color20'}'>";
                        }
                        {
                                print" <tr bgcolor='$color{'color20'}'>";
                        }
+                       print"<td width='20%'><form method='post'>$customnetwork{$key}[0]</td><td width=15%' align='center'>".&Header::colorize($customnetwork{$key}[1])."</td><td width='15%' align='center'>$customnetwork{$key}[2]</td><td width='40%'>$customnetwork{$key}[3]</td><td align='center'>$customnetwork{$key}[4]x</td>";
                        print<<END;
                        print<<END;
-                       <td width='20%'><form method='post'>$customnetwork{$key}[0]</td><td width=15%' align='center'>$customnetwork{$key}[1]</td><td width='15%' align='center'>$customnetwork{$key}[2]</td><td width='40%'>$customnetwork{$key}[3]</td><td align='center'>$customnetwork{$key}[4]x</td>
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='editnet'>
                        <input type='hidden' name='HOSTNAME' value='$customnetwork{$key}[0]' />
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='editnet'>
                        <input type='hidden' name='HOSTNAME' value='$customnetwork{$key}[0]' />
@@ -1421,8 +1421,8 @@ END
                        else{            print" <tr bgcolor='$color{'color20'}'>";}
                        my ($ip,$sub)=split(/\//,$customhost{$key}[2]);
                        $customhost{$key}[4]=~s/\s+//g;
                        else{            print" <tr bgcolor='$color{'color20'}'>";}
                        my ($ip,$sub)=split(/\//,$customhost{$key}[2]);
                        $customhost{$key}[4]=~s/\s+//g;
+                       print"<td width='20%'><form method='post'>$customhost{$key}[0]</td><td width='20%' align='center'>".&Header::colorize($ip)."</td><td width='50%' align='left'>$customhost{$key}[3]</td><td align='center'>$customhost{$key}[4]x</td>";
                        print<<END;
                        print<<END;
-                       <td width='20%'><form method='post'>$customhost{$key}[0]</td><td width='20%' align='center'>$ip</td><td width='50%' align='left'>$customhost{$key}[3]</td><td align='center'>$customhost{$key}[4]x</td>
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='edithost' />
                        <input type='hidden' name='HOSTNAME' value='$customhost{$key}[0]' />
                        <td width='1%'><input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
                        <input type='hidden' name='ACTION' value='edithost' />
                        <input type='hidden' name='HOSTNAME' value='$customhost{$key}[0]' />
@@ -1511,7 +1511,7 @@ sub viewtablegrp
                        if ($ip eq '' && $customgrp{$key}[2] ne $Lang::tr{'fwhost empty'}){
                                print "<td align='center'>$Lang::tr{'fwhost deleted'}</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";   
                        }else{
                        if ($ip eq '' && $customgrp{$key}[2] ne $Lang::tr{'fwhost empty'}){
                                print "<td align='center'>$Lang::tr{'fwhost deleted'}</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";   
                        }else{
-                               print"<td align='center'>$ip</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
+                               print"<td align='center'>".&Header::colorize($ip)."</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
                        }
                        if ($delflag > '1' && $ip ne ''){
                                print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
                        }
                        if ($delflag > '1' && $ip ne ''){
                                print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
@@ -1904,7 +1904,8 @@ sub getipforgroup
        if ($type eq 'Custom Host'){
                foreach my $key (keys %customhost) {
                        if ($customhost{$key}[0] eq $name){
        if ($type eq 'Custom Host'){
                foreach my $key (keys %customhost) {
                        if ($customhost{$key}[0] eq $name){
-                               return $customhost{$key}[2];
+                               my ($ip,$sub) = split("/",$customhost{$key}[2]);
+                               return $ip;
                        }
                }
        }
                        }
                }
        }
index da3ec2bed4787c7f2d01b434d8e5a220de76a364..e3ad37c9dc8b36635360bb3a96a25652afb4d755 100644 (file)
 'fwhost stdnet'                        => 'Standard networks:',
 'fwhost type'                  => 'Type',
 'fwhost used'                  => 'Used',
 'fwhost stdnet'                        => 'Standard networks:',
 'fwhost type'                  => 'Type',
 'fwhost used'                  => 'Used',
-'fwhost welcome'               => 'Here you can define single Networks, Hosts or Services which can be grouped together. These Networks, Hosts and Groups can then be used in the firewall. You are able to use only a few rules for a big amount of Networks, Hosts or Groups.',
+'fwhost welcome'               => 'Here you can define single networks, hosts or services which can be grouped together. These networks, hosts and groups can then be used in the firewall. You are able to use only a few rules for a big amount of networks, hosts or groups.',
 'fwhost wo subnet'             => '(without subnet)',
 'free' => 'Free',
 'free memory' => 'Free Memory    ',
 'fwhost wo subnet'             => '(without subnet)',
 'free' => 'Free',
 'free memory' => 'Free Memory    ',