Forward Firewall: colorize ip addresses when possible in firewall groups. subnetmask...
authorAlexander Marx <amarx@ipfire.org>
Tue, 2 Jul 2013 13:43:44 +0000 (15:43 +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

index 07109f2c54ce7739d9496aa86c6b2ed6050ec310..58eed95b4b1d2953a5be2387e9b211297155785c 100755 (executable)
@@ -817,6 +817,10 @@ sub checkrule
                        }
                }
        }
+       if( $fwdfwsettings{'USE_SRC_PORT'} ne 'ON' && $fwdfwsettings{'USESRV'} ne 'ON'){
+               $fwdfwsettings{'PROT'}='';
+               $fwdfwsettings{'TGT_PROT'}='';
+       }
 }
 sub checkcounter
 {
index 753ffbece7fb834d514a3e1a53b3460ed87ba1a8..c854e9f5cf581024a1d1e1b16fed3163b46035e2 100755 (executable)
@@ -1362,7 +1362,7 @@ sub viewtablenet
                }else{
                        print<<END;
                        <table border='0' width='100%' cellspacing='0'>
-                       <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost netaddress'}</td><td align='center'><b>$Lang::tr{'netmask'}</td><td align='center'><b>$Lang::tr{'remark'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
+                       <tr><td align='center'><b>$Lang::tr{'name'}</td><td align='center'><b>$Lang::tr{'fwhost netaddress'}</td><td align='center'><b>$Lang::tr{'remark'}</td><td align='center'><b>$Lang::tr{'used'}</td><td></td><td width='3%'></td></tr>
 END
                }
                my $count=0;
@@ -1376,7 +1376,8 @@ END
                        {
                                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>";
+                       my $colnet="$customnetwork{$key}[1]/".&General::subtocidr($customnetwork{$key}[2]);
+                       print"<td width='20%'><form method='post'>$customnetwork{$key}[0]</td><td width=15%' align='center'>".&Header::colorize($colnet)."</td><td width='40%'>$customnetwork{$key}[3]</td><td align='center'>$customnetwork{$key}[4]x</td>";
                        print<<END;
                        <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'>
@@ -1511,6 +1512,8 @@ 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{
+                               my ($colip,$colsub) = split("/",$ip);
+                               $ip="$colip/".&General::subtocidr($colsub) if ($colsub);
                                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 ''){