&IDS::call_suricatactrl("stop");
}
}
-
+
# Undefine providers flag.
undef($cgiparams{'PROVIDERS'});
<br>
<hr>
<br>
-
+
<div align='center'>
<table width='100%'>
END
print"var hide = \"$Lang::tr{'ids hide'}\"\;\n";
print <<END
- // Tiny java script function to show/hide the rules
+ // Tiny javascript function to show/hide the rules
// of a given category.
function showhide(tblname) {
\$("#" + tblname).toggle();
END
;
&Header::openbox('100%', 'LEFT', "$Lang::tr{'intrusion detection system rules'}" );
- print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
-
- # Output display table for rule files
- print "<table width='100%'>\n";
+ print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
- # Loop over each rule file
- foreach my $rulefile (sort keys(%idsrules)) {
- my $rulechecked = '';
+ # Output display table for rule files
+ print "<table width='100%'>\n";
- # 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);
+ # Loop over each rule file
+ foreach my $rulefile (sort keys(%idsrules)) {
+ my $rulechecked = '';
- # Table and rows for the rule files.
- print"<tr>\n";
- print"<td class='base' width='5%'>\n";
- print"<input type='checkbox' name='$rulefile' $rulechecked>\n";
- print"</td>\n";
- print"<td class='base' width='90%'><b>$rulefile</b></td>\n";
- print"<td class='base' width='5%' align='right'>\n";
- print"<a href=\"javascript:showhide('$categoryname')\"><span id='span_$categoryname'>$Lang::tr{'ids show'}</span></a>\n";
- print"</td>\n";
- print"</tr>\n";
+ # Check if rule file is enabled
+ if ($idsrules{$rulefile}{'Rulefile'}{'State'} eq 'on') {
+ $rulechecked = 'CHECKED';
+ }
- # Rows which will be hidden per default and will contain the single rules.
- print"<tr style='display:none' id='$categoryname'>\n";
- print"<td colspan='3'>\n";
+ # Convert rulefile name into category name.
+ my $categoryname = &_rulefile_to_category($rulefile);
+
+ # Table and rows for the rule files.
+ print"<tr>\n";
+ print"<td class='base' width='5%'>\n";
+ print"<input type='checkbox' name='$rulefile' $rulechecked>\n";
+ print"</td>\n";
+ print"<td class='base' width='90%'><b>$rulefile</b></td>\n";
+ print"<td class='base' width='5%' align='right'>\n";
+ print"<a href=\"javascript:showhide('$categoryname')\"><span id='span_$categoryname'>$Lang::tr{'ids show'}</span></a>\n";
+ print"</td>\n";
+ print"</tr>\n";
+
+ # Rows which will be hidden per default and will contain the single rules.
+ print"<tr style='display:none' id='$categoryname'>\n";
+ print"<td colspan='3'>\n";
+
+ # Local vars
+ my $lines;
+ my $rows;
+ my $col;
+
+ # New table for the single rules.
+ print "<table width='100%'>\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 "<table width='100%'>\n";
-
- # Loop over rule file rules
- foreach my $sid (sort {$a <=> $b} keys(%{$idsrules{$rulefile}})) {
- # Local vars
- my $ruledefchecked = '';
-
- # Skip rulefile itself.
- next if ($sid eq "Rulefile");
-
- # If 2 rules have been displayed, start a new row
- if (($lines % 2) == 0) {
- print "</tr><tr>\n";
-
- # Increase rows by once.
- $rows++;
- }
-
- # Colour lines.
- if ($rows % 2) {
- $col="bgcolor='$color{'color20'}'";
- } else {
- $col="bgcolor='$color{'color22'}'";
- }
+ # Skip rulefile itself.
+ next if ($sid eq "Rulefile");
- # Set rule state
- if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') {
- $ruledefchecked = 'CHECKED';
- }
+ # If 2 rules have been displayed, start a new row
+ if (($lines % 2) == 0) {
+ print "</tr><tr>\n";
- # Create rule checkbox and display rule description
- print "<td class='base' width='5%' align='right' $col>\n";
- print "<input type='checkbox' NAME='$sid' $ruledefchecked>\n";
- print "</td>\n";
- print "<td class='base' width='45%' $col>$idsrules{$rulefile}{$sid}{'Description'}</td>";
+ # Increase rows by once.
+ $rows++;
+ }
- # Increment rule count
- $lines++;
+ # Colour lines.
+ if ($rows % 2) {
+ $col="bgcolor='$color{'color20'}'";
+ } else {
+ $col="bgcolor='$color{'color22'}'";
}
- # If do not have a second rule for row, create empty cell
- if (($lines % 2) != 0) {
- print "<td class='base'></td>";
+ # Set rule state
+ if ($idsrules{$rulefile}{$sid}{'State'} eq 'on') {
+ $ruledefchecked = 'CHECKED';
}
- # Close display table
- print "</tr></table></td></tr>";
+ # Create rule checkbox and display rule description
+ print "<td class='base' width='5%' align='right' $col>\n";
+ print "<input type='checkbox' NAME='$sid' $ruledefchecked>\n";
+ print "</td>\n";
+ print "<td class='base' width='45%' $col>$idsrules{$rulefile}{$sid}{'Description'}</td>";
+
+ # Increment rule count
+ $lines++;
+ }
+
+ # If do not have a second rule for row, create empty cell
+ if (($lines % 2) != 0) {
+ print "<td class='base'></td>";
}
# Close display table
- print "</table>";
+ print "</tr></table></td></tr>";
+ }
- print <<END
+ # Close display table
+ print "</table>";
+
+ print <<END
<table width='100%'>
<tr>
<td width='100%' align='right'>
</form>
END
;
- &Header::closebox();
- }
+ &Header::closebox();
}
#
</td>
</tr>
</table>
- </form>
+ </form>
END
;
&Header::closebox();