From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4bS6dD3ttYz339D for ; Wed, 25 Jun 2025 16:26:08 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4bS6d86y6gz2xLw for ; Wed, 25 Jun 2025 16:26:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4bS6d653xdz1qf; Wed, 25 Jun 2025 16:26:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1750868763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ga9PhiSwLvne99OCucpRlym9gQaIPQuF2mSPAuOWMVU=; b=0gTyDb8NoUCkM92h6TrZrxpAjMJ+0094vRhGEZLVFEscvFUBl0K1+DRgzwhEMyCx8dUAJg Kelep3/nK1fEpyCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1750868763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ga9PhiSwLvne99OCucpRlym9gQaIPQuF2mSPAuOWMVU=; b=MZkQwqfjTXdIG4+pHY61O39m/YMja4Z22L6l+MSURwpwRbikUn8wgYnnm0Zv2f7fdU84P1 v9WRIXQsaJd8J57T15Wy5cHJwGxfFkCyqRK/PpjsJdZR4ebKqIEjR5mV1ly/7k1wkqM28H wCV0Ofuxafv5BUSJwm6gbt1Uj/L/HFlRrWUVQybize/Y9/saqKUVS9KoGdFSWweHRr9zcA Xv2rWyrMbPVGAGxF3U+dOYJ+3WP+BeLjqkg+/I45YpP435SXEBIWwcr6QwhAdzdnO/+1Af HKYYGVd3C7D0Glh0fA1NU9JT+HCS3yOSIjqPn8zQhZJK6aNXZ2n+tLqDJNyMJg== Message-ID: <4bb586c6-0db4-410b-95c1-170f367b28e8@ipfire.org> Date: Wed, 25 Jun 2025 18:25:57 +0200 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Subject: Re: [PATCH 1/5] fwhosts.cgi: Show in which firewall rule objects are being used To: Michael Tremer , dietzmann@brecht-schule.hamburg References: <20250623171658.530138-1-michael.tremer@ipfire.org> Content-Language: en-GB Cc: "IPFire: Development-List" From: Adolf Belka In-Reply-To: <20250623171658.530138-1-michael.tremer@ipfire.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Tested-by: Adolf Belka I initially tested the whole of the patch set but then I could not figure out where the firewall rule info was to be found. Then I tested out only this first patch on its own and saw the i in a blue circle icon and then when I held my mouse over that for a second or so it showed the info. I like the additional info that has been provided with this. That will be useful to have. I will do a separate feedback to patch 4/5. On 23/06/2025 19:16, Michael Tremer wrote: > From: Peer Dietzmann > > Signed-off-by: Michael Tremer > --- > doc/language_issues.en | 1 + > doc/language_issues.es | 1 + > doc/language_issues.fr | 1 + > doc/language_issues.it | 1 + > doc/language_issues.nl | 1 + > doc/language_issues.pl | 1 + > doc/language_issues.ru | 1 + > doc/language_issues.tr | 1 + > doc/language_missings | 7 + > html/cgi-bin/fwhosts.cgi | 368 +++++++++++++++++++++++++++++++++++++-- > langs/de/cgi-bin/de.pl | 1 + > langs/en/cgi-bin/en.pl | 1 + > 12 files changed, 375 insertions(+), 10 deletions(-) > > diff --git a/doc/language_issues.en b/doc/language_issues.en > index 996572456..7d72fa99b 100644 > --- a/doc/language_issues.en > +++ b/doc/language_issues.en > @@ -78,6 +78,7 @@ WARNING: untranslated string: TOS rule = TOS rule > WARNING: untranslated string: The class number does not match the specified interface. = The class number does not match the specified interface. > WARNING: untranslated string: The destination IP address is invalid. = The destination IP address is invalid. > WARNING: untranslated string: The source IP address is invalid. = The source IP address is invalid. > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: WakeOnLan = Wake On Lan > WARNING: untranslated string: a ca certificate with this name already exists = A CA certificate with this name already exists. > WARNING: untranslated string: a connection with this common name already exists = A connection with this common name already exists. > diff --git a/doc/language_issues.es b/doc/language_issues.es > index 68836302a..e90acf9d9 100644 > --- a/doc/language_issues.es > +++ b/doc/language_issues.es > @@ -980,6 +980,7 @@ WARNING: translation string unused: zoneconf val vlan tag range error > WARNING: translation string unused: zoneconf val zoneslave amount error > WARNING: untranslated string: Captive ACTIVATE = unknown string > WARNING: untranslated string: Captive clients = unknown string > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: ca name must only contain characters and spaces = unknown string > WARNING: untranslated string: dns servers = DNS Servers > WARNING: untranslated string: enable disable client = unknown string > diff --git a/doc/language_issues.fr b/doc/language_issues.fr > index 80341a1c3..db91be7fe 100644 > --- a/doc/language_issues.fr > +++ b/doc/language_issues.fr > @@ -959,6 +959,7 @@ WARNING: translation string unused: zoneconf val vlan amount assignment error > WARNING: translation string unused: zoneconf val vlan tag assignment error > WARNING: translation string unused: zoneconf val vlan tag range error > WARNING: translation string unused: zoneconf val zoneslave amount error > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: allowed subnets = Allowed Subnets > WARNING: untranslated string: bypassed = Bypassed > WARNING: untranslated string: ca name must only contain characters and spaces = unknown string > diff --git a/doc/language_issues.it b/doc/language_issues.it > index 4ec3545ba..facb0c256 100644 > --- a/doc/language_issues.it > +++ b/doc/language_issues.it > @@ -932,6 +932,7 @@ WARNING: untranslated string: Captive vouchervalid = Allowed time for this coupo > WARNING: untranslated string: Captive wrong type = Uploaded file has wrong filetype > WARNING: untranslated string: MTU settings = MTU settings: > WARNING: untranslated string: Number of Countries for the pie chart = Number of Countries for the pie chart > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: access point name = Access Point Name > WARNING: untranslated string: access point name is invalid = Access Point Name is invalid > WARNING: untranslated string: access point name is required = Access Point Name is required > diff --git a/doc/language_issues.nl b/doc/language_issues.nl > index 56c6dadf6..40710c698 100644 > --- a/doc/language_issues.nl > +++ b/doc/language_issues.nl > @@ -932,6 +932,7 @@ WARNING: untranslated string: Captive vouchervalid = Allowed time for this coupo > WARNING: untranslated string: Captive wrong type = Uploaded file has wrong filetype > WARNING: untranslated string: MTU settings = MTU settings: > WARNING: untranslated string: Number of Countries for the pie chart = Number of Countries for the pie chart > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: access point name = Access Point Name > WARNING: untranslated string: access point name is invalid = Access Point Name is invalid > WARNING: untranslated string: access point name is required = Access Point Name is required > diff --git a/doc/language_issues.pl b/doc/language_issues.pl > index 6ccb0a497..ef464100c 100644 > --- a/doc/language_issues.pl > +++ b/doc/language_issues.pl > @@ -848,6 +848,7 @@ WARNING: untranslated string: MB read = MB read > WARNING: untranslated string: MB written = MB written > WARNING: untranslated string: MTU settings = MTU settings: > WARNING: untranslated string: Number of Countries for the pie chart = Number of Countries for the pie chart > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: access point name = Access Point Name > WARNING: untranslated string: access point name is invalid = Access Point Name is invalid > WARNING: untranslated string: access point name is required = Access Point Name is required > diff --git a/doc/language_issues.ru b/doc/language_issues.ru > index 8a689daa7..d4f669b1b 100644 > --- a/doc/language_issues.ru > +++ b/doc/language_issues.ru > @@ -843,6 +843,7 @@ WARNING: untranslated string: MB read = MB read > WARNING: untranslated string: MB written = MB written > WARNING: untranslated string: MTU settings = MTU settings: > WARNING: untranslated string: Number of Countries for the pie chart = Number of Countries for the pie chart > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: access point name = Access Point Name > WARNING: untranslated string: access point name is invalid = Access Point Name is invalid > WARNING: untranslated string: access point name is required = Access Point Name is required > diff --git a/doc/language_issues.tr b/doc/language_issues.tr > index e79fe1388..f557f9a04 100644 > --- a/doc/language_issues.tr > +++ b/doc/language_issues.tr > @@ -925,6 +925,7 @@ WARNING: translation string unused: year-graph > WARNING: translation string unused: yearly firewallhits > WARNING: untranslated string: Captive clients = unknown string > WARNING: untranslated string: Captive delete logo = Delete Logo > +WARNING: untranslated string: Unused = Unused > WARNING: untranslated string: access point name = Access Point Name > WARNING: untranslated string: access point name is invalid = Access Point Name is invalid > WARNING: untranslated string: access point name is required = Access Point Name is required > diff --git a/doc/language_missings b/doc/language_missings > index cd005f45a..8487c8a26 100644 > --- a/doc/language_missings > +++ b/doc/language_missings > @@ -128,6 +128,7 @@ > < dns servers > < ids provider eol > < online > +< Unused > ############################################################################ > # Checking cgi-bin translations for language: fr # > ############################################################################ > @@ -181,6 +182,7 @@ > < system time > < timeformat > < total > +< Unused > < upload fcdsl.o > < warning > < wg > @@ -720,6 +722,7 @@ > < unblock all > < uncheck all > < unlimited > +< Unused > < update ruleset > < updxlrtr passive mode > < uplink bit rate > @@ -1356,6 +1359,7 @@ > < unblock all > < uncheck all > < unlimited > +< Unused > < update ruleset > < updxlrtr passive mode > < uplink bit rate > @@ -2398,6 +2402,7 @@ > < unblock all > < uncheck all > < unlimited > +< Unused > < update ruleset > < updxlrtr passive mode > < updxlrtr sources > @@ -3486,6 +3491,7 @@ > < unblock all > < uncheck all > < unlimited > +< Unused > < update ruleset > < updxlrtr passive mode > < updxlrtr sources > @@ -3975,6 +3981,7 @@ > < traffic stat title > < transfers > < transport mode does not support vti > +< Unused > < update ruleset > < updxlrtr passive mode > < user management > diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi > index e92ef6853..6b4e22159 100644 > --- a/html/cgi-bin/fwhosts.cgi > +++ b/html/cgi-bin/fwhosts.cgi > @@ -1932,7 +1932,7 @@ sub viewtablenet > }else{ > print< > - > + > END > } > my $count=0; > @@ -1952,7 +1952,14 @@ END > } > my $colnet="$customnetwork{$key}[1]/".&General::subtocidr($customnetwork{$key}[2]); > my $netcount=&getnetcount($customnetwork{$key}[0]); > - print""; > + my $netusedin=&getusedin($customnetwork{$key}[0]); > + my $htmlparttouse=""; > + if ($netusedin) { > + $htmlparttouse = ""; > + } else { > + $htmlparttouse = ""; > + } > + print""; > print<
$Lang::tr{'name'}$Lang::tr{'fwhost netaddress'}$Lang::tr{'remark'}$Lang::tr{'used'}
$Lang::tr{'name'}$Lang::tr{'fwhost netaddress'}$Lang::tr{'remark'}$Lang::tr{'used'}
$customnetwork{$key}[0]
".&getcolor($colnet)."$customnetwork{$key}[3]$netcount x$customnetwork{$key}[0]".&getcolor($colnet)."$customnetwork{$key}[3]$netcount x$htmlparttouse > > @@ -2086,7 +2093,7 @@ sub viewtablehost > }else{ > print< > - > + > END > } > my $count=0; > @@ -2106,7 +2113,14 @@ END > $customhost{$key}[4]=~s/\s+//g; > my $hostcount=0; > $hostcount=&gethostcount($customhost{$key}[0]); > - print""; > + my $hostusedin=&getusedin($customhost{$key}[0]); > + my $htmlparttouse=""; > + if ($hostusedin) { > + $htmlparttouse = ""; > + } else { > + $htmlparttouse = ""; > + } > + print""; > print<
$Lang::tr{'name'}$Lang::tr{'fwhost ip_mac'}$Lang::tr{'remark'}$Lang::tr{'used'}
$Lang::tr{'name'}$Lang::tr{'fwhost ip_mac'}$Lang::tr{'remark'}$Lang::tr{'used'}
$customhost{$key}[0]".&getcolor($ip)."$customhost{$key}[3]$hostcount x$customhost{$key}[0]".&getcolor($ip)."$customhost{$key}[3]$hostcount x$htmlparttouse > > @@ -2182,7 +2196,13 @@ sub viewtablegrp > print "
$grpname   "; > print " $Lang::tr{'remark'}:  $remark   " if ($remark ne ''); > my $netgrpcount=&getnetcount($grpname); > - print "$Lang::tr{'used'}: $netgrpcount x"; > + print "$Lang::tr{'used'}: $netgrpcount x "; > + my $groupusedin=&getusedin($grpname); > + if ($groupusedin) { > + print ""; > + } else { > + print ""; > + } > if($netgrpcount == '0') > { > print""; > @@ -2320,8 +2340,13 @@ sub viewtablelocationgrp > > # Get group count. > my $locationgrpcount=&getlocationcount($grpname); > - print "$Lang::tr{'used'}: $locationgrpcount x"; > - > + my $locationusedin=&getlocusedin($grpname); > + print "$Lang::tr{'used'}: $locationgrpcount x "; > + if ($locationusedin) { > + print ""; > + } else { > + print ""; > + } > # Only display delete icon, if the group is not used by a firewall rule. > if($locationgrpcount == '0') { > print"
\n"; > @@ -2442,7 +2467,7 @@ sub viewtableservice > &General::readhasharray("$fwconfigout", \%fwout); > print< > - > + > END > my $col=''; > foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0])} keys %customservice) > @@ -2463,10 +2488,17 @@ END > END > #Neuer count > $srvcount=&getsrvcount($customservice{$key}[0]); > + my $serviceusedin=&getsrvusedin($customservice{$key}[0]); > + my $htmlparttouse=""; > + if ($serviceusedin) { > + $htmlparttouse=""; > + } else { > + $htmlparttouse=""; > + } > if($customservice{$key}[3] eq 'All ICMP-Types'){print $Lang::tr{'fwdfw all icmp'};} > elsif($customservice{$key}[3] ne 'BLANK'){print $customservice{$key}[3];} > print< - > + >
$Lang::tr{'fwhost srv_name'}$Lang::tr{'fwhost prot'}$Lang::tr{'fwhost port'}ICMP$Lang::tr{'fwhost used'}
$Lang::tr{'fwhost srv_name'}$Lang::tr{'fwhost prot'}$Lang::tr{'fwhost port'}ICMP$Lang::tr{'fwhost used'}
$srvcount x$srvcount x$htmlparttouse > > > @@ -2538,7 +2570,13 @@ sub viewtableservicegrp > if($count >0){print"
";$count=1;} > print "
$grpname    "; > print "$Lang::tr{'remark'}:  $remark " if ($remark ne ''); > - print "  $Lang::tr{'used'}: $grpcount x"; > + print "  $Lang::tr{'used'}: $grpcount x "; > + my $srvgrpusedin=&getsrvusedin($customservicegrp{$key}[0]); > + if ($srvgrpusedin) { > + print ""; > + } else { > + print ""; > + } > if($grpcount == '0') > { > print""; > @@ -2811,6 +2849,106 @@ sub getlocationcount > } > return $counter; > } > +sub getlocusedin > +{ > + my $groupname=shift; > + my $titletext=""; > + > + # Location groups are stored as "group:groupname" in the > + # firewall settings files. > + my $searchstring = join(':', "group",$groupname); > + > + #Count services used in firewall - config > + my $fwfwtext=""; > + # first set title if found > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[4] eq $searchstring){ > + $fwfwtext = "$Lang::tr{'firewall rules'}:"; > + } > + if($fwfwd{$key1}[6] eq $searchstring){ > + $fwfwtext = "$Lang::tr{'firewall rules'}:"; > + } > + } > + # then add rule numbers > + my @fwfwrules = (); > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[4] eq $searchstring){ > + push(@fwfwrules, $key1); > + } > + if($fwfwd{$key1}[6] eq $searchstring){ > + push(@fwfwrules, $key1); > + } > + } > + my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules; > + foreach my $rule (@fwfwarraysorted) > + { > + $fwfwtext .= " - $rule"; > + } > + #Count services used in firewall - input > + my $fwintext=""; > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[4] eq $searchstring){ > + $fwintext = "$Lang::tr{'incoming firewall access'}:"; > + } > + if($fwinp{$key2}[6] eq $searchstring){ > + $fwintext = "$Lang::tr{'incoming firewall access'}:"; > + } > + } > + my @fwinrules = (); > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[4] eq $searchstring){ > + push(@fwinrules, $key2); > + } > + if($fwinp{$key2}[6] eq $searchstring){ > + push(@fwinrules, $key2); > + } > + } > + my @fwinarraysorted = sort { $a <=> $b } @fwinrules; > + foreach my $rule (@fwinarraysorted) > + { > + $fwintext .= " - $rule"; > + } > + #Count services used in firewall - outgoing > + my $fwouttext=""; > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[4] eq $searchstring){ > + $fwouttext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + if($fwout{$key3}[6] eq $searchstring){ > + $fwouttext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + } > + my @fwoutrules = (); > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[4] eq $searchstring){ > + push(@fwoutrules, $key3); > + } > + if($fwout{$key3}[6] eq $searchstring){ > + push(@fwoutrules, $key3); > + } > + } > + my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules; > + foreach my $rule (@fwoutarraysorted) > + { > + $fwouttext .= " - $rule"; > + } > + if ($fwfwtext) { > + $titletext .= "$fwfwtext" > + } > + if ($fwintext) { > + if ($titletext) { > + $titletext .= " " > + } > + $titletext .= "$fwintext" > + } > + if ($fwouttext) { > + if ($titletext) { > + $titletext .= " " > + } > + $titletext .= "$fwouttext" > + } > + return $titletext; > +} > sub getnetcount > { > my $searchstring=shift; > @@ -2850,6 +2988,122 @@ sub getnetcount > } > return $srvcounter; > } > +sub getusedin > +{ > + my $searchstring=shift; > + my $titletext=""; > + my $groups=(); > + my $rules=(); > + > + #Count services used in Network/Host group > + my $servicegrouptext=""; > + foreach my $key (keys %customgrp) { > + if($customgrp{$key}[2] eq $searchstring){ > + $servicegrouptext = "$Lang::tr{'fwhost cust grp'}:"; > + } > + } > + foreach my $key (keys %customgrp) { > + if($customgrp{$key}[2] eq $searchstring){ > + $servicegrouptext .= " - $customgrp{$key}[0]"; > + } > + } > + #Count services used in firewall - config > + my $fwfwtext=""; > + # first set title if found > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[4] eq $searchstring){ > + $fwfwtext = "$Lang::tr{'firewall rules'}:"; > + } > + if($fwfwd{$key1}[6] eq $searchstring){ > + $fwfwtext = "$Lang::tr{'firewall rules'}:"; > + } > + } > + # then add rule numbers > + my @fwfwrules = (); > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[4] eq $searchstring){ > + push(@fwfwrules, $key1); > + } > + if($fwfwd{$key1}[6] eq $searchstring){ > + push(@fwfwrules, $key1); > + } > + } > + my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules; > + foreach my $rule (@fwfwarraysorted) > + { > + $fwfwtext .= " - $rule"; > + } > + #Count services used in firewall - input > + my $fwintext=""; > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[4] eq $searchstring){ > + $fwintext = "$Lang::tr{'incoming firewall access'}:"; > + } > + if($fwinp{$key2}[6] eq $searchstring){ > + $fwintext = "$Lang::tr{'incoming firewall access'}:"; > + } > + } > + my @fwinrules = (); > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[4] eq $searchstring){ > + push(@fwinrules, $key2); > + } > + if($fwinp{$key2}[6] eq $searchstring){ > + push(@fwinrules, $key2); > + } > + } > + my @fwinarraysorted = sort { $a <=> $b } @fwinrules; > + foreach my $rule (@fwinarraysorted) > + { > + $fwintext .= " - $rule"; > + } > + #Count services used in firewall - outgoing > + my $fwouttext=""; > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[4] eq $searchstring){ > + $fwouttext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + if($fwout{$key3}[6] eq $searchstring){ > + $fwouttext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + } > + my @fwoutrules = (); > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[4] eq $searchstring){ > + push(@fwoutrules, $key3); > + } > + if($fwout{$key3}[6] eq $searchstring){ > + push(@fwoutrules, $key3); > + } > + } > + my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules; > + foreach my $rule (@fwoutarraysorted) > + { > + $fwouttext .= " - $rule"; > + } > + if ($servicegrouptext) { > + $titletext .= "$servicegrouptext" > + } > + if ($fwfwtext) { > + if ($titletext) { > + $titletext .= " " > + } > + $titletext .= "$fwfwtext" > + } > + if ($fwintext) { > + if ($titletext) { > + $titletext .= " " > + } > + $titletext .= "$fwintext" > + } > + if ($fwouttext) { > + if ($titletext) { > + $titletext .= " " > + } > + $titletext .= "$fwouttext" > + } > + return $titletext > +} > sub getsrvcount > { > my $searchstring=shift; > @@ -2880,6 +3134,100 @@ sub getsrvcount > } > return $srvcounter; > } > +sub getsrvusedin > +{ > + my $searchstring=shift; > + my $titletext=""; > + #Count services used in servicegroups > + my $servicegrouptext=""; > + foreach my $key (keys %customservicegrp) { > + if($customservicegrp{$key}[2] eq $searchstring){ > + $servicegrouptext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + } > + foreach my $key (keys %customservicegrp) { > + if($customservicegrp{$key}[2] eq $searchstring){ > + $servicegrouptext .= " - $customservicegrp{$key}[0]"; > + } > + } > + my $fwfwtext=""; > + # first set title if found > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[15] eq $searchstring){ > + $fwfwtext = "$Lang::tr{'firewall rules'}:"; > + } > + } > + # then add rule numbers > + my @fwfwrules = (); > + foreach my $key1 (keys %fwfwd) { > + if($fwfwd{$key1}[15] eq $searchstring){ > + push(@fwfwrules, $key1); > + } > + } > + my @fwfwarraysorted = sort { $a <=> $b } @fwfwrules; > + foreach my $rule (@fwfwarraysorted) > + { > + $fwfwtext .= " - $rule"; > + } > + #Count services used in firewall - input > + my $fwintext=""; > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[15] eq $searchstring){ > + $fwintext = "$Lang::tr{'incoming firewall access'}:"; > + } > + } > + my @fwinrules = (); > + foreach my $key2 (keys %fwinp) { > + if($fwinp{$key2}[15] eq $searchstring){ > + push(@fwinrules, $key2); > + } > + } > + my @fwinarraysorted = sort { $a <=> $b } @fwinrules; > + foreach my $rule (@fwinarraysorted) > + { > + $fwintext .= " - $rule"; > + } > + #Count services used in firewall - outgoing > + my $fwouttext=""; > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[15] eq $searchstring){ > + $fwouttext = "$Lang::tr{'outgoing firewall access'}:"; > + } > + } > + my @fwoutrules = (); > + foreach my $key3 (keys %fwout) { > + if($fwout{$key3}[15] eq $searchstring){ > + push(@fwoutrules, $key3); > + } > + } > + my @fwoutarraysorted = sort { $a <=> $b } @fwoutrules; > + foreach my $rule (@fwoutarraysorted) > + { > + $fwouttext .= " - $rule"; > + } > + if ($servicegrouptext ne '') { > + $titletext .= "$servicegrouptext"; > + } > + if ($fwfwtext ne '') { > + if ($titletext) { > + $titletext .= " "; > + } > + $titletext .= "$fwfwtext"; > + } > + if ($fwintext ne '') { > + if ($titletext) { > + $titletext .= " "; > + } > + $titletext .= "$fwintext"; > + } > + if ($fwouttext) { > + if ($titletext ne '') { > + $titletext .= " "; > + } > + $titletext .= "$fwouttext"; > + } > + return $titletext > +} > sub deletefromgrp > { > my $target=shift; > diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl > index 53d6903ae..130227910 100644 > --- a/langs/de/cgi-bin/de.pl > +++ b/langs/de/cgi-bin/de.pl > @@ -122,6 +122,7 @@ > 'The class number does not match the specified interface.' => 'Die Klassennummer passt nicht zum angegebenen Interface.', > 'The destination IP address is invalid.' => 'Die Ziel-IP-Adresse ist ungültig.', > 'The source IP address is invalid.' => 'Die Quell-IP-Adresse ist ungültig.', > +'Unused' => 'Unbenutzt', > 'Utilization on' => 'Auslastung auf', > 'Verbose' => 'Verbose', > 'WakeOnLan' => 'Wake On LAN', > diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl > index ef7d75ce7..e76ca878c 100644 > --- a/langs/en/cgi-bin/en.pl > +++ b/langs/en/cgi-bin/en.pl > @@ -120,6 +120,7 @@ > 'The class number does not match the specified interface.' => 'The class number does not match the specified interface.', > 'The destination IP address is invalid.' => 'The destination IP address is invalid.', > 'The source IP address is invalid.' => 'The source IP address is invalid.', > +'Unused' => 'Unused', > 'Utilization on' => 'Utilization on', > 'Verbose' => 'Verbose:', > 'WakeOnLan' => 'Wake On Lan',