From: Stefan Schantl Date: Thu, 30 Aug 2018 16:18:26 +0000 (+0200) Subject: ids.cgi: Hide rules config section if no rules a present X-Git-Tag: suricata-beta3~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80bcd4dd1a424e1353aa0839e873ce9292cea3db;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Hide rules config section if no rules a present Do not show the rules config section anymore if there is not ruleset available. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 979dcbcb70..641a88da88 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -625,100 +625,103 @@ END &Header::closebox(); -&Header::openbox('100%', 'LEFT', $Lang::tr{'intrusion detection system rules'}); - print"
\n"; +# Only show the section for configuring the ruleset if one is present. +if (%idsrules) { + &Header::openbox('100%', 'LEFT', $Lang::tr{'intrusion detection system rules'}); - # Output display table for rule files - print "\n"; + print"\n"; - # Local variable required for java script to show/hide - # rules of a rulefile. - my $rulesetcount = 1; + # Output display table for rule files + print "
\n"; - # Loop over each rule file - foreach my $rulefile (sort keys(%idsrules)) { - my $rulechecked = ''; + # Local variable required for java script to show/hide + # rules of a rulefile. + my $rulesetcount = 1; - # Check if rule file is enabled - if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') { - $rulechecked = 'CHECKED'; - } + # Loop over each rule file + foreach my $rulefile (sort keys(%idsrules)) { + my $rulechecked = ''; - # Table and rows for the rule files. - print"\n"; - print"\n"; - print"\n"; - print"\n"; - print"\n"; - - # Rows which will be hidden per default and will contain the single rules. - print"\n"; - print""; - - # Finished whith the rule file, increase count. - $rulesetcount++; - } - - # Close display table - print "
\n"; - print"\n"; - print"$rulefile\n"; - print"SHOW\n"; - print"
"; + print ""; print < @@ -731,7 +734,9 @@ print < END ; -&Header::closebox(); + &Header::closebox(); +} + &Header::closebigbox(); &Header::closepage();