]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/fwhosts.cgi
Forward Firewall: Updated outgoingfw-converter. redesign of the ruletable's defaultrules
[people/teissler/ipfire-2.x.git] / html / cgi-bin / fwhosts.cgi
index 9ae490fd560321372ad9bb34814aa71781189803..73dabaadbc7232e987fba89208393b8de625747d 100755 (executable)
@@ -1171,10 +1171,18 @@ END
                        foreach my $network (sort keys %defaultNetworks)
                        {
                                next if($defaultNetworks{$network}{'LOCATION'} eq "IPCOP");
-                               next if($defaultNetworks{$network}{'NAME'} eq "RED");
+                               next if($defaultNetworks{$network}{'NAME'} eq "IPFire");
                                print "<option value='$defaultNetworks{$network}{'NAME'}'";
                                print " selected='selected'" if ($fwhostsettings{'DEFAULT_SRC_ADR'} eq $defaultNetworks{$network}{'NAME'});
-                               print ">$network</option>";
+                               my $defnet="$defaultNetworks{$network}{'NAME'}_NETADDRESS";
+                               my $defsub="$defaultNetworks{$network}{'NAME'}_NETMASK";
+                               my $defsub1=&General::subtocidr($ownnet{$defsub});
+                               $ownnet{$defnet}='' if ($defaultNetworks{$network}{'NAME'} eq 'RED');
+                               if ($ownnet{$defnet}){
+                                       print ">$network ($ownnet{$defnet}/$defsub1)</option>";
+                               }else{
+                                       print ">$network</option>";
+                               }
                        }
                        print"</select></td></tr>";
                        if (! -z $confignet){
@@ -1362,7 +1370,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,8 +1384,9 @@ END
                        {
                                print" <tr bgcolor='$color{'color20'}'>";
                        }
+                       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='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]' />
@@ -1421,8 +1430,8 @@ END
                        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;
-                       <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]' />
@@ -1511,7 +1520,9 @@ 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{
-                               print"<td align='center'>$ip</td><td align='center'>$customgrp{$key}[3]</td><td width='1%'><form method='post'>";
+                               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 ''){
                                print"<input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'delete'} title=$Lang::tr{'delete'} />";
@@ -1904,7 +1915,8 @@ sub getipforgroup
        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;
                        }
                }
        }