diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 161464d0d..27e61e9bb 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -1019,7 +1019,7 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) { &IDS::call_suricatactrl("stop"); } } - + # Undefine providers flag. undef($cgiparams{'PROVIDERS'}); @@ -1468,7 +1468,7 @@ print < - + END @@ -1522,7 +1522,7 @@ sub show_customize_ruleset() { print"var hide = \"$Lang::tr{'ids hide'}\"\;\n"; print <\n"; + print"\n"; - # Output display table for rule files + # Output display table for rule files + print "\n"; + + # Loop over each rule file + foreach my $rulefile (sort keys(%idsrules)) { + my $rulechecked = ''; + + # Check if rule file is enabled + if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') { + $rulechecked = 'CHECKED'; + } + + # Convert rulefile name into category name. + my $categoryname = &_rulefile_to_category($rulefile); + + # Table and rows for the rule files. + print"\n"; + print"\n"; + print"\n"; + print"\n"; + print"$rulefile\n"; + print"\n"; + print"$Lang::tr{'ids show'}\n"; + print"\n"; + print"\n"; + + # Rows which will be hidden per default and will contain the single rules. + print"\n"; + print"\n"; + + # Local vars + my $lines; + my $rows; + my $col; + + # New table for the single rules. print "\n"; - # Loop over each rule file - foreach my $rulefile (sort keys(%idsrules)) { - my $rulechecked = ''; - - # Check if rule file is enabled - if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') { - $rulechecked = 'CHECKED'; - } - - # Convert rulefile name into category name. - my $categoryname = &_rulefile_to_category($rulefile); - - # Table and rows for the rule files. - print"\n"; - print"\n"; - print"\n"; - print"\n"; - print"$rulefile\n"; - print"\n"; - print"$Lang::tr{'ids show'}\n"; - print"\n"; - print"\n"; - - # Rows which will be hidden per default and will contain the single rules. - print"\n"; - print"\n"; - + # Loop over rule file rules + foreach my $sid (sort {$a <=> $b} keys(%{$idsrules{$rulefile}})) { # Local vars - my $lines; - my $rows; - my $col; + my $ruledefchecked = ''; - # New table for the single rules. - print "\n"; + # Skip rulefile itself. + next if ($sid eq "Rulefile"); - # Loop over rule file rules - foreach my $sid (sort {$a <=> $b} keys(%{$idsrules{$rulefile}})) { - # Local vars - my $ruledefchecked = ''; + # If 2 rules have been displayed, start a new row + if (($lines % 2) == 0) { + print "\n"; - # Skip rulefile itself. - next if ($sid eq "Rulefile"); - - # If 2 rules have been displayed, start a new row - if (($lines % 2) == 0) { - print "\n"; - - # Increase rows by once. - $rows++; - } - - # Colour lines. - if ($rows % 2) { - $col="bgcolor='$color{'color20'}'"; - } else { - $col="bgcolor='$color{'color22'}'"; - } - - # Set rule state - if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') { - $ruledefchecked = 'CHECKED'; - } - - # Create rule checkbox and display rule description - print "\n"; - print "\n"; - print "\n"; - print "$idsrules{$rulefile}{$sid}{'Description'}"; - - # Increment rule count - $lines++; + # Increase rows by once. + $rows++; } - # If do not have a second rule for row, create empty cell - if (($lines % 2) != 0) { - print ""; + # Colour lines. + if ($rows % 2) { + $col="bgcolor='$color{'color20'}'"; + } else { + $col="bgcolor='$color{'color22'}'"; } - # Close display table - print ""; + # Set rule state + if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') { + $ruledefchecked = 'CHECKED'; + } + + # Create rule checkbox and display rule description + print "\n"; + print "\n"; + print "\n"; + print "$idsrules{$rulefile}{$sid}{'Description'}"; + + # Increment rule count + $lines++; + } + + # If do not have a second rule for row, create empty cell + if (($lines % 2) != 0) { + print ""; } # Close display table - print ""; + print ""; + } - print <"; + + print < @@ -1642,8 +1642,7 @@ END END ; - &Header::closebox(); - } + &Header::closebox(); } # @@ -1905,7 +1904,7 @@ sub show_additional_provider_actions() { - + END ; &Header::closebox();