2013-02-05 Miguel de Dios <miguel.dedios@artica.es>

* operation/agentes/estado_monitores.php,
	operation/agentes/datos_agente.php, godmode/setup/setup.php,
	include/functions_config.php: added the can disabled the command
	snapshot.
	
	Fixes: #3602773
	
	MERGED FROM PANDORA_4




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7593 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-05 17:44:21 +00:00
parent 55242bc40f
commit 04a857da4e
5 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2013-02-05 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/estado_monitores.php,
operation/agentes/datos_agente.php, godmode/setup/setup.php,
include/functions_config.php: added the can disabled the command
snapshot.
Fixes: #3602773
MERGED FROM PANDORA_4
2013-02-05 Sergio Martin <sergio.martin@artica.es>
* operation/events/events_list.php

View File

@ -233,6 +233,12 @@ $table->data[30][1] = __('Yes') . '&nbsp;&nbsp;&nbsp;' .
$table->data[30][1] .= __('No') . '&nbsp;&nbsp;&nbsp;' .
html_print_radio_button ('event_storm_protection', 0, '', $config["event_storm_protection"], true);
$table->data[31][0] = __('Command Snapshot') .
ui_print_help_tip(__('The string modules with several lines show as command output'), true);
$table->data[31][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('command_snapshot', 1, '', $config["command_snapshot"], true).'&nbsp;&nbsp;';
$table->data[31][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('command_snapshot', 0, '', $config["command_snapshot"], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo "<fieldset>";

View File

@ -130,6 +130,7 @@ function config_update_config () {
config_update_value ('public_url', get_parameter('public_url'));
config_update_value ('referer_security', get_parameter('referer_security'));
config_update_value ('event_storm_protection', get_parameter('event_storm_protection'));
config_update_value ('command_snapshot', get_parameter('command_snapshot'));
break;
case 'enterprise':
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
@ -868,6 +869,9 @@ function config_process_config () {
if (!isset($config['event_storm_protection'])) {
config_update_value ('event_storm_protection', 0);
}
if (!isset($config['command_snapshot'])) {
config_update_value ('command_snapshot', 1);
/* Finally, check if any value was overwritten in a form */
config_update_config();

View File

@ -237,7 +237,7 @@ foreach ($result as $row) {
$data[] = $attr[1] ($row[$attr[0]]);
// Its a single-data, multiline data (data snapshot) ?
elseif (preg_match ("/[\n]+/i", $row[$attr[0]])){
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Detect string data with \n and convert to <br>'s
$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);

View File

@ -28,10 +28,10 @@ if (is_ajax ()) {
if ($tags === false)
$tags = array();
echo '<h3> Tag\'s information </h3>';
foreach ($tags as $tag) {
echo tags_get_name($tag).'<br>';
echo tags_get_name($tag).'<br>';
}
return;
@ -443,7 +443,7 @@ foreach ($modules as $module) {
// There are carriage returns here ?
// If carriage returns present... then is a "Snapshot" data (full command output)
if (preg_match ("/[\n]+/i", io_safe_output($module["datos"]))){
if (($config['command_snapshot']) && (preg_match ("/[\n]+/i", io_safe_output($module["datos"])))) {
$handle = "snapshot"."_".$module["id_agente_modulo"];
$url = 'include/procesos.php?agente='.$module["id_agente_modulo"];