From 789b64829ee1e980aee70e0260dbe9e03cef099d Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 4 Nov 2010 16:15:41 +0000 Subject: [PATCH] 2010-11-04 Ramon Novoa * godmode/servers/manage_export.php, godmode/servers/manage_export_form.php: Moved to Pandora FMS Enteprise. * godmode/menu.php: Removed the export targets menu entry. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3519 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 + pandora_console/godmode/menu.php | 2 +- .../godmode/servers/manage_export.php | 130 ----------- .../godmode/servers/manage_export_form.php | 201 ------------------ 4 files changed, 9 insertions(+), 332 deletions(-) delete mode 100644 pandora_console/godmode/servers/manage_export.php delete mode 100644 pandora_console/godmode/servers/manage_export_form.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f88f04ea41..e58c57bbb1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2010-11-04 Ramon Novoa + + * godmode/servers/manage_export.php, + godmode/servers/manage_export_form.php: Moved to Pandora FMS + Enteprise. + + * godmode/menu.php: Removed the export targets menu entry. + 2010-11-04 Miguel de Dios * godmode/users/configure_user.php: fixed lost lines deleted in previous diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 2265cb2930..578287334e 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -171,7 +171,7 @@ if (give_acl ($config['id_user'], 0, "PM")) { $sub["godmode/servers/recon_script"]["text"] = __('Manage recon script'); - $sub["godmode/servers/manage_export"]["text"] = __('Export targets'); + enterprise_hook('export_target_submenu'); $menu["gservers"]["sub"] = $sub; } diff --git a/pandora_console/godmode/servers/manage_export.php b/pandora_console/godmode/servers/manage_export.php deleted file mode 100644 index 6bfc143f21..0000000000 --- a/pandora_console/godmode/servers/manage_export.php +++ /dev/null @@ -1,130 +0,0 @@ -'.__('Error updating export target').''; - } else { - echo '

'.__('Successfully updated export target').'

'; - } -} - -// Delete -if ($delete) { - $sql = sprintf("DELETE FROM tserver_export WHERE id = '%d'", $delete); - if (process_sql ($sql) === false) { - echo '

'.__('Error deleting export target').'

'; - } else { - echo '

'.__('Successfully deleted export target').'

'; - } -} - -// Create -if ($create) { - $sql = sprintf ("INSERT INTO tserver_export - (`name`, `id_export_server`, `preffix`, `interval`, `ip_server`, `connect_mode`, - `user`, `pass`, `port`, `directory`, `options`) - VALUES ('%s', %d, '%s', %d, '%s', '%s', '%s', '%s', %d, '%s', '%s')", - $name, $export_server, $preffix, $interval, $ip_server, $connect_mode, - $user, $password, $port, $directory, $options); - - if (process_sql ($sql) === false) { - echo '

'.__('Error creating export target').'

'; - } else { - echo '

'.__('Successfully created export target').'

