'; if (!$new_agent) { // Agent remote configuration editor $agent_md5 = md5 ($nombre_agente, false); $filename['md5'] = $config["remote_config"]."/md5/".$agent_md5.".md5"; $filename['conf'] = $config["remote_config"]."/conf/".$agent_md5.".conf"; } $disk_conf = (bool) get_parameter ('disk_conf'); if ($disk_conf) { require ("agent_disk_conf_editor.php"); return; } $disk_conf_delete = (bool) get_parameter ('disk_conf_delete'); // Agent remote configuration DELETE if ($disk_conf_delete) { //TODO: Get this working on computers where the Pandora server(s) are not on the webserver //TODO: Get a remote_config editor working in the open version @unlink ($filename['md5']); @unlink ($filename['conf']); } echo '
'; $table->width = '95%'; $table->class = "databox_color"; $table->head = array (); $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->data = array (); $table->data[0][0] = __('Agent name') . print_help_tip (__("The agent's name must be the same as the one defined at the console"), true); $table->data[0][1] = print_input_text ('agente', $nombre_agente, '', 30, 100,true); if ($id_agente) { $table->data[0][1] .= ''; $table->data[0][1] .= print_image ("images/lupa.png", true, array ("border" => 0, "title" => __('Agent detail'))); $table->data[0][1] .= ''; } // Remote configuration available if (!$new_agent) { if (file_exists ($filename['md5'])) { $table->data[0][1] .= ''; $table->data[0][1] .= print_image ("images/application_edit.png", true, array ("border" => 0, "title" => __('This agent can be remotely configured'))); $table->data[0][1] .= ''.print_help_tip (__('You can remotely edit this agent configuration'), true); } } $table->data[1][0] = __('IP Address'); $table->data[1][1] = print_input_text ('direccion', $direccion_agente, '', 16, 100, true); if ($id_agente) { $table->data[1][1] .= '    '; $ip_all = get_agent_addresses ($id_agente); $table->data[1][1] .= print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true); $table->data[1][1] .= " ". print_checkbox ("delete_ip", 1, false, true).__('Delete selected'); } $groups = get_user_groups ($config["id_user"]); $agents = get_group_agents (array_keys ($groups)); $table->data[2][0] = __('Parent'); $table->data[2][1] = print_input_text_extended ('id_parent', get_agent_name ($id_parent), 'text-id_parent', '', 30, 100, false, '', array('style' => 'background: url(images/lightning.png) no-repeat right;'), true) . ' ' . __("Type at least two characters to search") . ''; $table->data[2][1] .= print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . print_help_icon("cascade_protection", true); $table->data[3][0] = __('Group'); $groups = get_user_groups (false, "AR", false); $table->data[3][1] = print_select ($groups, 'grupo', $grupo, '', '', 0, true); $table->data[4][0] = __('Interval'); $intervals = array (); $intervals[30] = human_time_description_raw (30); $intervals[60] = human_time_description_raw (60); $intervals[300] = human_time_description_raw (300); $intervals[600] = human_time_description_raw (600); $intervals[1200] = human_time_description_raw (1200); $intervals[1800] = human_time_description_raw (1800); $intervals[3600] = human_time_description_raw (3600); $intervals[7200] = human_time_description_raw (7200); $table->data[4][1] = print_extended_select_for_time ($intervals, 'intervalo', $intervalo, '', '', '0', 10, true) . __(" seconds."); //$table->data[4][1] = print_input_text ('intervalo', $intervalo, '', 16, 100, true); $table->data[5][0] = __('OS'); $table->data[5][1] = print_select_from_sql ('SELECT id_os, name FROM tconfig_os', 'id_os', $id_os, '', '', '0', true); $table->data[5][1] .= ' '; $table->data[5][1] .= print_os_icon ($id_os, false, true); $table->data[5][1] .= ''; // Network server $none = ''; if ($server_name == '' && $id_agente) $none = __('None'); $table->data[6][0] = __('Server'); $table->data[6][1] = print_select (get_server_names (), 'server_name', $server_name, '', $none, 0, true); // Custom ID $table->data[7][0] = __('Custom ID'); $table->data[7][1] = print_input_text ('custom_id', $custom_id, '', 16, 255, true); // Description $table->data[8][0] = __('Description'); $table->data[8][1] = print_input_text ('comentarios', $comentarios, '', 45, 255, true); // Learn mode / Normal mode $table->data[9][0] = __('Module definition').print_help_icon("module_definition", true); $table->data[9][1] = __('Learning mode').' '.print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true); $table->data[9][1] .= __('Normal mode').' '.print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true); // Status (Disabled / Enabled) $table->data[10][0] = __('Status'); $table->data[10][1] = __('Disabled').' '.print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true); $table->data[10][1] .= __('Active').' '.print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true); // Remote configuration $table->data[11][0] = __('Remote configuration'); if (!$new_agent) { if (file_exists ($filename['md5'])) { $table->data[11][1] = date ("F d Y H:i:s", fileatime ($filename['md5'])); // Delete remote configuration $table->data[11][1] .= ''; $table->data[11][1] .= print_image ("images/cross.png", true).''; } else $table->data[11][1] = ''.__('Not available').''; } else $table->data[11][1] = ''.__('Not available').''; $listIcons = getArrayListIcons(); $arraySelectIcon = array(); foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index; $path = 'images/gis_map/icons/'; //TODO set better method the path $table->data[12][0] = __('Agent icon'); $table->data[12][1] = print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) . ' ' . __('Without status') . ': ' . ' ' . __('Default') . ': ' . ' ' . __('Ok') . ': ' . ' ' . __('Bad') . ': ' . ' ' . __('Warning') . ': '; if ($config['activate_gis']) { $table->data[13][0] = __('Ignore new GIS data:'); $table->data[13][1] = __('Disabled').' '.print_radio_button_extended ("update_gis_data", 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true); $table->data[13][1] .= __('Active').' '.print_radio_button_extended ("update_gis_data", 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true); } print_table ($table); echo '
'; if ($id_agente) { print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); print_input_hidden ('update_agent', 1); print_input_hidden ('id_agente', $id_agente); } else { print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"'); print_input_hidden ('create_agent', 1); } echo '
'; require_jquery_file ('pandora.controls'); require_jquery_file ('ajaxqueue'); require_jquery_file ('bgiframe'); require_jquery_file ('autocomplete'); ?>