Killed some unicorns and arbitrary numbers. This land is for constants. (backport from the develop branch).
This commit is contained in:
parent
654549f13b
commit
f06b400e4d
|
@ -45,8 +45,9 @@ config_check();
|
|||
}
|
||||
$logo_title = 'Pandora FMS Enterprise';
|
||||
}
|
||||
|
||||
echo html_print_image($custom_logo, true, array("alt" => $logo_title, "border" => '0'));
|
||||
|
||||
echo html_print_image($custom_logo, true,
|
||||
array("alt" => $logo_title, "border" => '0'));
|
||||
?>
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -268,7 +268,8 @@ $table->data[6][1] = html_print_select (servers_get_names (),
|
|||
|
||||
// Description
|
||||
$table->data[7][0] = __('Description');
|
||||
$table->data[7][1] = html_print_input_text ('comentarios', $comentarios, '', 45, 255, true);
|
||||
$table->data[7][1] = html_print_input_text ('comentarios', $comentarios,
|
||||
'', 45, 255, true);
|
||||
|
||||
html_print_table ($table);
|
||||
unset($table);
|
||||
|
@ -376,10 +377,12 @@ if ($config['activate_gis']) {
|
|||
}
|
||||
|
||||
$table->data[6][0] = __('Url address');
|
||||
$table->data[6][1] = html_print_input_text ('url_description', $url_description, '', 45, 255, true);
|
||||
$table->data[6][1] = html_print_input_text ('url_description',
|
||||
$url_description, '', 45, 255, true);
|
||||
|
||||
$table->data[7][0] = __('Quiet');
|
||||
$table->data[7][0] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
|
||||
$table->data[7][0] .= ui_print_help_tip(
|
||||
__('The agent still runs but the alerts and events will be stop'), true);
|
||||
$table->data[7][1] = html_print_checkbox('quiet', 1, $quiet, true);
|
||||
|
||||
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
||||
|
@ -401,13 +404,16 @@ foreach ($fields as $field) {
|
|||
|
||||
$data[0] = '<b>'.$field['name'].'</b>';
|
||||
|
||||
$custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
|
||||
$custom_value = db_get_value_filter('description',
|
||||
'tagent_custom_data',
|
||||
array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
|
||||
|
||||
if ($custom_value === false) {
|
||||
$custom_value = '';
|
||||
}
|
||||
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'],
|
||||
2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
@ -433,12 +439,14 @@ echo "</span>";
|
|||
|
||||
if ($id_agente) {
|
||||
|
||||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
html_print_submit_button (__('Update'), 'updbutton', false,
|
||||
'class="sub upd"');
|
||||
html_print_input_hidden ('update_agent', 1);
|
||||
html_print_input_hidden ('id_agente', $id_agente);
|
||||
}
|
||||
else {
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false,
|
||||
'class="sub wand"');
|
||||
html_print_input_hidden ('create_agent', 1);
|
||||
}
|
||||
echo '</div></form>';
|
||||
|
@ -448,54 +456,64 @@ ui_require_jquery_file ('ajaxqueue');
|
|||
ui_require_jquery_file ('bgiframe');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
//Use this function for change 3 icons when change the selectbox
|
||||
function changeIcons() {
|
||||
icon = $("#icon_path :selected").val();
|
||||
/* <![CDATA[ */
|
||||
|
||||
$("#icon_without_status").attr("src", "images/spinner.png");
|
||||
$("#icon_default").attr("src", "images/spinner.png");
|
||||
$("#icon_ok").attr("src", "images/spinner.png");
|
||||
$("#icon_bad").attr("src", "images/spinner.png");
|
||||
$("#icon_warning").attr("src", "images/spinner.png");
|
||||
|
||||
if (icon.length == 0) {
|
||||
$("#icon_without_status").attr("style", "display:none;");
|
||||
$("#icon_default").attr("style", "display:none;");
|
||||
$("#icon_ok").attr("style", "display:none;");
|
||||
$("#icon_bad").attr("style", "display:none;");
|
||||
$("#icon_warning").attr("style", "display:none;");
|
||||
}
|
||||
else {
|
||||
$("#icon_without_status").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
|
||||
$("#icon_default").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
|
||||
$("#icon_ok").attr("src", "<?php echo $path; ?>" + icon + ".ok.png");
|
||||
$("#icon_bad").attr("src", "<?php echo $path; ?>" + icon + ".bad.png");
|
||||
$("#icon_warning").attr("src", "<?php echo $path; ?>" + icon + ".warning.png");
|
||||
$("#icon_without_status").attr("style", "");
|
||||
$("#icon_default").attr("style", "");
|
||||
$("#icon_ok").attr("style", "");
|
||||
$("#icon_bad").attr("style", "");
|
||||
$("#icon_warning").attr("style", "");
|
||||
//Use this function for change 3 icons when change the selectbox
|
||||
function changeIcons() {
|
||||
icon = $("#icon_path :selected").val();
|
||||
|
||||
$("#icon_without_status").attr("src", "images/spinner.png");
|
||||
$("#icon_default").attr("src", "images/spinner.png");
|
||||
$("#icon_ok").attr("src", "images/spinner.png");
|
||||
$("#icon_bad").attr("src", "images/spinner.png");
|
||||
$("#icon_warning").attr("src", "images/spinner.png");
|
||||
|
||||
if (icon.length == 0) {
|
||||
$("#icon_without_status").attr("style", "display:none;");
|
||||
$("#icon_default").attr("style", "display:none;");
|
||||
$("#icon_ok").attr("style", "display:none;");
|
||||
$("#icon_bad").attr("style", "display:none;");
|
||||
$("#icon_warning").attr("style", "display:none;");
|
||||
}
|
||||
else {
|
||||
$("#icon_without_status").attr("src",
|
||||
"<?php echo $path; ?>" + icon + ".default.png");
|
||||
$("#icon_default").attr("src",
|
||||
"<?php echo $path; ?>" + icon + ".default.png");
|
||||
$("#icon_ok").attr("src",
|
||||
"<?php echo $path; ?>" + icon + ".ok.png");
|
||||
$("#icon_bad").attr("src",
|
||||
"<?php echo $path; ?>" + icon + ".bad.png");
|
||||
$("#icon_warning").attr("src",
|
||||
"<?php echo $path; ?>" + icon + ".warning.png");
|
||||
$("#icon_without_status").attr("style", "");
|
||||
$("#icon_default").attr("style", "");
|
||||
$("#icon_ok").attr("style", "");
|
||||
$("#icon_bad").attr("style", "");
|
||||
$("#icon_warning").attr("style", "");
|
||||
}
|
||||
|
||||
//$("#icon_default").attr("src", "<?php echo $path; ?>" + icon +
|
||||
}
|
||||
|
||||
//$("#icon_default").attr("src", "<?php echo $path; ?>" + icon +
|
||||
}
|
||||
|
||||
function show_modules_not_learning_mode_context_help() {
|
||||
if ($("input[name='modo'][value=1]").is(':checked')) {
|
||||
$("#modules_not_learning_mode_context_help").hide();
|
||||
function show_modules_not_learning_mode_context_help() {
|
||||
if ($("input[name='modo'][value=1]").is(':checked')) {
|
||||
$("#modules_not_learning_mode_context_help").hide();
|
||||
}
|
||||
else {
|
||||
$("#modules_not_learning_mode_context_help").show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#modules_not_learning_mode_context_help").show();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready (function () {
|
||||
$("select#id_os").pandoraSelectOS ();
|
||||
|
||||
paint_qrcode("<?php echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente); ?>", "#qr_code_agent_view", 128, 128);
|
||||
});
|
||||
/* ]]> */
|
||||
$(document).ready (function () {
|
||||
$("select#id_os").pandoraSelectOS ();
|
||||
|
||||
paint_qrcode(
|
||||
"<?php
|
||||
echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente);
|
||||
?>",
|
||||
"#qr_code_agent_view", 128, 128);
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -784,6 +784,7 @@ $edit_module = (bool) get_parameter ('edit_module');
|
|||
if ($update_module || $create_module) {
|
||||
$id_grupo = agents_get_agent_group ($id_agente);
|
||||
|
||||
|
||||
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to create a module without admin rights");
|
||||
|
@ -803,7 +804,7 @@ if ($update_module || $create_module) {
|
|||
|
||||
$post_process = (string) get_parameter ('post_process', 0.0);
|
||||
//$prediction_module = 0;
|
||||
|
||||
|
||||
$max_timeout = (int) get_parameter ('max_timeout');
|
||||
$max_retries = (int) get_parameter ('max_retries');
|
||||
$min = (int) get_parameter_post ("min");
|
||||
|
@ -858,8 +859,8 @@ if ($update_module || $create_module) {
|
|||
$macros = io_json_mb_encode($macros);
|
||||
|
||||
$conf_array = explode("\n",$configuration_data);
|
||||
foreach($conf_array as $line) {
|
||||
if(preg_match("/^module_name\s*(.*)/", $line, $match)) {
|
||||
foreach ($conf_array as $line) {
|
||||
if (preg_match("/^module_name\s*(.*)/", $line, $match)) {
|
||||
$new_configuration_data .= "module_name $name\n";
|
||||
}
|
||||
// We delete from conf all the module macros starting with _field
|
||||
|
@ -870,7 +871,7 @@ if ($update_module || $create_module) {
|
|||
|
||||
$macros_for_data = enterprise_hook('config_agents_get_macros_data_conf', array($_POST));
|
||||
|
||||
if($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') {
|
||||
if ($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') {
|
||||
// Add macros to configuration file
|
||||
$new_configuration_data = str_replace('module_end', $macros_for_data."module_end", $new_configuration_data);
|
||||
}
|
||||
|
@ -950,9 +951,10 @@ if ($update_module || $create_module) {
|
|||
$wday = get_parameter('wday');
|
||||
$cron_interval = "$minute $hour $mday $month $wday";
|
||||
|
||||
if ($prediction_module != 3) {
|
||||
if ($prediction_module != MODULE_PREDICTION_SYNTHETIC) {
|
||||
unset($serialize_ops);
|
||||
enterprise_hook('modules_delete_synthetic_operations', array($id_agent_module));
|
||||
enterprise_hook('modules_delete_synthetic_operations',
|
||||
array($id_agent_module));
|
||||
}
|
||||
|
||||
$active_snmp_v3 = get_parameter('active_snmp_v3');
|
||||
|
@ -972,7 +974,8 @@ if ($update_module || $create_module) {
|
|||
// Make changes in the conf file if necessary
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
enterprise_hook('config_agents_write_module_in_conf',
|
||||
array($id_agente, io_safe_output($old_configuration_data), io_safe_output($configuration_data), $disabled));
|
||||
array($id_agente, io_safe_output($old_configuration_data),
|
||||
io_safe_output($configuration_data), $disabled));
|
||||
}
|
||||
|
||||
// MODULE UPDATE
|
||||
|
@ -1040,8 +1043,10 @@ if ($update_module) {
|
|||
if ($module_kind == MODULE_DATA) {
|
||||
unset($values['module_interval']);
|
||||
}
|
||||
|
||||
if ($prediction_module == 3 && $serialize_ops == '') {
|
||||
|
||||
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC &&
|
||||
$serialize_ops == '') {
|
||||
|
||||
$result = false;
|
||||
}
|
||||
else {
|
||||
|
@ -1072,7 +1077,7 @@ if ($update_module) {
|
|||
$edit_module = true;
|
||||
|
||||
db_pandora_audit("Agent management",
|
||||
"Fail to try update module '$name' for agent ".$agent["nombre"]);
|
||||
"Fail to try update module '$name' for agent " . $agent["nombre"]);
|
||||
}
|
||||
else {
|
||||
if ($prediction_module == 3) {
|
||||
|
|
|
@ -296,8 +296,9 @@ $table_advanced->width = '98%';
|
|||
$table_advanced->class = 'databox_color';
|
||||
$table_advanced->data = array ();
|
||||
$table_advanced->style = array ();
|
||||
$table_advanced->style[0] = 'font-weight: bold; vertical-align: top';
|
||||
$table_advanced->style[3] = 'font-weight: bold; vertical-align: top';
|
||||
$table_advanced->style[0] =
|
||||
$table_advanced->style[3] =
|
||||
'font-weight: bold; vertical-align: top';
|
||||
$table_advanced->colspan = array ();
|
||||
|
||||
$table_advanced->data[0][0] = __('Description');
|
||||
|
@ -356,8 +357,9 @@ else {
|
|||
$table_advanced->data[2][1] .= html_print_input_hidden ('moduletype', $moduletype, true);
|
||||
|
||||
$table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true);
|
||||
$table_advanced->data[2][4] = html_print_input_text ('post_process',
|
||||
$post_process, '', 15, 25, true, $disabledBecauseInPolicy);
|
||||
$table_advanced->data[2][4] =
|
||||
html_print_input_text('post_process',
|
||||
$post_process, '', 15, 25, true, $disabledBecauseInPolicy);
|
||||
|
||||
$table_advanced->data[3][0] = __('Min. Value');
|
||||
$table_advanced->colspan[3][1] = 2;
|
||||
|
@ -420,13 +422,18 @@ if ($__code_from == 'modules') {
|
|||
$__table_modules = 'ttag_module';
|
||||
$__id_where = 'b.id_agente_modulo';
|
||||
$__id = (int)$id_agent_module;
|
||||
|
||||
// Code comes from policy module editor
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
global $__id_pol_mod;
|
||||
$__table_modules= 'ttag_policy_module';
|
||||
$__id_where = 'b.id_policy_module';
|
||||
$__id = $__id_pol_mod;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!tags_has_user_acl_tags($config["id_user"])) {
|
||||
|
@ -468,28 +475,33 @@ else {
|
|||
true, true, false, false, 'width: 200px', '5');
|
||||
}
|
||||
}
|
||||
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
|
||||
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
|
||||
$table_advanced->data[6][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete tags to module'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
|
||||
|
||||
$table_advanced->data[6][3] = '<b>' . __('Tags selected') . '</b>';
|
||||
$table_advanced->data[6][4] = html_print_select_from_sql (
|
||||
$table_advanced->data[6][4] = html_print_select_from_sql (
|
||||
"SELECT a.id_tag, name
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
|
||||
ORDER BY name",
|
||||
'id_tag_selected[]', '', '','','', true, true, false,
|
||||
false, 'width: 200px', '5');
|
||||
|
||||
|
||||
$table_advanced->data[7][0] = __('Quiet');
|
||||
$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
|
||||
$table_advanced->data[7][0] .= ui_print_help_tip(
|
||||
__('The module still stores data but the alerts and events will be stop'), true);
|
||||
$table_advanced->colspan[7][1] = 4;
|
||||
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1,
|
||||
$quiet_module, true);
|
||||
|
||||
$table_advanced->data[8][0] = __('Critical instructions'). ui_print_help_tip(__("Instructions when the status is critical"), true);
|
||||
$table_advanced->data[8][0] = __('Critical instructions') .
|
||||
ui_print_help_tip(__("Instructions when the status is critical"), true);
|
||||
$table_advanced->data[8][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
|
||||
$table_advanced->colspan[8][1] = 4;
|
||||
|
||||
$table_advanced->data[9][0] = __('Warning instructions'). ui_print_help_tip(__("Instructions when the status is warning"), true);
|
||||
$table_advanced->data[9][0] = __('Warning instructions') .
|
||||
ui_print_help_tip(__("Instructions when the status is warning"), true);
|
||||
$table_advanced->data[9][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
|
||||
$table_advanced->colspan[9][1] = 4;
|
||||
|
||||
|
@ -497,7 +509,8 @@ $table_advanced->data[10][0] = __('Unknown instructions'). ui_print_help_tip(__(
|
|||
$table_advanced->data[10][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
|
||||
$table_advanced->colspan[10][1] = 4;
|
||||
|
||||
$table_advanced->data[11][0] = __('Cron') . ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
|
||||
$table_advanced->data[11][0] = __('Cron') .
|
||||
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
|
||||
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true);
|
||||
$table_advanced->colspan[11][1] = 4;
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ if (is_ajax ()) {
|
|||
|
||||
$fields_rows = array();
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
|
||||
if (!empty($fields_descriptions[$i - 1])) {
|
||||
$fdesc = $fields_descriptions[$i - 1] .
|
||||
' <br><span style="font-size:xx-small; font-weight:normal;">' .
|
||||
|
|
|
@ -156,7 +156,7 @@ if ($delete_template) {
|
|||
$id = get_parameter ('id');
|
||||
$al_template = alerts_get_alert_template($id);
|
||||
|
||||
if ($al_template !== false){
|
||||
if ($al_template !== false) {
|
||||
// If user tries to delete a template with group=ALL then must have "PM" access privileges
|
||||
if ($al_template['id_group'] == 0) {
|
||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||
|
@ -233,6 +233,7 @@ $table->width = '98%';
|
|||
$table->data = array ();
|
||||
$table->head = array ();
|
||||
$table->style = array ();
|
||||
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
|
||||
|
|
|
@ -311,6 +311,7 @@ $(document).ready (function () {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
render_command_preview(original_command);
|
||||
render_command_recovery_preview(original_command);
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@ if (!empty($result)) {
|
|||
}
|
||||
|
||||
html_print_table ($table);
|
||||
|
||||
}
|
||||
else {
|
||||
// No categories available or selected
|
||||
|
|
|
@ -119,7 +119,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
|
|||
echo "<td align=center>";
|
||||
html_print_label (__("Name"),'name');
|
||||
echo "</td>";
|
||||
echo "<td align=center>";
|
||||
echo "<td align=center>";
|
||||
html_print_input_text ('name_category', $name_category);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
|
|
@ -31,22 +31,22 @@ if (! check_acl ($config['id_user'], 0, "DM")) {
|
|||
$time["all"] = get_system_time ();
|
||||
|
||||
// 1 day ago
|
||||
$time["1day"] = $time["all"]-86400;
|
||||
$time["1day"] = $time["all"] - SECONDS_1DAY;
|
||||
|
||||
// 3 days ago
|
||||
$time["3day"] = $time["all"]-(86400*3);
|
||||
$time["3day"] = $time["all"] - ( SECONDS_1DAY * 3);
|
||||
|
||||
// 1 week ago
|
||||
$time["1week"] = $time["all"]-(86400*7);
|
||||
$time["1week"] = $time["all"] - SECONDS_1WEEK;
|
||||
|
||||
// 2 weeks ago
|
||||
$time["2week"] = $time["all"]-(86400*14);
|
||||
$time["2week"] = $time["all"] - SECONDS_2WEEK;
|
||||
|
||||
// 1 month ago
|
||||
$time["1month"] = $time["all"]-(86400*30);
|
||||
$time["1month"] = $time["all"] - SECONDS_1MONTH;
|
||||
|
||||
// Three months ago
|
||||
$time["3month"] = $time["all"]-(86400*90);
|
||||
$time["3month"] = $time["all"] - SECONDS_3MONTHS;
|
||||
|
||||
// Todo for a good DB maintenance
|
||||
/*
|
||||
|
|
|
@ -52,9 +52,11 @@ else if ($update != '') {
|
|||
'value' => $event_fields
|
||||
);
|
||||
//update 'event_fields' in tconfig table to keep the value at update.
|
||||
$result = db_process_sql_update('tconfig', $values, array ('token' => 'event_fields'));
|
||||
$result = db_process_sql_update('tconfig', $values,
|
||||
array ('token' => 'event_fields'));
|
||||
}
|
||||
|
||||
|
||||
$result_selected = array();
|
||||
|
||||
//show list of fields selected.
|
||||
|
|
|
@ -78,7 +78,10 @@ $own_info = get_user_info ($config['id_user']);
|
|||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "EW", users_can_manage_group_all(), true);
|
||||
|
||||
$sql = "SELECT * FROM tevent_filter WHERE id_group_filter IN (".implode(',', array_keys ($groups_user)).")";
|
||||
$sql = "
|
||||
SELECT *
|
||||
FROM tevent_filter
|
||||
WHERE id_group_filter IN (".implode(',', array_keys ($groups_user)).")";
|
||||
$filters = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($filters === false)
|
||||
|
|
|
@ -37,7 +37,7 @@ if (is_ajax ()) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') {
|
||||
if (is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') {
|
||||
$id_agents = false;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ $recursion = get_parameter ('recursion');
|
|||
$add = (bool) get_parameter_post ('add');
|
||||
|
||||
if ($add) {
|
||||
if(empty($id_agents) || $id_agents[0] == 0)
|
||||
if (empty($id_agents) || $id_agents[0] == 0)
|
||||
ui_print_result_message (false, '', __('Could not be added').". ".__('No agents selected'));
|
||||
else {
|
||||
$actions = get_parameter ('action');
|
||||
|
@ -76,9 +76,9 @@ if ($add) {
|
|||
|
||||
$options = array();
|
||||
|
||||
if($fires_min > 0)
|
||||
if ($fires_min > 0)
|
||||
$options['fires_min'] = $fires_min;
|
||||
if($fires_max > 0)
|
||||
if ($fires_max > 0)
|
||||
$options['fires_max'] = $fires_max;
|
||||
|
||||
if (empty($agent_alerts_id)) {
|
||||
|
@ -87,9 +87,9 @@ if ($add) {
|
|||
else {
|
||||
$results = true;
|
||||
foreach ($agent_alerts_id as $agent_alert_id) {
|
||||
foreach($actions as $action) {
|
||||
foreach ($actions as $action) {
|
||||
$result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options);
|
||||
if($result === false)
|
||||
if ($result === false)
|
||||
$results = false;
|
||||
}
|
||||
}
|
||||
|
@ -169,14 +169,14 @@ html_print_table ($table);
|
|||
$sql = 'SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo IN (SELECT id_agent_module FROM talert_template_modules)';
|
||||
$agents_with_templates = db_get_all_rows_sql($sql);
|
||||
$agents_with_templates_json = array();
|
||||
foreach($agents_with_templates as $ag) {
|
||||
foreach ($agents_with_templates as $ag) {
|
||||
$agents_with_templates_json[] = $ag['id_agente'];
|
||||
}
|
||||
$agents_with_templates_json = json_encode($agents_with_templates_json);
|
||||
|
||||
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
echo '<div class="action-buttons" style="width: ' . $table->width . '" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
html_print_input_hidden ('add', 1);
|
||||
html_print_submit_button (__('Add'), 'go', false, 'class="sub add"');
|
||||
echo '</div>';
|
||||
|
@ -189,7 +189,10 @@ ui_require_jquery_file ('pandora.controls');
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
update_alerts();
|
||||
|
||||
var recursion;
|
||||
|
|
|
@ -205,7 +205,10 @@ ui_require_jquery_file ('pandora.controls');
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("#checkbox-recursion").click(function () {
|
||||
$("#id_group").trigger("change");
|
||||
});
|
||||
|
|
|
@ -38,6 +38,8 @@ $destiny_recursion = get_parameter ('destiny_recursion');
|
|||
|
||||
$do_operation = (bool) get_parameter ('do_operation');
|
||||
|
||||
|
||||
|
||||
if ($do_operation) {
|
||||
$result = agents_process_manage_config($source_id_agent,
|
||||
$destiny_id_agents);
|
||||
|
@ -166,12 +168,14 @@ $table->size[0] = '20%';
|
|||
$table->size[1] = '30%';
|
||||
$table->size[2] = '20%';
|
||||
$table->size[3] = '30%';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(false, "AW", true, 'destiny_id_group',
|
||||
$destiny_id_group, false, '', '', true);
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox ("destiny_recursion", 1,
|
||||
$destiny_recursion, true, false);
|
||||
|
||||
$status_list = array ();
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -182,6 +186,7 @@ $status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
|||
$table->data[1][0] = __('Status');
|
||||
$table->data[1][1] = html_print_select($status_list,
|
||||
'status_agents_destiny', 'selected', '', __('All'), AGENT_STATUS_ALL, true);
|
||||
|
||||
$table->data[2][0] = __('Agent');
|
||||
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
||||
$table->data[2][0] .= html_print_image ("images/spinner.png", true);
|
||||
|
@ -204,6 +209,7 @@ html_print_table ($table);
|
|||
echo '</fieldset>';
|
||||
|
||||
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
|
||||
|
||||
html_print_input_hidden ('do_operation', 1);
|
||||
html_print_submit_button (__('Copy'), 'go', false, 'class="sub wand"');
|
||||
echo '</div>';
|
||||
|
@ -219,6 +225,8 @@ ui_require_jquery_file ('pandora.controls');
|
|||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var module_alerts;
|
||||
|
||||
|
||||
$(document).ready (function () {
|
||||
var source_recursion;
|
||||
$("#checkbox-source_recursion").click(function () {
|
||||
|
@ -394,7 +402,14 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
$("#manage_config_form").submit (function () {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$("h3:not([id=message])").remove ();
|
||||
|
||||
if ($("#source_id_agent").attr ("value") == 0) {
|
||||
$("#message").showMessage ("<?php echo __('No source agent to copy') ?>");
|
||||
return false;
|
||||
|
@ -419,6 +434,7 @@ $(document).ready (function () {
|
|||
}
|
||||
|
||||
$("#message").hide ();
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -143,7 +143,10 @@ ui_require_jquery_file ('pandora.controls');
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
var recursion;
|
||||
|
||||
$("#checkbox-recursion").click(function () {
|
||||
|
|
|
@ -248,7 +248,11 @@ ui_require_jquery_file ('pandora.controls');
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
|
||||
|
||||
$("#id_alert_template").change (function () {
|
||||
|
|
|
@ -372,6 +372,8 @@ else {
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
|
||||
$(document).ready (function () {
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
$("#module_name").change(module_changed_by_multiple_modules);
|
||||
|
@ -542,6 +544,7 @@ $(document).ready (function () {
|
|||
$("#status_agents").change(function() {
|
||||
$("#groups_select").trigger("change");
|
||||
});
|
||||
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -436,9 +436,13 @@ ui_require_jquery_file ('bgiframe');
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
|
||||
|
||||
//Use this function for change 3 icons when change the selectbox
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
|
||||
$("#id_agents").change (function () {
|
||||
var idAgents = Array();
|
||||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||
|
|
|
@ -413,10 +413,12 @@ $table->data['edit2'][1] = html_print_extended_select_for_time ('module_interval
|
|||
$table->data['edit2'][2] = __('Disabled');
|
||||
$table->data['edit2'][3] = html_print_select(array('' => __('No change'), '1' => __('Yes'), '0' => __('No')),'disabled','','','', '', true);
|
||||
|
||||
$table->data['edit3'][0] = __('Post process').ui_print_help_icon ('postprocess', true);
|
||||
$table->data['edit3'][0] = __('Post process') .
|
||||
ui_print_help_icon ('postprocess', true);
|
||||
$table->data['edit3'][1] = html_print_input_text ('post_process', '', '', 10, 15, true);
|
||||
$table->data['edit3'][2] = __('SMNP community');
|
||||
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '', '', 10, 15, true);
|
||||
|
||||
$table->data['edit35'][0] = __('Target IP');
|
||||
$table->data['edit35'][1] = html_print_input_text ('ip_target', '', '', 15, 60, true);
|
||||
$table->data['edit35'][2] = __('SNMP version');
|
||||
|
@ -561,7 +563,10 @@ else {
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
$("#module_name").change(module_changed_by_multiple_modules);
|
||||
|
||||
|
|
|
@ -141,19 +141,23 @@ if ($option == '') {
|
|||
}
|
||||
|
||||
$alertstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'
|
||||
. html_print_image ('images/op_alerts.png', true, array ('title' => __('Alerts operations')))
|
||||
. html_print_image ('images/op_alerts.png', true,
|
||||
array ('title' => __('Alerts operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_alerts');
|
||||
|
||||
$userstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'
|
||||
. html_print_image ('images/op_workspace.png', true, array ('title' => __('Users operations')))
|
||||
. html_print_image ('images/op_workspace.png', true,
|
||||
array ('title' => __('Users operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_users');
|
||||
|
||||
$agentstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'
|
||||
. html_print_image ('images/bricks.png', true, array ('title' => __('Agents operations')))
|
||||
. html_print_image ('images/bricks.png', true,
|
||||
array ('title' => __('Agents operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_agents');
|
||||
|
||||
$modulestab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'
|
||||
. html_print_image ('images/brick.png', true, array ('title' => __('Modules operations')))
|
||||
. html_print_image ('images/brick.png', true,
|
||||
array ('title' => __('Modules operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_modules');
|
||||
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.ph
|
|||
session_start ();
|
||||
require_once ("include/config.php");
|
||||
|
||||
|
||||
// If metaconsole activated, redirect to it
|
||||
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
||||
header ("Location: " . $config['homeurl'] . "enterprise/meta");
|
||||
|
@ -167,7 +168,7 @@ if (strlen($search) > 0) {
|
|||
$searchPage = true;
|
||||
}
|
||||
|
||||
// Login process
|
||||
// Login process
|
||||
if (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
||||
include_once('include/functions_db.php'); //Include it to use escape_string_sql function
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ if ($layers != false) {
|
|||
break;
|
||||
case "oracle":
|
||||
$timestampLastOperation = db_get_value_sql(
|
||||
"SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) FROM dual");
|
||||
"SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (" . SECONDS_1DAY . ")) FROM dual");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue