0) { pandora_audit("Masive management", "Delete conf file " . $id_agent); } else { pandora_audit("Masive management", "Try to delete conf file " . $id_agent); } 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 = 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 = get_db_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 = process_sql_insert ('tagent_custom_data', array('id_field' => $key,'id_agent' => $id_agent, 'description' => $value)); } else { $result = process_sql_update ('tagent_custom_data', array('description' => $value), array('id_field' => $key,'id_agent' => $id_agent)); } } } $n_edited += (int)$result; } if ($result !== false) { pandora_audit("Masive management", "Update agent " . $id_agent, false, false, json_encode($fields)); } else { pandora_audit("Masive management", "Try to update agent " . $id_agent, false, false, json_encode($fields)); } print_result_message ($result !== false, __('Agents updated successfully').'('.$n_edited.')', __('Agents cannot be updated')); } $id_group = 0; $groups = get_user_groups(); $table->id = 'delete_table'; $table->width = '95%'; $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] = '85%'; $table->data = array (); $table->data[0][0] = __('Group'); $table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group, false, '', '', true); $table->data[1][0] = __('Agents'); $table->data[1][0] .= ''; $enabled_agents = get_group_agents ($id_group, array('disabled' => 0), "none"); $all_agents = get_group_agents ($id_group, array('disabled' => 1), "none") + $enabled_agents; $table->data[1][1] = print_select ($all_agents, 'id_agents[]', 0, false, '', '', true, true); echo '
'; 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 '
'; require_jquery_file ('form'); require_jquery_file ('pandora.controls'); require_jquery_file ('pandora.controls'); require_jquery_file ('ajaxqueue'); require_jquery_file ('bgiframe'); require_jquery_file ('autocomplete'); ?>