From 0626fac1ac47b506e31cbc59c96ea8811b5d1321 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Fri, 11 Apr 2014 12:06:52 +0200 Subject: [PATCH] Firewall: When having rules with more than 3 protocols, show "many" and tooltip --- html/cgi-bin/firewall.cgi | 12 +++++------- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 28ae464c60..9af97d1a88 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -1260,15 +1260,12 @@ sub get_serviceports my $name=shift; &General::readhasharray("$configsrv", \%customservice); &General::readhasharray("$configsrvgrp", \%customservicegrp); - my $tcp; - my $udp; - my $icmp; @protocols=(); my @specprot=("IPIP","IPV6","IGMP","GRE","AH","ESP"); if($type eq 'service'){ foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){ if ($customservice{$key}[0] eq $name){ - push (@protocols," ".$customservice{$key}[2]); + push (@protocols,$customservice{$key}[2]); } } }elsif($type eq 'group'){ @@ -1280,8 +1277,7 @@ sub get_serviceports foreach my $key1 (sort { ncmp($customservice{$a}[0],$customservice{$b}[0]) } keys %customservice){ if ($customservice{$key1}[0] eq $customservicegrp{$key}[2]){ if (!grep(/$customservice{$key1}[2]/, @protocols)){ - push (@protocols," ".$customservice{$key1}[2]); - } + push (@protocols,$customservice{$key1}[2]);} } } } @@ -2474,7 +2470,7 @@ END push (@protocols,$Lang::tr{'all'}); } - my $protz=join(",",@protocols); + my $protz=join(", ",@protocols); if($protz eq 'ICMP' && $$hash{$key}[9] ne 'All ICMP-Types' && $$hash{$key}[14] ne 'cust_srvgrp'){ &General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes); foreach my $keyicmp (sort { ncmp($icmptypes{$a}[0],$icmptypes{$b}[0]) }keys %icmptypes){ @@ -2483,6 +2479,8 @@ END last; } } + }elsif($#protocols gt '3'){ + print"$Lang::tr{'fwdfw many'}"; }else{ print"$protz"; } diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index cc567188b6..5e8892d767 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -986,6 +986,7 @@ 'fwdfw log' => 'Log', 'fwdfw log rule' => 'Logging aktivieren', 'fwdfw man port' => 'Port(s):', +'fwdfw many' => 'Diverse', 'fwdfw menu' => 'Firewall', 'fwdfw movedown' => 'Herunter', 'fwdfw moveup' => 'Herauf', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index ff5c90a1dd..db31a89ea2 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1012,6 +1012,7 @@ 'fwdfw log' => 'Log', 'fwdfw log rule' => 'Log rule', 'fwdfw man port' => 'Port(s):', +'fwdfw many' => 'Many', 'fwdfw menu' => 'Firewall', 'fwdfw movedown' => 'Move down', 'fwdfw moveup' => 'Move up', -- 2.39.2