'; - } -} - -$result = get_db_all_rows_in_table ("tserver_export"); -if (!$result) { - echo '
'.__('There are no export targets configured').'
'; - echo '
'; - echo '
'; - echo print_submit_button (__('Create'),"crt",false,'class="sub next"',true); - echo '
'; - echo '
'; - return; -} - -$table->head = array (__('Name'), __('Preffix'), __('Interval'), __('Address'), __('Transfer mode'), __('Action')); -//$table->align = array ("","","","center","","","center","center"); -$table->width = 700; -$table->cellpadding = 4; -$table->cellspacing = 4; -$table->class = "databox"; - -foreach ($result as $row) { - $table->data[] = array ( - // Name - '' . $row['name'] . '', - $row['preffix'], - $row['interval'], - $row['ip_server'], - $row['connect_mode'], - // Action - ' -    - ' - ); -} - -print_table ($table); - -echo '
'; -echo '
'; -echo print_submit_button (__('Create'),"crt",false,'class="sub next"',true); -echo '
'; -echo '
'; - -?> diff --git a/pandora_console/godmode/servers/manage_export_form.php b/pandora_console/godmode/servers/manage_export_form.php deleted file mode 100644 index 3dd19b1e30..0000000000 --- a/pandora_console/godmode/servers/manage_export_form.php +++ /dev/null @@ -1,201 +0,0 @@ -width=600; -$table->cellspacing=4; -$table->cellpadding=4; -$table->class="databox_color"; -$table->rowclass[12] = "recon_script"; -$table->rowclass[13] = "recon_script"; -$table->rowclass[14] = "recon_script"; -$table->rowclass[15] = "recon_script"; - -// Name -$table->data[0][0] = "".__('Task name').""; -$table->data[0][1] = print_input_text ('name', $name, '', 25, 0, true); - -// Recon server -$table->data[1][0] = "".__('Recon server').' '.__('You must select a Recon Server for the Task, otherwise the Recon Task will never run').''; - -$table->data[1][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE server_type = 3 ORDER BY name', "id_recon_server", $id_recon_server, '', '', '', true); - - -$fields['network_sweep'] = __("Network sweep"); -$fields['recon_script'] = __("Custom script"); - - -$table->data[2][0] = "".__('Mode').""; -$table->data[2][1] = print_select ($fields, "mode", $mode, '', '', 0, true); - - -// Network -$table->data[3][0] = "".__('Network'); -$table->data[3][1] = print_input_text ('network', $network, '', 25, 0, true); - -// Interval -$values = array (); -$values[3600] = __('%d hour', 1); -$values[7200] = __('%d hours', 2); -$values[21600] = __('%d hours', 6); -$values[43200] = __('%d hours', 12); -$values[86400] = __('%d day', 1); -$values[432000] = __('%d days', 5); -$values[604800] = __('%d week', 1); -$values[1209600] = __('%d weeks', 2); -$values[2592000] = __('%d month', 1); - -$table->data[4][0] = "".__('Interval'); -$table->data[4][1] = print_select ($values, "interval", $interval, '', '', '', true); - -// Module template -$table->data[5][0] = "".__('Module template'); -$table->data[5][1] = print_select_from_sql ('SELECT id_np, name FROM tnetwork_profile', - "id_network_profile", $id_network_profile, '', '', '', true); - -// Recon script -$table->data[6][0] = "".__('Recon script'); -$table->data[6][1] = print_select_from_sql ('SELECT id_recon_script, name FROM trecon_script', "id_recon_script", $id_recon_script, '', '', '', true); - - -// OS -$table->data[7][0] = "".__('OS'); -$table->data[7][1] = print_select_from_sql ('SELECT id_os, name FROM tconfig_os ORDER BY name', - "id_os", $id_os, '', __('Any'), -1, true); - -// Recon ports -$table->data[8][0] = "".__('Ports'); -$table->data[8][1] = print_input_text ('recon_ports', $recon_ports, '', 25, 0, true); -$table->data[8][1] .= ' '.__('Ports defined like: 80 or 80,443,512 or even 0-1024 (Like Nmap command line format). If dont want to do a sweep using portscan, left it in blank').''; - -// Group -$table->data[9][0] = "".__('Group'); -$groups = get_user_groups (false, "AR", false); -$table->data[9][1] = print_select_groups(false, "AR", false, 'id_group', $id_group, '', '', 0, true); - -// Incident -$values = array (0 => __('No'), 1 => __('Yes')); -$table->data[10][0] = "".__('Incident'); -$table->data[10][1] = print_select ($values, "create_incident", $create_incident, - '','','',true); - -// SNMP default community -$table->data[11][0] = "".__('SNMP Default community'); -$table->data[11][1] = print_input_text ('snmp_community', $snmp_community, '', 35, 0, true); - -// Field1 -$table->data[12][0] = "".__('Script field #1'); -$table->data[12][1] = print_input_text ('field1', $field1, '', 40, 0, true); - -// Field2 -$table->data[13][0] = "".__('Script field #2'); -$table->data[13][1] = print_input_text ('field2', $field2, '', 40, 0, true); - -// Field3 -$table->data[14][0] = "".__('Script field #3'); -$table->data[14][1] = print_input_text ('field3', $field3, '', 40, 0, true); - -// Field4 -$table->data[15][0] = "".__('Script field #4'); -$table->data[15][1] = print_input_text ('field4', $field4, '', 40, 0, true); - - -// Comments -$table->data[16][0] = "".__('Comments'); -$table->data[16][1] = print_input_text ('description', $description, '', 45, 0, true); - - -// Different Form url if it's a create or if it's a update form -echo '
'; - -print_table ($table); -echo '
'; -if ($id_rt != -1) - print_submit_button (__('Update'), "crt", false, 'class="sub upd"'); -else - print_submit_button (__('Add'), "crt", false, 'class="sub wand"'); -echo "
"; - -echo "
"; -?> - -