0) { db_pandora_audit("Massive management", "Delete conf file " . $id_agent); } else { db_pandora_audit("Massive management", "Try to delete conf file " . $id_agent); } ui_print_result_message ($n_deleted > 0, __('Configuration files deleted successfully').'('.$n_deleted.')', __('Configuration files cannot be deleted')); } if (empty($values) && empty($fields)) { $id_agents = array(); } $n_edited = 0; $result = false; foreach ($id_agents as $id_agent) { if (!empty($values)) { $result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agent)); } // Update Custom Fields foreach ($fields as $field) { if (get_parameter_post ('customvalue_'.$field['id_field'], '') != '') { $key = $field['id_field']; $value = get_parameter_post ('customvalue_'.$field['id_field'], ''); $old_value = db_get_all_rows_filter('tagent_custom_data', array('id_agent' => $id_agent, 'id_field' => $key)); if ($old_value === false) { // Create custom field if not exist $result = db_process_sql_insert ('tagent_custom_data', array('id_field' => $key,'id_agent' => $id_agent, 'description' => $value)); } else { $result = db_process_sql_update ('tagent_custom_data', array('description' => $value), array('id_field' => $key,'id_agent' => $id_agent)); } } } $n_edited += (int)$result; } if ($result !== false) { db_pandora_audit("Massive management", "Update agent " . $id_agent, false, false, json_encode($fields)); } else { if (isset ($id_agent)) { db_pandora_audit("Massive management", "Try to update agent " . $id_agent, false, false, json_encode($fields)); } } ui_print_result_message ($result !== false, __('Agents updated successfully').'('.$n_edited.')', __('Agents cannot be updated')); } $id_group = 0; $groups = users_get_groups(); $table->id = 'delete_table'; $table->width = '98%'; $table->data = array (); $table->style = array (); $table->style[0] = 'font-weight: bold; vertical-align:top'; $table->style[2] = 'font-weight: bold'; $table->size = array (); $table->size[0] = '15%'; $table->size[1] = '35%'; $table->size[2] = '15%'; $table->size[3] = '35%'; $table->data = array (); $table->data[0][0] = __('Group'); $table->data[0][1] = html_print_select_groups(false, "AR", true, 'id_group', $id_group, false, '', '', true); $table->data[0][2] = __('Group recursion'); $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion, true, false); $table->data[1][0] = __('Agents'); $table->data[1][0] .= ''; $enabled_agents = agents_get_group_agents ($id_group, array('disabled' => 0), "none"); $all_agents = agents_get_group_agents ($id_group, array('disabled' => 1), "none") + $enabled_agents; $table->data[1][1] = html_print_select ($all_agents, 'id_agents[]', 0, false, '', '', true, true); echo '
'; html_print_table ($table); $nombre_agente = ""; $direccion_agente = ""; $id_agente = 0; $id_parent = 0; $cascade_protection = 0; $group = 0; $interval = ''; $id_os = 0; $server_name = 0; $description = ""; echo '
'; ui_require_jquery_file ('form'); ui_require_jquery_file ('pandora.controls'); ui_require_jquery_file ('pandora.controls'); ui_require_jquery_file ('ajaxqueue'); ui_require_jquery_file ('bgiframe'); ?>