<?php
/*
** SnortCenter Copyright (C) 2001,2002,2003 Stefan Dens
**
** Author: Stefan Dens <hide@address.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
<?php
include("config.php");
include_once("list.inc.php");
$db = NewACIDDBConnection($DBlib_path, $DBtype);
$db->acidConnect($DB_dbname, $DB_host, $DB_port, $DB_user, $DB_password);
if ($do == 'Deactivate') {
deactivate($spo, 'output', $sensor_id, $db);
}
if ($do == 'Activate') {
activate($spo, 'output', $sensor_id, $db);
}
$rule_act = get_active('output', $sensor_id, $db);
include('top.inc.php');
echo "<TABLE align=center><TR valign=top><TD width=33%>";
echo " ";
echo "</TD><TD width=33%>";
display_scope($sensor_id, $category, $s_pos, 0, $db);
echo "</TD><TD width=33%>";
echo " ";
echo "</TD></TR></TABLE>";
display_list_start($sensor_id, 0);
$result = $db->acidExecute("SELECT id,spo_name,spo_value, snort_default from output ORDER BY snort_default, spo_name");
$count = 0;
while ($myrow = $result->acidFetchRow()) {
list($id, $spo_name, $spo_value, $snort_default) = $myrow;
if ($color != "white") {
$color = "white";
} else {
$color = "#DDDDDD";
}
if ($snort_default == 'yes') $color = '#fffaa8';
echo "<TR border=1 style='border : $color;' bgcolor=$color><TD width=50><INPUT style=\"background-color: $color;\" TYPE=checkbox name=spo[$count] value=\"$id\" id=\"$id\"> ";
if (in_array ("|$id|", $rule_act)) {
echo"<A href=\"sensor_spo.php?spo[$count]=$id&do=Deactivate&sensor_id=$sensor_id\"><img border=0 alt=\"Deactivate\" height=20 src='./images/green.png'></A>";
} else {
echo"<A href=\"sensor_spo.php?spo[$count]=$id&do=Activate&sensor_id=$sensor_id\"><img border=0 alt=\"Activate\" height=20 src='./images/red.png'></A>";
}
echo "</TD><TD><label for='$id'>output $spo_name $spo_value</label></TD></TR>";
$count++;
}
display_list_end(1);
include('bottom.inc.php');
$result->acidFreeRows();
$db->acidClose();
?>