2012-07-26 Miguel de Dios <miguel.dedios@artica.es>
* operation/users/user_edit.php, operation/events/events_validate.php, operation/search_graphs.php, godmode/events/event_filter.php, godmode/events/custom_events.php, godmode/massive/massive_standby_alerts.php, godmode/massive/massive_copy_modules.php, godmode/tag/tag.php, godmode/netflow/nf_report.php, godmode/agentes/configure_field.php, godmode/agentes/agent_manager.php, godmode/agentes/agent_template.php, godmode/agentes/fields_manager.php, godmode/servers/recon_script.php, godmode/servers/plugin.php, include/functions_modules.php: improved the source structure. * operation/search_modules.php: fixed the search when the modules haven't inicialiced. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6814 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
bf7356ecb3
commit
915065cbcb
|
@ -1,3 +1,20 @@
|
|||
2012-07-26 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/users/user_edit.php,
|
||||
operation/events/events_validate.php, operation/search_graphs.php,
|
||||
godmode/events/event_filter.php, godmode/events/custom_events.php,
|
||||
godmode/massive/massive_standby_alerts.php,
|
||||
godmode/massive/massive_copy_modules.php, godmode/tag/tag.php,
|
||||
godmode/netflow/nf_report.php, godmode/agentes/configure_field.php,
|
||||
godmode/agentes/agent_manager.php,
|
||||
godmode/agentes/agent_template.php,
|
||||
godmode/agentes/fields_manager.php,
|
||||
godmode/servers/recon_script.php, godmode/servers/plugin.php,
|
||||
include/functions_modules.php: improved the source structure.
|
||||
|
||||
* operation/search_modules.php: fixed the search when the modules
|
||||
haven't inicialiced.
|
||||
|
||||
2012-07-26 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_html.php: Change the sort function
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
// GNU General Public License for more details.
|
||||
|
||||
if (is_ajax ()) {
|
||||
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
$search_parents = (bool) get_parameter ('search_parents');
|
||||
$search_parents_2 = (bool) get_parameter ('search_parents_2');
|
||||
|
||||
|
@ -48,52 +48,52 @@ if (is_ajax ()) {
|
|||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($search_parents_2) {
|
||||
require_once ('include/functions_agents.php');
|
||||
|
||||
$id_agent = (int) get_parameter ('id_agent');
|
||||
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
|
||||
|
||||
$filter = array ();
|
||||
|
||||
switch ($config['dbtype']){
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
|
||||
break;
|
||||
case "oracle":
|
||||
$filter[] = '(upper(nombre) LIKE upper("%'.$string.'%") OR upper(direccion) LIKE upper("%'.$string.'%") OR upper(comentarios) LIKE upper("%'.$string.'%"))';
|
||||
break;
|
||||
}
|
||||
$filter[] = 'id_agente != '.$id_agent;
|
||||
|
||||
$agents = agents_get_agents ($filter, array ('id_agente', 'nombre', 'direccion'));
|
||||
if ($agents === false)
|
||||
$agents = array();
|
||||
|
||||
$data = array();
|
||||
foreach ($agents as $agent) {
|
||||
$data[] = array('id' => $agent['id_agente'],
|
||||
'name' => io_safe_output($agent['nombre']),
|
||||
'ip' => io_safe_output($agent['direccion']));
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($search_parents_2) {
|
||||
require_once ('include/functions_agents.php');
|
||||
|
||||
$id_agent = (int) get_parameter ('id_agent');
|
||||
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
|
||||
|
||||
$filter = array ();
|
||||
|
||||
switch ($config['dbtype']){
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
|
||||
break;
|
||||
case "oracle":
|
||||
$filter[] = '(upper(nombre) LIKE upper("%'.$string.'%") OR upper(direccion) LIKE upper("%'.$string.'%") OR upper(comentarios) LIKE upper("%'.$string.'%"))';
|
||||
break;
|
||||
}
|
||||
$filter[] = 'id_agente != '.$id_agent;
|
||||
|
||||
$agents = agents_get_agents ($filter, array ('id_agente', 'nombre', 'direccion'));
|
||||
if ($agents === false)
|
||||
$agents = array();
|
||||
|
||||
$data = array();
|
||||
foreach ($agents as $agent) {
|
||||
$data[] = array('id' => $agent['id_agente'],
|
||||
'name' => io_safe_output($agent['nombre']),
|
||||
'ip' => io_safe_output($agent['direccion']));
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$get_modules_json_for_multiple_snmp = (bool) get_parameter("get_modules_json_for_multiple_snmp", 0);
|
||||
if ($get_modules_json_for_multiple_snmp) {
|
||||
require_once ('include/graphs/functions_utils.php');
|
||||
|
||||
|
||||
$idSNMP = get_parameter('id_snmp');
|
||||
|
||||
$id_snmp_serialize = get_parameter('id_snmp_serialize');
|
||||
$snmp = unserialize_in_temp($id_snmp_serialize, false);
|
||||
|
||||
|
||||
$oid_snmp = array();
|
||||
$out = false;
|
||||
foreach($idSNMP as $id) {
|
||||
|
@ -103,24 +103,24 @@ if (is_ajax ()) {
|
|||
if (! preg_match ( "/if/", $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$oid_snmp[$value['oid']] = $key;
|
||||
}
|
||||
|
||||
|
||||
if($out === false){
|
||||
$out = $oid_snmp;
|
||||
}
|
||||
else{
|
||||
$out = array_intersect($out,$oid_snmp);
|
||||
}
|
||||
|
||||
|
||||
$oid_snmp = array();
|
||||
}
|
||||
|
||||
|
||||
echo json_encode($out);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
return;
|
||||
}
|
||||
// Load global vars
|
||||
enterprise_include ('godmode/agentes/agent_manager.php');
|
||||
|
@ -185,8 +185,7 @@ $table->data[0][0] = __('Agent name') .
|
|||
$table->data[0][1] = html_print_input_text ('agente', $nombre_agente, '', 50, 100,true);
|
||||
|
||||
if ($id_agente) {
|
||||
|
||||
$table->data[0][1] .= " <b>".__("ID")."</b> $id_agente ";
|
||||
$table->data[0][1] .= " <b>".__("ID")."</b> $id_agente ";
|
||||
$table->data[0][1] .= ' <a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
$table->data[0][1] .= html_print_image ("images/lupa.png", true, array ("border" => 0, "title" => __('Agent detail')));
|
||||
$table->data[0][1] .= '</a>';
|
||||
|
@ -213,7 +212,7 @@ if ($id_agente) {
|
|||
$table->data[1][1] .= ' ';
|
||||
|
||||
$ip_all = agents_get_addresses ($id_agente);
|
||||
|
||||
|
||||
$table->data[1][1] .= html_print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true);
|
||||
$table->data[1][1] .= " ". html_print_checkbox ("delete_ip", 1, false, true).__('Delete selected');
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@ if (isset ($_POST["template_id"])) {
|
|||
$os_version = $row["os_version"];
|
||||
$agent_version = $row["agent_version"];
|
||||
$disabled= $row["disabled"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,7 +56,7 @@ if (isset ($_POST["template_id"])) {
|
|||
if ($nc === false) {
|
||||
$nc = array ();
|
||||
}
|
||||
foreach ($nc as $row2) {
|
||||
foreach ($nc as $row2) {
|
||||
// Insert each module from tnetwork_component into agent
|
||||
$values = array(
|
||||
'id_agente' => $id_agente,
|
||||
|
@ -142,16 +143,22 @@ echo '</form>';
|
|||
// ==========================
|
||||
// MODULE VISUALIZATION TABLE
|
||||
// ==========================
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$sql = sprintf ("SELECT * FROM tagente_modulo WHERE id_agente = %d AND delete_pending = false ORDER BY id_module_group, nombre", $id_agente);
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = sprintf ("SELECT * FROM tagente_modulo WHERE id_agente = %d AND (delete_pending <> 1 AND delete_pending IS NOT NULL) ORDER BY id_module_group, dbms_lob.substr(nombre,4000,1)", $id_agente);
|
||||
break;
|
||||
}
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$sql = sprintf ("SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d AND delete_pending = false
|
||||
ORDER BY id_module_group, nombre", $id_agente);
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = sprintf ("SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d
|
||||
AND (delete_pending <> 1 AND delete_pending IS NOT NULL)
|
||||
ORDER BY id_module_group, dbms_lob.substr(nombre,4000,1)", $id_agente);
|
||||
break;
|
||||
}
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
if ($result === false) {
|
||||
$result = array ();
|
||||
|
@ -179,7 +186,8 @@ foreach ($result as $row) {
|
|||
$data[0] = '<span style="font-size: 7.2pt">' . $row["nombre"];
|
||||
if ($row["id_tipo_modulo"] > 0) {
|
||||
$data[1] = html_print_image("images/" . modules_show_icon_type ($row["id_tipo_modulo"]), true, array("border" => "0"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[1] = '';
|
||||
}
|
||||
$data[2] = mb_substr ($row["descripcion"], 0, 60);
|
||||
|
@ -194,8 +202,8 @@ foreach ($result as $row) {
|
|||
if (!empty ($table->data)) {
|
||||
html_print_table ($table);
|
||||
unset ($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">No modules</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -34,7 +34,8 @@ if ($id_field) {
|
|||
$name = $field['name'];
|
||||
$display_on_front = $field['display_on_front'];
|
||||
ui_print_page_header (__("Update agent custom field"), "images/note.png", false, "", true, "");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__("Create agent custom field"), "images/note.png", false, "", true, "");
|
||||
}
|
||||
|
||||
|
@ -54,11 +55,12 @@ if ($id_field) {
|
|||
html_print_input_hidden ('update_field', 1);
|
||||
html_print_input_hidden ('id_field', $id_field);
|
||||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('create_field', 1);
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
?>
|
||||
?>
|
|
@ -42,9 +42,11 @@ if ($create_field) {
|
|||
/*Check if name field is empty*/
|
||||
if ($name == ""){
|
||||
echo "<h3 class='error'>".__('The name must not be empty')."</h3>";
|
||||
} else if ($name == db_get_value ('name', 'tagent_custom_fields', 'name', $name)) {
|
||||
}
|
||||
else if ($name == db_get_value ('name', 'tagent_custom_fields', 'name', $name)) {
|
||||
echo "<h3 class='error'>".__('The name must be unique')."</h3>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = db_process_sql_insert('tagent_custom_fields', array('name' => $name, 'display_on_front' => $display_on_front));
|
||||
echo "<h3 class='suc'>".__('Field successfully created')."</h3>";
|
||||
}
|
||||
|
@ -71,7 +73,7 @@ if ($update_field) {
|
|||
}
|
||||
|
||||
/* Delete field */
|
||||
if ($delete_field) {
|
||||
if ($delete_field) {
|
||||
$result = db_process_sql_delete('tagent_custom_fields', array('id_field' => $id_field));
|
||||
|
||||
if (!$result)
|
||||
|
@ -82,7 +84,7 @@ if ($delete_field) {
|
|||
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '98%';
|
||||
if ($fields) {
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Field');
|
||||
|
@ -102,14 +104,14 @@ if($fields === false) $fields = array();
|
|||
foreach ($fields as $field) {
|
||||
|
||||
$data[0] = '<b>'.$field['name'].'</b>';
|
||||
|
||||
|
||||
if($field['display_on_front']) {
|
||||
$data[1] = html_print_image('images/tick.png', true);
|
||||
}
|
||||
else {
|
||||
$data[1] = html_print_image('images/delete.png', true);
|
||||
}
|
||||
|
||||
|
||||
$data[2] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')) . '</a>';
|
||||
$data[2] .= ' <a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "title" => __('Delete'), "border" => '0')) . '</a>';
|
||||
|
||||
|
@ -125,4 +127,4 @@ html_print_submit_button (__('Create field'), 'crt', false, 'class="sub next"');
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
?>
|
|
@ -35,16 +35,18 @@ $fields_selected = explode (',', $config['event_fields']);
|
|||
if ($default != 0) {
|
||||
$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
|
||||
$fields_selected = explode (',', $event_fields);
|
||||
} else if ($update != '') {
|
||||
}
|
||||
else if ($update != '') {
|
||||
$fields_selected = (array)get_parameter('fields_selected');
|
||||
|
||||
if ($fields_selected[0] == '') {
|
||||
$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
|
||||
$fields_selected = explode (',', $event_fields);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$event_fields = implode (',', $fields_selected);
|
||||
}
|
||||
|
||||
|
||||
$values = array(
|
||||
'token' => 'event_fields',
|
||||
'value' => $event_fields
|
||||
|
@ -156,7 +158,7 @@ $table->data[1][0] = '<b>' . __('Fields available').'</b>';
|
|||
$table->data[1][1] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
|
||||
$table->data[1][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
|
||||
$table->data[1][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete fields to select'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
|
||||
|
||||
|
||||
$table->data[1][3] = '<b>' . __('Fields selected') . '</b>';
|
||||
$table->data[1][4] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
|
||||
|
||||
|
@ -164,7 +166,7 @@ echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2
|
|||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button (__('Update'), 'upd_button', false, 'class="sub upd"');
|
||||
html_print_submit_button (__('Update'), 'upd_button', false, 'class="sub upd"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
@ -181,9 +183,9 @@ $(document).ready (function () {
|
|||
$("select[name='fields_selected[]']").append($("<option></option>").html(field_name).attr("value", id_field));
|
||||
$("#fields_available").find("option[value='" + id_field + "']").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#left").click (function () {
|
||||
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
|
||||
field_name = $(value).html();
|
||||
|
@ -192,15 +194,13 @@ $(document).ready (function () {
|
|||
$("select[name='fields_available[]']").append($("<option></option>").val(field_name).html('<i>' + id_field + '</i>'));
|
||||
$("#fields_selected").find("option[value='" + id_field + "']").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit-upd_button").click(function () {
|
||||
$('#fields_selected option').map(function(){
|
||||
$('#fields_selected option').map(function() {
|
||||
$(this).attr('selected','selected');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
|
@ -58,17 +58,18 @@ if ($delete){
|
|||
else {
|
||||
$result = db_process_sql_delete ('tevent_filter', array ('id_filter' => $id));
|
||||
}
|
||||
|
||||
|
||||
if ($result !== false) {
|
||||
$result = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting data'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($multiple_delete) {
|
||||
|
@ -79,7 +80,7 @@ if ($multiple_delete) {
|
|||
foreach ($ids as $id) {
|
||||
$result = db_process_sql_delete ('tevent_filter',
|
||||
array ('id_filter' => $id));
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
db_process_sql_rollback();
|
||||
break;
|
||||
|
@ -92,7 +93,7 @@ if ($multiple_delete) {
|
|||
|
||||
if ($result !== false) $result = true;
|
||||
else $result = false;
|
||||
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting data'));
|
||||
|
@ -185,4 +186,4 @@ function check_all_checkboxes() {
|
|||
$(".check_delete").attr('checked', false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
|
@ -265,7 +265,8 @@ $(document).ready (function () {
|
|||
module_alerts = Array ();
|
||||
if (! data) {
|
||||
no_alerts = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
jQuery.each (data, function (i, val) {
|
||||
module_name = $("<em></em>").append (val["module_name"]);
|
||||
option = $("<option></option>")
|
||||
|
@ -287,12 +288,14 @@ $(document).ready (function () {
|
|||
|
||||
$("span.without_modules, span.without_alerts").show ();
|
||||
$("span.with_modules, span.with_alerts, #target_table-operations").hide ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (no_modules) {
|
||||
$("span.without_modules").show ();
|
||||
$("span.with_modules").hide ();
|
||||
$("#checkbox-copy_modules").uncheck ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("span.without_modules").hide ();
|
||||
$("span.with_modules").show ();
|
||||
$("#checkbox-copy_modules").check ();
|
||||
|
@ -302,7 +305,8 @@ $(document).ready (function () {
|
|||
$("span.without_alerts").show ();
|
||||
$("span.with_alerts").hide ();
|
||||
$("#checkbox-copy_alerts").uncheck ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("span.without_alerts").hide ();
|
||||
$("span.with_alerts").show ();
|
||||
$("#checkbox-copy_alerts").check ();
|
||||
|
@ -357,4 +361,4 @@ $(document).ready (function () {
|
|||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -207,7 +207,8 @@ $(document).ready (function () {
|
|||
if (this.value != 0) {
|
||||
$("#id_not_standby_alerts").enable ();
|
||||
$("#id_standby_alerts").enable ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#id_group, #id_not_standby_alerts").disable ();
|
||||
$("#id_group, #id_standby_alerts").disable ();
|
||||
}
|
||||
|
|
|
@ -41,10 +41,10 @@ $id = (int) get_parameter ('id');
|
|||
if ($delete) {
|
||||
$result = db_process_sql_delete ('tnetflow_report',
|
||||
array ('id_report' => $id));
|
||||
|
||||
|
||||
if ($result !== false) $result = true;
|
||||
else $result = false;
|
||||
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting data'));
|
||||
|
@ -59,7 +59,7 @@ if ($multiple_delete) {
|
|||
foreach ($ids as $id) {
|
||||
$result = db_process_sql_delete ('tnetflow_report',
|
||||
array ('id_report' => $id));
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
db_process_sql_rollback();
|
||||
break;
|
||||
|
@ -72,7 +72,7 @@ if ($multiple_delete) {
|
|||
|
||||
if ($result !== false) $result = true;
|
||||
else $result = false;
|
||||
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting data'));
|
||||
|
@ -92,7 +92,7 @@ $sql = "SELECT * FROM tnetflow_report WHERE id_group IN (".implode(',',$groups_i
|
|||
$reports = db_get_all_rows_sql($sql);
|
||||
if ($reports === false)
|
||||
$reports = array();
|
||||
|
||||
|
||||
$table->width = '98%';
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Report name');
|
||||
|
@ -100,7 +100,7 @@ $table->head[1] = __('Description');
|
|||
$table->head[2] = __('Group');
|
||||
$table->head[3] = __('Action') .
|
||||
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
|
||||
|
||||
|
||||
$table->style = array ();
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->align = array ();
|
||||
|
@ -118,8 +118,7 @@ $total_reports = $total_reports[0]['total'];
|
|||
|
||||
//ui_pagination ($total_reports, $url);
|
||||
|
||||
foreach ($reports as $report) {
|
||||
|
||||
foreach ($reports as $report) {
|
||||
$data = array ();
|
||||
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_report_form&id='.$report['id_report'].'">'.$report['id_name'].'</a>';
|
||||
|
||||
|
@ -138,7 +137,7 @@ $total_reports = $total_reports[0]['total'];
|
|||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
if(isset($data)) {
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=netf&sec2=godmode/netflow/nf_report'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
|
@ -146,7 +145,8 @@ if(isset($data)) {
|
|||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>".__('There are no defined reports')."</div>";
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,6 @@ echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_rep
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function check_all_checkboxes() {
|
||||
if ($("input[name=all_delete]").attr('checked')) {
|
||||
$(".check_delete").attr('checked', true);
|
||||
|
@ -168,5 +167,4 @@ function check_all_checkboxes() {
|
|||
$(".check_delete").attr('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
|
@ -41,7 +41,7 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
$view = get_parameter ("view", "");
|
||||
$create = get_parameter ("create", "");
|
||||
|
||||
if ($view != ""){
|
||||
if ($view != "") {
|
||||
$form_id = $view;
|
||||
$plugin = db_get_row ("tplugin", "id", $form_id);
|
||||
$form_name = $plugin["name"];
|
||||
|
@ -54,7 +54,7 @@ if ($view != ""){
|
|||
$form_pass_opt = $plugin ["pass_opt"];
|
||||
$form_plugin_type = $plugin ["plugin_type"];
|
||||
}
|
||||
if ($create != ""){
|
||||
if ($create != "") {
|
||||
$form_name = "";
|
||||
$form_description = "";
|
||||
$form_max_timeout = "";
|
||||
|
@ -69,7 +69,7 @@ if ($create != ""){
|
|||
// SHOW THE FORM
|
||||
// =================================================================
|
||||
|
||||
if (($create != "") OR ($view != "")){
|
||||
if (($create != "") OR ($view != "")) {
|
||||
|
||||
if ($create != "")
|
||||
ui_print_page_header (__('Plugin creation') . ui_print_help_icon("plugin_definition", true), "", false, "", true);
|
||||
|
@ -77,70 +77,72 @@ if (($create != "") OR ($view != "")){
|
|||
ui_print_page_header (__('Plugin update') . ui_print_help_icon("plugin_definition", true), "", false, "", true);
|
||||
$plugin_id = get_parameter ("view","");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($create == "")
|
||||
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&update_plugin=$plugin_id'>";
|
||||
else
|
||||
echo "<form name=plugin method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&create_plugin=1'>";
|
||||
|
||||
|
||||
echo '<table width="98%" cellspacing="4" cellpadding="4" class="databox_color">';
|
||||
|
||||
echo '<tr><td class="datos">'.__('Name');
|
||||
echo '<tr><td class="datos">'.__('Name') . '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_name" size=100 value="'.$form_name.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Plugin command');
|
||||
echo '<tr><td class="datos2">'.__('Plugin command') . '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_execute" size=45 value="'.$form_execute.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Plugin type');
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Plugin type') . '</td>';
|
||||
echo '<td class="datos2">';
|
||||
$fields[0]= __("Standard");
|
||||
$fields[1]= __("Nagios");
|
||||
html_print_select ($fields, "form_plugin_type", $form_plugin_type);
|
||||
|
||||
echo '<tr><td class="datos">'.__('Max. timeout');
|
||||
echo '<tr><td class="datos">'.__('Max. timeout') . '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_max_timeout" size=5 value="'.$form_max_timeout.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('IP address option');
|
||||
|
||||
echo '<tr><td class="datos2">'.__('IP address option') . '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_net_dst_opt" size=15 value="'.$form_net_dst_opt.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.__('Port option');
|
||||
|
||||
echo '<tr><td class="datos">'.__('Port option') . '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_net_port_opt" size=5 value="'.$form_net_port_opt.'"></td>';
|
||||
|
||||
|
||||
echo '<tr><td class="datos2">'.__('User option');
|
||||
|
||||
|
||||
echo '<tr><td class="datos2">'.__('User option') . '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_user_opt" size=15 value="'.$form_user_opt.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos">'.__('Password option');
|
||||
|
||||
echo '<tr><td class="datos">'.__('Password option') . '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_pass_opt" size=15 value="'.$form_pass_opt.'"></td>';
|
||||
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Description').'</td>';
|
||||
echo '<td class="datos2"><textarea name="form_description" cols="50" rows="4">';
|
||||
echo $form_description;
|
||||
echo '</textarea></td></tr>';
|
||||
|
||||
|
||||
echo '</table>';
|
||||
echo '<table width="98%">';
|
||||
echo '<tr><td align="right">';
|
||||
|
||||
if ($create != ""){
|
||||
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
|
||||
} else {
|
||||
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('Update')."'>";
|
||||
echo "<input name='crtbutton' type='submit' class='sub wand' value='" .
|
||||
__('Create') . "'>";
|
||||
}
|
||||
else {
|
||||
echo "<input name='uptbutton' type='submit' class='sub upd' value='" .
|
||||
__('Update') . "'>";
|
||||
}
|
||||
echo '</form></table>';
|
||||
}
|
||||
|
||||
else {
|
||||
ui_print_page_header (__('Plugins registered in Pandora FMS'), "", false, "", true);
|
||||
|
||||
|
||||
// Update plugin
|
||||
if (isset($_GET["update_plugin"])){ // if modified any parameter
|
||||
$plugin_id = get_parameter ("update_plugin", 0);
|
||||
|
|
|
@ -18,7 +18,8 @@ if (is_ajax ()) {
|
|||
$get_reconscript_description = get_parameter('get_reconscript_description');
|
||||
$id_reconscript = get_parameter('id_reconscript');
|
||||
|
||||
$description = db_get_value_filter('description', 'trecon_script', array('id_recon_script' => $id_reconscript));
|
||||
$description = db_get_value_filter('description', 'trecon_script',
|
||||
array('id_recon_script' => $id_reconscript));
|
||||
|
||||
echo htmlentities (io_safe_output($description), ENT_QUOTES, "UTF-8", true);
|
||||
return;
|
||||
|
@ -38,21 +39,21 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
|
||||
if (!check_refererer()) {
|
||||
require ("general/noaccess.php");
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$view = get_parameter ("view", "");
|
||||
$create = get_parameter ("create", "");
|
||||
|
||||
if ($view != ""){
|
||||
if ($view != "") {
|
||||
$form_id = $view;
|
||||
$reconscript = db_get_row ("trecon_script", "id_recon_script", $form_id);
|
||||
$form_name = $reconscript["name"];
|
||||
$form_description = $reconscript["description"];
|
||||
$form_script = $reconscript ["script"];
|
||||
}
|
||||
if ($create != ""){
|
||||
if ($create != "") {
|
||||
$form_name = "";
|
||||
$form_description = "";
|
||||
$form_script = "";
|
||||
|
@ -64,33 +65,35 @@ if ($create != ""){
|
|||
if (($create != "") OR ($view != "")){
|
||||
|
||||
if ($create != "")
|
||||
ui_print_page_header (__('Recon script creation') . ui_print_help_icon("reconscript_definition", true), "", false, "", true);
|
||||
ui_print_page_header (__('Recon script creation') .
|
||||
ui_print_help_icon("reconscript_definition", true), "", false, "", true);
|
||||
else {
|
||||
ui_print_page_header (__('Recon script update') . ui_print_help_icon("reconscript_definition", true), "", false, "", true);
|
||||
ui_print_page_header (__('Recon script update') .
|
||||
ui_print_help_icon("reconscript_definition", true), "", false, "", true);
|
||||
$id_recon_script = get_parameter ("view","");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($create == "")
|
||||
echo "<form name=reconscript method='post' action='index.php?sec=gservers&sec2=godmode/servers/recon_script&update_reconscript=$id_recon_script'>";
|
||||
else
|
||||
echo "<form name=reconscript method='post' action='index.php?sec=gservers&sec2=godmode/servers/recon_script&create_reconscript=1'>";
|
||||
|
||||
|
||||
echo '<table width="98%" cellspacing="4" cellpadding="4" class="databox_color">';
|
||||
|
||||
echo '<tr><td class="datos">'.__('Name');
|
||||
echo '<tr><td class="datos">' . __('Name') . '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="form_name" size=30 value="'.$form_name.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Script fullpath');
|
||||
echo '<tr><td class="datos2">' . __('Script fullpath') . '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="form_script" size=70 value="'.$form_script.'"></td>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Description').'</td>';
|
||||
|
||||
echo '<tr><td class="datos2">' . __('Description') . '</td>';
|
||||
echo '<td class="datos2"><textarea name="form_description" cols="50" rows="4">';
|
||||
echo $form_description;
|
||||
echo '</textarea></td></tr>';
|
||||
|
||||
|
||||
echo '</table>';
|
||||
echo '<table width=98%>';
|
||||
echo '<tr><td align="right">';
|
||||
|
@ -111,7 +114,7 @@ else {
|
|||
$id_recon_script = get_parameter ("update_reconscript", 0);
|
||||
$reconscript_name = get_parameter ("form_name", "");
|
||||
$reconscript_description = get_parameter ("form_description", "");
|
||||
$reconscript_script = get_parameter ("form_script", "");
|
||||
$reconscript_script = get_parameter ("form_script", "");
|
||||
|
||||
$sql_update ="UPDATE trecon_script SET
|
||||
name = '$reconscript_name',
|
||||
|
@ -122,14 +125,15 @@ else {
|
|||
if ($reconscript_name != '' && $reconscript_script != '')
|
||||
$result = db_process_sql ($sql_update);
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>".__('Problem updating')."</h3>";
|
||||
} else {
|
||||
echo "<h3 class='suc'>".__('Updated successfully')."</h3>";
|
||||
echo "<h3 class='error'>" . __('Problem updating') . "</h3>";
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='suc'>" . __('Updated successfully') . "</h3>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create reconscript
|
||||
if (isset($_GET["create_reconscript"])) {
|
||||
if (isset($_GET["create_reconscript"])) {
|
||||
$reconscript_name = get_parameter ("form_name", "");
|
||||
$reconscript_description = get_parameter ("form_description", "");
|
||||
$reconscript_script = get_parameter ("form_script", "");
|
||||
|
@ -141,48 +145,48 @@ else {
|
|||
$result = false;
|
||||
if ($values['name'] != '' && $values['script'] != '')
|
||||
$result = db_process_sql_insert('trecon_script', $values);
|
||||
if (! $result){
|
||||
echo "<h3 class='error'>".__('Problem creating')."</h3>";
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>" . __('Problem creating') . "</h3>";
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='suc'>".__('Created successfully')."</h3>";
|
||||
echo "<h3 class='suc'>" . __('Created successfully') . "</h3>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["kill_reconscript"])){ // if delete alert
|
||||
|
||||
if (isset($_GET["kill_reconscript"])) { // if delete alert
|
||||
$reconscript_id = get_parameter ("kill_reconscript", 0);
|
||||
|
||||
$result = db_process_sql_delete('trecon_script',
|
||||
array('id_recon_script' => $reconscript_id));
|
||||
|
||||
if (! $result){
|
||||
echo "<h3 class='error'>".__('Problem deleting reconscript')."</h3>";
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>" . __('Problem deleting reconscript') . "</h3>";
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='suc'>".__('reconscript deleted successfully')."</h3>";
|
||||
echo "<h3 class='suc'>" . __('reconscript deleted successfully') . "</h3>";
|
||||
}
|
||||
if ($reconscript_id != 0){
|
||||
$result = db_process_sql_delete('trecon_task',
|
||||
array('id_recon_script' => $reconscript_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If not edition or insert, then list available reconscripts
|
||||
|
||||
$rows = db_get_all_rows_in_table('trecon_script');
|
||||
|
||||
if ($rows !== false) {
|
||||
echo '<table width="98%" cellspacing="4" cellpadding="4" class="databox">';
|
||||
echo "<th>".__('Name')."</th>";
|
||||
echo "<th>".__('Command')."</th>";
|
||||
echo "<th>".__('Description')."</th>";
|
||||
echo "<th>".__('Delete')."</th>";
|
||||
echo "<th>" . __('Name') . "</th>";
|
||||
echo "<th>" . __('Command') . "</th>";
|
||||
echo "<th>" . __('Description') . "</th>";
|
||||
echo "<th>" . __('Delete') . "</th>";
|
||||
$color = 0;
|
||||
foreach ($rows as $row) {
|
||||
if ($color == 1){
|
||||
if ($color == 1) {
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
|
@ -203,7 +207,8 @@ else {
|
|||
echo "</table>";
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">'. __('There are no recon scripts in the system') . '</div>';
|
||||
echo '<div class="nf">'.
|
||||
__('There are no recon scripts in the system') . '</div>';
|
||||
echo "<br>";
|
||||
}
|
||||
echo "<table width=98%>";
|
||||
|
@ -212,5 +217,4 @@ else {
|
|||
echo "<input name='crtbutton' type='submit' class='sub next' value='".__('Add')."'>";
|
||||
echo "</td></tr></table>";
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -72,11 +72,12 @@ ui_print_page_header (__('Tags configuration'), "images/setup.png", false, "", t
|
|||
// Delete action: This will delete a tag
|
||||
if ($delete != 0) {
|
||||
$return_delete = tags_delete_tag ($delete);
|
||||
|
||||
|
||||
if ($return_delete === false) {
|
||||
db_pandora_audit("Tag management", "Fail try to delete tag #$delete");
|
||||
echo '<h3 class="error">'.__('Error deleting tag').'</h3>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("Tag management", "Delete tag #$delete");
|
||||
echo '<h3 class="suc">'.__('Successfully deleted tag').'</h3>';
|
||||
}
|
||||
|
@ -94,7 +95,7 @@ $result = false;
|
|||
if ($search != 0) {
|
||||
$result = tags_search_tag($tag_name, $filter);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$result = tags_search_tag(false, $filter);
|
||||
}
|
||||
|
||||
|
@ -103,6 +104,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
|
|||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo '<b>' . __("Name") . "/" . __("Description") . '</b>';
|
||||
echo "</td>";
|
||||
echo "<td align=center>";
|
||||
echo '<form method=post action="index.php?sec=gmodules&sec2=godmode/tag/tag&delete_tag=0">';
|
||||
html_print_input_hidden ("search_tag", "1");
|
||||
|
@ -110,11 +112,14 @@ echo "<td align=center>";
|
|||
echo " ";
|
||||
html_print_submit_button (__('Filter'), 'filter_button', false, 'class="sub search"');
|
||||
echo "</form>";
|
||||
echo "</td>";
|
||||
echo "<td align=right>";
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=new">';
|
||||
html_print_input_hidden ("create_tag", "1", true);
|
||||
html_print_submit_button (__('Create tag'), 'create_button', false, 'class="sub next"');
|
||||
echo "</form>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
// Prepare pagination
|
||||
|
@ -124,7 +129,7 @@ ui_pagination ($total_tags, $url);
|
|||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
|
||||
if (!empty($result)){
|
||||
if (!empty($result)) {
|
||||
|
||||
$table->width = '98%';
|
||||
$table->data = array ();
|
||||
|
@ -187,4 +192,4 @@ ui_require_jquery_file ('cluetip');
|
|||
return false;
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -1128,14 +1128,14 @@ function modules_get_previous_data ($id_agent_module, $utimestamp = 0, $string =
|
|||
function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0) {
|
||||
if (empty ($utimestamp))
|
||||
$utimestamp = time ();
|
||||
|
||||
|
||||
if ($string == 1) {
|
||||
$table = 'tagente_datos_string';
|
||||
}
|
||||
else {
|
||||
$table = 'tagente_datos';
|
||||
}
|
||||
|
||||
|
||||
$interval = modules_get_interval ($id_agent_module);
|
||||
$sql = sprintf ('SELECT *
|
||||
FROM tagente_datos
|
||||
|
@ -1144,7 +1144,7 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0)
|
|||
AND utimestamp >= %d
|
||||
ORDER BY utimestamp ASC',
|
||||
$id_agent_module, $utimestamp + $interval, $utimestamp);
|
||||
|
||||
|
||||
return db_get_row_sql ($sql, true);
|
||||
}
|
||||
|
||||
|
@ -1161,32 +1161,32 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) {
|
|||
if ($date < 1) {
|
||||
$date = get_system_time ();
|
||||
}
|
||||
|
||||
|
||||
$datelimit = $date - $period;
|
||||
|
||||
|
||||
$sql = sprintf ("SELECT datos AS data, utimestamp
|
||||
FROM tagente_datos
|
||||
WHERE id_agente_modulo = %d
|
||||
AND utimestamp > %d AND utimestamp <= %d
|
||||
ORDER BY utimestamp ASC",
|
||||
$id_agent_module, $datelimit, $date);
|
||||
|
||||
|
||||
$values = db_get_all_rows_sql ($sql, true, false);
|
||||
|
||||
|
||||
if ($values === false) {
|
||||
return array ();
|
||||
}
|
||||
|
||||
|
||||
$module_name = modules_get_agentmodule_name ($id_agent_module);
|
||||
$agent_id = modules_get_agentmodule_agent ($id_agent_module);
|
||||
$agent_name = modules_get_agentmodule_agent_name ($id_agent_module);
|
||||
|
||||
|
||||
foreach ($values as $key => $data) {
|
||||
$values[$key]["module_name"] = $module_name;
|
||||
$values[$key]["agent_id"] = $agent_id;
|
||||
$values[$key]["agent_name"] = $agent_name;
|
||||
}
|
||||
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,8 @@ $string .= '<td align="left" width="200px">';
|
|||
$string .= '<div style="text-align:center;">';
|
||||
if ($event["estado"] == 0 ) {
|
||||
$string .= html_print_select(array('1' => __('Validate'), '2' => __('Set in process'), '3' => __('Add comment')), 'select_validate', '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
||||
} else if ($event["estado"] == 2 ) {
|
||||
}
|
||||
else if ($event["estado"] == 2 ) {
|
||||
$string .= html_print_select(array('1' => __('Validate'), '3' => __('Add comment')), 'select_validate', '', '', '', 0, true, false, false, 'select_validate').'<br><br>';
|
||||
}
|
||||
|
||||
|
|
|
@ -25,15 +25,16 @@ $graphs = false;
|
|||
if ($searchGraphs) {
|
||||
//Check ACL
|
||||
$usergraphs = custom_graphs_get_user($config['id_user'], true);
|
||||
|
||||
|
||||
$usergraphs_id = array_keys($usergraphs);
|
||||
|
||||
if(!$usergraphs_id){
|
||||
$graphs_condition = " AND 1<>1";
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
$graphs_condition = " AND id_graph IN (".implode(',',$usergraphs_id).")";
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT id_graph, name, description
|
||||
FROM tgraph
|
||||
WHERE (name LIKE '%" . $stringSearchSQL . "%' OR description LIKE '%" . $stringSearchSQL . "%')".$graphs_condition ."
|
||||
|
@ -50,7 +51,7 @@ if ($searchGraphs) {
|
|||
}
|
||||
|
||||
if ($graphs === false) {
|
||||
echo "<br><div class='nf'>" . __("Zero results found") . "</div>\n";
|
||||
echo "<br><div class='nf'>" . __("Zero results found") . "</div>\n";
|
||||
}
|
||||
else {
|
||||
$table->cellpadding = 4;
|
||||
|
|
|
@ -147,7 +147,7 @@ if ($searchModules) {
|
|||
}
|
||||
|
||||
if (!$modules) {
|
||||
echo "<br><div class='nf'>" . __("Zero results found") . "</div>\n";
|
||||
echo "<br><div class='nf'>" . __("Zero results found") . "</div>\n";
|
||||
}
|
||||
else {
|
||||
$totalModules = db_get_all_rows_sql("SELECT COUNT(t1.id_agente_modulo) AS count_modules " . $chunk_sql);
|
||||
|
@ -202,7 +202,11 @@ else {
|
|||
|
||||
$intervalCell = modules_get_interval ($module['id_agente_modulo']);
|
||||
|
||||
if($module['utimestamp'] == 0 && (($module['module_type'] < 21 || $module['module_type'] > 23) && $module['module_type'] != 100)){
|
||||
if ($module['utimestamp'] == 0 &&
|
||||
(
|
||||
($module['id_tipo_modulo'] < 21 || $module['id_tipo_modulo'] > 23) &&
|
||||
$module['id_tipo_modulo'] != 100)
|
||||
) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_NO_DATA, __('NOT INIT'), true);
|
||||
}
|
||||
elseif ($module["estado"] == 0) {
|
||||
|
@ -230,17 +234,17 @@ else {
|
|||
}
|
||||
|
||||
$graphCell = "";
|
||||
if ($module['history_data'] == 1){
|
||||
|
||||
if ($module['history_data'] == 1) {
|
||||
|
||||
$graph_type = return_graphtype ($module["id_tipo_modulo"]);
|
||||
|
||||
|
||||
$name_module_type = modules_get_moduletype_name ($module["id_tipo_modulo"]);
|
||||
$handle = "stat" . $name_module_type . "_" . $module["id_agente_modulo"];
|
||||
$url = 'include/procesos.php?agente=' . $module["id_agente_modulo"];
|
||||
$win_handle = dechex(crc32($module["id_agente_modulo"] . $module["module_name"]));
|
||||
|
||||
|
||||
$link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$module["id_agente_modulo"]."&label=".base64_encode($module["module_name"])."&refresh=600','day_".$win_handle."')";
|
||||
|
||||
|
||||
$graphCell = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => 0, "alt" => "")) . '</a>';
|
||||
$graphCell .= " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$module["id_agente"]."&tab=data_view&period=86400&id=".$module["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("border" => "0", "alt" => "")) . "</a>";
|
||||
}
|
||||
|
@ -250,7 +254,7 @@ else {
|
|||
else
|
||||
$dataCell = "<span title='".$module['datos']."' style='white-space: nowrap;'>".substr(io_safe_output($module["datos"]),0,12)."</span>";
|
||||
|
||||
if ($module['estado'] == 3){
|
||||
if ($module['estado'] == 3) {
|
||||
$option = array ("html_attr" => 'class="redb"');
|
||||
}
|
||||
else {
|
||||
|
@ -275,5 +279,5 @@ else {
|
|||
html_print_table ($table);
|
||||
unset($table);
|
||||
ui_pagination ($totalModules);
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
|
@ -102,9 +102,11 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||
$section = io_safe_output($upd_info["section"]);
|
||||
if (($section == 'Event list') || ($section == 'Group view') || ($section == 'Alert detail') || ($section == 'Tactical view') || ($section == 'Default')) {
|
||||
$upd_info["data_section"] = '';
|
||||
} else if ($section == 'Dashboard') {
|
||||
}
|
||||
else if ($section == 'Dashboard') {
|
||||
$upd_info["data_section"] = $dashboard;
|
||||
} else if ($section == 'Visual console') {
|
||||
}
|
||||
else if ($section == 'Visual console') {
|
||||
$upd_info["data_section"] = $visual_console;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue