diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f7e26aef4a..08d16bf7f5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,74 @@ +2009-04-13 Esteban Sanchez + + * general/footer.php: Removed Firefox icon. Style correction. + + * godmode/agentes/agent_manager.php: Replaced > with ». Style + correction when setting bold attributes. + + * godmode/agentes/manage_config_remote.php, + godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php, + godmode/alerts/alert_list.php, godmode/db/db_audit.php, + godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php, + godmode/db/db_purge.php, godmode/db/db_refine.php, + godmode/groups/configure_group.php, godmode/groups/group_list.php, + godmode/modules/manage_nc_groups.php, + godmode/modules/manage_network_components.php, + godmode/modules/manage_network_templates.php, + godmode/modules/manage_network_templates_form.php, + godmode/modules/module_list.php, godmode/profiles/profile_list.php, + godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php, + godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php, + godmode/servers/manage_export_form.php, + godmode/servers/manage_recontask.php, + godmode/servers/manage_recontask_form.php, + godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php, + godmode/setup/links.php, godmode/setup/news.php, + godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php, + godmode/users/user_list.php, operation/agentes/alerts_status.php, + operation/agentes/estado_generalagente.php, + operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php, + operation/agentes/estado_ultimopaquete.php, + operation/agentes/exportdata.php, operation/agentes/networkmap.php, + operation/agentes/status_monitor.php, operation/agentes/tactical.php, + operation/events/events.php, operation/incidents/incident.php, + operation/incidents/incident_detail.php, + operation/incidents/incident_statistics.php, + operation/messages/message.php, operation/reporting/custom_reporting.php, + operation/reporting/graph_viewer.php, + operation/reporting/reporting_viewer.php, operation/servers/view_server.php, + operation/users/user.php, operation/users/user_edit.php, + operation/users/user_statistics.php, operation/visual_console/index.php, + godmode/agentes/agent_template.php: Replaced > with » + + * operation/agentes/datos_agente.php: Return instead of exit + + * include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS + control to preview the OS icon on a select. + + * include/functions_reports.php: Fixed a bug on delete_report() that + returns error when the report has no content. + + * include/functions_ui.php: Removed border attribute on print_os_icon(). + Some fixes to meta refresh element on process_page_head(). Fixed + format_filesize() when length is zero. + + * godmode/menu.php: Replaced link to file manager. Added enterprise hook. + + * godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php + + * include/styles/pandora.css: Textarea width reduced to 99% + + * godmode/setup/setup.php: Added get_os_icon AJAX operation. + + * images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png, + images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to + repository. Mime type icons. + + * extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments. + + * include/functions_filemanager.php: Added to repository. Minimal API for + file manager system. + 2009-04-10 Evi Vanoost * include/functions_db.php: get_group_agents fixed search diff --git a/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql b/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql index 2770fc6ddb..77b10e5fb6 100644 --- a/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v2.x_to_v3.0.sql @@ -1,5 +1,3 @@ - --- Changes on 1x March 09 ALTER TABLE treport_content_sla_combined CHANGE sla_max `sla_max` double(18,2) NOT NULL default 0; ALTER TABLE treport_content_sla_combined CHANGE sla_min `sla_min` double(18,2) NOT NULL default 0; ALTER TABLE treport_content_sla_combined CHANGE sla_limit `sla_limit` double(18,2) NOT NULL default 0; @@ -281,30 +279,19 @@ CREATE TABLE IF NOT EXISTS `tlocal_component_group` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ---Changes added 16 February 2009 - ALTER TABLE tplugin ADD `plugin_type` int(2) UNSIGNED NOT NULL default 0; ALTER TABLE treport_content ADD `description` mediumtext; ALTER TABLE treport_content MODIFY `type` varchar(30) default 'simple_graph'; ALTER TABLE treport_content ADD `id_agent` int(10) unsigned NOT NULL default 0; --- Changes added 19 February 2009 - ALTER TABLE `tmensajes` CHANGE `timestamp` `timestamp` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0'; --- Changes added 20 February 2009 - ALTER TABLE `tevento` CHANGE `event_type` `event_type` ENUM( 'unknown', 'alert_fired', 'alert_recovered', 'alert_ceased', 'alert_manual_validation', 'recon_host_detected', 'system', 'error', 'new_agent', 'going_up_warning', 'going_up_critical', 'going_down_warning', 'going_down_normal', 'going_down_critical', 'going_up_normal' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'unknown'; - --- Changes on 1th April 09 ALTER TABLE tagente ADD `server_name` varchar(255) default ''; ALTER TABLE tevento ADD `user_comment` varchar(255) NOT NULL default ''; ALTER TABLE tusuario ADD `language` varchar(10) default NULL; ALTER TABLE tserver ADD `server_type` tinyint(3) unsigned NOT NULL default '0'; ALTER TABLE tserver ADD `queued_modules` int(5) unsigned NOT NULL default '0'; ALTER TABLE tserver ADD `threads` int(5) unsigned NOT NULL default '0'; - - - diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 81010d759f..95b46c14c9 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -23,15 +23,12 @@ if (isset($_SERVER['REQUEST_TIME'])) { $time = get_system_time (); } -echo 'Pandora FMS '.$pandora_version.' - Build '.$build_version.'
'; +echo ''; +echo 'Pandora FMS '.$pandora_version.' - Build '.$build_version; +echo '
'; echo ''. __('Page generated at') . ' '. print_timestamp ($time, true, array ("prominent" => "timestamp")); //Always use timestamp here - +echo ''; if (isset ($config['debug'])) { echo ' - Saved '.format_numeric ($sql_cache["saved"]).' Queries'; } -echo '
'; -echo ''; -if (file_exists("images/firefox.png")) - print_image ("images/firefox.png", false, array ("align" => "middle", "title" => __('Pandora FMS console is best viewed with Firefox web browser'), "alt" => __('Get Firefox'))); -echo ''; ?> diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 97898c6fc6..6fd4123234 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -32,15 +32,15 @@ if (!isset ($id_agente)) { echo "

".__('Agent configuration'); $new_agent = (bool) get_parameter ('new_agent'); if ($new_agent) { - echo " > ".__('Create agent'); + echo " » ".__('Create agent'); } else { - echo " > ".__('Update agent'); + echo " » ".__('Update agent'); } echo "

"; echo '
 
'; // Agent remote configuration editor -$agent_md5 = md5 ($nombre_agente, FALSE); +$agent_md5 = md5 ($nombre_agente, false); $filename['md5'] = $config["remote_config"] . "/" . $agent_md5 . ".md5"; $filename['conf'] = $config["remote_config"] . "/" . $agent_md5 . ".conf"; @@ -60,14 +60,14 @@ if (isset($_GET["disk_conf_delete"])) { echo '
'; $table->width = '95%'; -$table->cellpadding = 4; -$table->cellspacing = 4; $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][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 (isset ($id_agente) && $id_agente != "") { @@ -83,7 +83,7 @@ if (file_exists ($filename['md5'])) { $table->data[0][1] .= ''.print_help_tip (__('You can remotely edit this agent configuration'), true); } -$table->data[1][0] = ''.__('IP Address').''; +$table->data[1][0] = __('IP Address'); $table->data[1][1] = print_input_text ('direccion', $direccion_agente, '', 16, 100, true); if (! $new_agent) { @@ -98,58 +98,57 @@ if (! $new_agent) { $groups = get_user_groups ($config["id_user"]); $agents = get_group_agents (array_keys ($groups)); -$table->data[2][0] = ''.__('Parent').''; +$table->data[2][0] = __('Parent'); $table->data[2][1] = print_select ($agents, 'id_parent', $id_parent, '', __('None'), 0, true, false, false); //I use get_agent_name because the user might not have rights to the current parent -$table->data[3][0] = ''.__('Group').''; +$table->data[3][0] = __('Group'); $table->data[3][1] = print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 1 ORDER BY nombre', 'grupo', $grupo, '', '', 0, true); -$table->data[4][0] = ''.__('Interval').''; +$table->data[4][0] = __('Interval'); $table->data[4][1] = print_input_text ('intervalo', $intervalo, '', 16, 100, true); -$table->data[5][0] = ''.__('OS').''; +$table->data[5][0] = __('OS'); $table->data[5][1] = print_select_from_sql ('SELECT id_os, name FROM tconfig_os ORDER BY name', 'id_os', $id_os, '', '', '0', true); // Network server -$table->data[6][0] = ''.__('Network Server').''.print_help_tip (__('You must select a Network Server for the Agent, so it can work properly with this kind of modules'), true); +$table->data[6][0] = __('Network Server').print_help_tip (__('You must select a Network Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[6][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name', 'network_server', $id_network_server, '', '', 0, true); // Plugin server -$table->data[7][0] = ''.__('Plugin Server').''.print_help_tip (__('You must select a Plugin Server for the Agent, so it can work properly with this kind of modules'), true); +$table->data[7][0] = __('Plugin Server').print_help_tip (__('You must select a Plugin Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[7][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE plugin_server = 1 ORDER BY name', 'plugin_server', $id_plugin_server, '', '', 0, true); // WMI Server -$table->data[8][0] = ''.__('WMI Server').''.print_help_tip (__('You must select a WMI Server for the Agent, so it can work properly with this kind of modules'), true); +$table->data[8][0] = __('WMI Server').print_help_tip (__('You must select a WMI Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[8][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE wmi_server = 1 ORDER BY name', 'wmi_server', $id_wmi_server, '', '', 0, true); // Prediction Server -$table->data[9][0] = ''.__('Prediction Server').''.print_help_tip (__('You must select a Prediction Server for the Agent, so it can work properly with this kind of modules'), true); +$table->data[9][0] = __('Prediction Server').print_help_tip (__('You must select a Prediction Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[9][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE prediction_server = 1 ORDER BY name', 'prediction_server', $id_prediction_server, '', '', 0, true); // 10 enterprise_hook ('inventory_server'); // Custom ID -$table->data[11][0] = ''.__('Custom ID').''; +$table->data[11][0] = __('Custom ID'); $table->data[11][1] = print_input_text ('custom_id', $custom_id, '', 16, 255, true); // Description -$table->data[12][0] = ''.__('Description').''; +$table->data[12][0] = __('Description'); $table->data[12][1] = print_input_text ('comentarios', $comentarios, '', 45, 255, true); // Learn mode / Normal mode -$table->data[13][0] = ''.__('Module definition').''.print_help_icon("module_definition", true); +$table->data[13][0] = __('Module definition').print_help_icon("module_definition", true); $table->data[13][1] = __('Learning mode').' '.print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true); $table->data[13][1] .= __('Normal mode').' '.print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true); // Status (Disabled / Enabled) -$table->data[14][0] = ''.__('Status').''; +$table->data[14][0] = __('Status'); $table->data[14][1] = __('Disabled').' '.print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true); $table->data[14][1] .= __('Active').' '.print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true); // Remote configuration -$table->data[15][0] = ''.__('Remote configuration').''; - +$table->data[15][0] = __('Remote configuration'); if (file_exists ($filename['md5'])) { $table->data[15][1] = date ("F d Y H:i:s.", fileatime ($filename['md5'])); @@ -157,7 +156,7 @@ if (file_exists ($filename['md5'])) { $table->data[15][1] .= ''; $table->data[15][1] .= print_image ("images/cross.png", true).''; } else { - $table->data[15][1] = ''.__('Not available').''; + $table->data[15][1] = ''.__('Not available').''; } print_table ($table); diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index c60bc226b1..6cc4bb2597 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -85,7 +85,7 @@ if (isset ($_POST["template_id"])) { // Main header -echo "

".__('Agent configuration')." > ".__('Module templates')."

"; +echo "

".__('Agent configuration')." » ".__('Module templates')."

"; // ========================== // TEMPLATE ASSIGMENT FORM @@ -160,4 +160,4 @@ if (!empty ($table->data)) { echo '
No modules
'; } -?> \ No newline at end of file +?> diff --git a/pandora_console/godmode/agentes/manage_config_remote.php b/pandora_console/godmode/agentes/manage_config_remote.php index 0b81ec2657..d853f896eb 100644 --- a/pandora_console/godmode/agentes/manage_config_remote.php +++ b/pandora_console/godmode/agentes/manage_config_remote.php @@ -94,7 +94,7 @@ if ((isset($_GET["operacion"])) AND ($update_group == -1) ) { } else { // title - echo '

'.__('Agent configuration'). ' > '. __('Remote configuration Management').'

'; + echo '

'.__('Agent configuration'). ' » '. __('Remote configuration management').'

'; echo ''; echo ""; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index d1aa19b8fb..596134b114 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -54,7 +54,7 @@ if (isset ($_GET["borrar_agente"])) { // if delete agent exit; } } -echo "

".__('Agent configuration')." > ".__('Agents defined in Pandora')."

"; +echo "

".__('Agent configuration')." » ".__('Agents defined in Pandora')."

"; // Show group selector if (isset($_POST["ag_group"])){ diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index fdbac197cf..e931033f15 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -24,7 +24,7 @@ if (!isset ($id_agente)) { enterprise_include ('godmode/agentes/module_manager.php'); -echo "

".__('Agent configuration')." > ".__('Modules')."

"; +echo "

".__('Agent configuration')." » ".__('Modules')."

"; // Create module/type combo echo '
'; diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index dbdccd392b..13344ead89 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -186,7 +186,7 @@ if ($disable_alert) { } if ($id_agente) { - echo '

'.__('Agent configuration').' > '.__('Alerts').'

'; + echo '

'.__('Agent configuration').' » '.__('Alerts').'

'; $agents = array ($id_agente => get_agent_name ($id_agente)); } else { echo '

'.__('Alerts').'

'; diff --git a/pandora_console/godmode/db/db_audit.php b/pandora_console/godmode/db/db_audit.php index 6ae681ae2a..9a1730dcba 100644 --- a/pandora_console/godmode/db/db_audit.php +++ b/pandora_console/godmode/db/db_audit.php @@ -69,7 +69,7 @@ if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil } # End of get parameters block -echo "

".__('Database Maintenance')." > "; +echo "

".__('Database Maintenance')." » "; echo __('Database Audit purge')."

"; echo "
"; diff --git a/pandora_console/godmode/db/db_event.php b/pandora_console/godmode/db/db_event.php index bbd3133976..ae600ef0ae 100644 --- a/pandora_console/godmode/db/db_event.php +++ b/pandora_console/godmode/db/db_event.php @@ -42,7 +42,7 @@ if (isset ($_POST["date_purge"])){ } # End of get parameters block -echo "

".__('Database Maintenance')." > ".__('Event Database cleanup')."

"; +echo "

".__('Database Maintenance')." » ".__('Event Database cleanup')."

"; $row = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento"); diff --git a/pandora_console/godmode/db/db_info.php b/pandora_console/godmode/db/db_info.php index 6cf20e9f6f..7442a4de0d 100644 --- a/pandora_console/godmode/db/db_info.php +++ b/pandora_console/godmode/db/db_info.php @@ -39,7 +39,7 @@ if (! give_acl ($config['id_user'], 0, "DM")) { - A more powerful selection (by Agent, by Module, etc). */ -echo "

".__('Database Maintenance')." > "; +echo "

".__('Database Maintenance')." » "; echo __('Database Information')."

"; echo '
'; echo '
'; diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index 38ed5bc6d9..234ed123a1 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -37,7 +37,7 @@ if (! give_acl ($config['id_user'], 0, "DM")) { - A more powerful selection (by Agent, by Module, etc). */ -echo '

'.__('Database Maintenance').' > '.__('Current database maintenance setup').'

+echo '

'.__('Database Maintenance').' » '.__('Current database maintenance setup').'

'.__('Max. time before compact data').': '.$config['days_compact'].' '.__('days').'

diff --git a/pandora_console/godmode/db/db_purge.php b/pandora_console/godmode/db/db_purge.php index b0728d46d1..2b0f70f4df 100644 --- a/pandora_console/godmode/db/db_purge.php +++ b/pandora_console/godmode/db/db_purge.php @@ -32,7 +32,7 @@ if (! give_acl ($config['id_user'], 0, "DM")) { //id_agent = -1: None selected; id_agent = 0: All $id_agent = (int) get_parameter_post ("agent", -1); -echo '

'.__('Database Maintenance').' > '.__('Database purge').'

+echo '

'.__('Database Maintenance').' » '.__('Database purge').'



'.__('Get data from agent').'

'; diff --git a/pandora_console/godmode/db/db_refine.php b/pandora_console/godmode/db/db_refine.php index 5ea42c5018..8599c5e3ef 100644 --- a/pandora_console/godmode/db/db_refine.php +++ b/pandora_console/godmode/db/db_refine.php @@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "DM")) { exit; } -echo '

'.__('Database Maintenance').' > '.__('Database debug').'

'; +echo '

'.__('Database Maintenance').' » '.__('Database debug').'

'; if ((isset ($_GET["operacion"])) && (!isset ($_POST["update_agent"]))) { diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index 5cdf307333..beece399db 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -54,7 +54,7 @@ if ($id_group) { } } -echo "

".__('Group management')." > "; +echo "

".__('Group management')." » "; if ($id_group) { echo __('Update group'); } else { diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index c938744804..34a9ff4a05 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -123,7 +123,7 @@ if ($delete_group) { echo "

".__('Group successfully deleted')."

"; } -echo "

".__('Group management')." > "; +echo "

".__('Group management')." » "; echo __('Groups defined in Pandora')."

"; $table->width = '65%'; diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index d3e6a4bec6..f6c38753e2 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -60,7 +60,9 @@ if (give_acl ($config['id_user'], 0, "PM")) { $sub = array (); $sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups'); - $sub["godmode/modules/manage_network_components"]["text"] = __('Module components'); + $sub["godmode/modules/manage_network_components"]["text"] = __('Network components'); + + enterprise_hook ('components_submenu'); $sub["godmode/modules/manage_network_templates"]["text"] = __('Module templates'); @@ -164,7 +166,7 @@ if (give_acl ($config['id_user'], 0, "PM")) { $sub = array (); $sub["godmode/setup/setup_visuals"]["text"] = __('Visual styles'); - $sub["godmode/setup/filemgr"]["text"] = __('File Manager'); + $sub["godmode/setup/file_manager"]["text"] = __('File manager'); $sub["godmode/setup/links"]["text"] = __('Links'); $sub["godmode/setup/news"]["text"] = __('Site news'); $menu["gsetup"]["sub"] = $sub; diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index de3f6995e3..a58d2fc3d9 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -32,7 +32,7 @@ $create = (bool) get_parameter ('create'); $update = (bool) get_parameter ('update'); $delete = (bool) get_parameter ('delete'); -echo '

'.__('Module management').' > '. __('Component group management').'

'; +echo '

'.__('Module management').' » '. __('Component group management').'

'; if ($create) { $name = (string) get_parameter ('name'); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index b91b38ea1a..bb79b286fa 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -134,7 +134,7 @@ if (isset($_GET["delete"])){ // if delete // ------------------ // SHOW MODULES // ------------------ -echo "

".__('Module management')." > "; +echo "

".__('Module management')." » "; echo __('Module component management')."

"; // Show group selector diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index e4fc621dfd..61ce936fd7 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -103,7 +103,7 @@ if ($export_profile) { exit; } -echo "

".__('Module management')." > ".__('Module template management')."

"; +echo "

".__('Module management')." » ".__('Module template management')."

"; $result = get_db_all_rows_in_table ("tnetwork_profile", "name"); diff --git a/pandora_console/godmode/modules/manage_network_templates_form.php b/pandora_console/godmode/modules/manage_network_templates_form.php index 846b0b453c..82d2085610 100644 --- a/pandora_console/godmode/modules/manage_network_templates_form.php +++ b/pandora_console/godmode/modules/manage_network_templates_form.php @@ -98,7 +98,7 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) { $name = ""; } -echo "

".__('Module management')." > ".__('Module template management')."

"; +echo "

".__('Module management')." » ".__('Module template management')."

"; if ($id_np < 1) { echo ''; diff --git a/pandora_console/godmode/modules/module_list.php b/pandora_console/godmode/modules/module_list.php index 40a2163449..f91dac4bc0 100644 --- a/pandora_console/godmode/modules/module_list.php +++ b/pandora_console/godmode/modules/module_list.php @@ -48,7 +48,7 @@ if ($update_module) { echo "

".__('Module updated successfully')."

"; } -echo "

".__('Module management')." > "; +echo "

".__('Module management')." » "; echo __('Defined modules')."

"; echo ""; diff --git a/pandora_console/godmode/profiles/profile_list.php b/pandora_console/godmode/profiles/profile_list.php index 479fa44578..b7f13e2181 100644 --- a/pandora_console/godmode/profiles/profile_list.php +++ b/pandora_console/godmode/profiles/profile_list.php @@ -120,7 +120,7 @@ if ($create_profile) { $id_profile = 0; } -echo '

'.__('Profile management').' > '.$page_title.'

'; +echo '

'.__('Profile management').' » '.$page_title.'

'; // Edit profile if ($id_profile || $new_profile) { diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 37d384875f..6d79353d6c 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -199,7 +199,7 @@ if (! isset($_GET["delete_module"])) { } } -echo "

".__('Reporting')." > "; +echo "

".__('Reporting')." » "; if (isset ($chunk1)) { echo __('Graph builder module list')."

"; echo ""; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 1491d9acaa..343e5d2d78 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -259,7 +259,7 @@ if ($id_layout) { $height = $layout['height']; } -echo "

".__('Reporting')." > ".__('Map builder'); +echo "

".__('Reporting')." » ".__('Map builder'); print_help_icon ("map_builder"); echo "

"; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 80fbe8c322..2451ad2186 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -212,8 +212,8 @@ if ($edit_sla_report_content) { $report_content = get_db_row ('treport_content', 'id_rc', $id_report_content); /* Show all SLAs defined in the report content */ - echo '

'.__('Reporting')." > "; - echo __('Custom reporting builder')." > "; + echo '

'.__('Reporting')." » "; + echo __('Custom reporting builder')." » "; echo ''.$report['name'].'

'; echo '

'.__('SLAs defined')."

"; @@ -290,7 +290,7 @@ if ($edit_sla_report_content) { } elseif ($edit_report || $id_report) { /* Edit and creation report form */ $id_agent = get_parameter_post ("id_agent",0); - echo "

".__('Reporting')." > "; + echo "

".__('Reporting')." » "; echo __('Custom reporting builder'); echo " "; @@ -484,7 +484,7 @@ if ($edit_sla_report_content) { } } else { // Report LIST - echo "

".__('Reporting')." > "; + echo "

".__('Reporting')." » "; echo __('Custom reporting')."

"; $reports = get_reports (array ('order' => 'name'), diff --git a/pandora_console/godmode/servers/manage_export.php b/pandora_console/godmode/servers/manage_export.php index b998d0effe..fd086720ba 100644 --- a/pandora_console/godmode/servers/manage_export.php +++ b/pandora_console/godmode/servers/manage_export.php @@ -86,7 +86,7 @@ if ($create) { } // List export servers -echo "

".__('Pandora servers')." > ".__('export targets')."

"; +echo "

".__('Pandora servers')." » ".__('export targets')."

"; $result = get_db_all_rows_in_table ("tserver_export"); if (!$result) { diff --git a/pandora_console/godmode/servers/manage_export_form.php b/pandora_console/godmode/servers/manage_export_form.php index 6bc410af22..27d9d45e93 100644 --- a/pandora_console/godmode/servers/manage_export_form.php +++ b/pandora_console/godmode/servers/manage_export_form.php @@ -58,7 +58,7 @@ else { $options = ''; } -echo '

'.__('Pandora servers').' > '.__('export targets'); +echo '

'.__('Pandora servers').' » '.__('export targets'); //print_help_icon ("exportserver"); echo '

'; diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 9652ad3630..90c2e4aafb 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -92,7 +92,7 @@ if (isset($_GET["create"])) { // -------------------------------- // SHOW TABLE WITH ALL RECON TASKs // -------------------------------- -echo "

".__('Pandora servers')." > ".__('Manage recontask')."

"; +echo "

".__('Pandora servers')." » ".__('Manage recontask')."

"; $result = get_db_all_rows_in_table ("trecon_task"); $color=1; diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index 909a1f7b82..78a46c9e4e 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -53,7 +53,7 @@ if (isset ($_GET["update"])) { // Edit mode $id_os = -1; // Any } -echo '

'.__('Pandora servers').' > '.__('Manage recontask'); +echo '

'.__('Pandora servers').' » '.__('Manage recontask'); print_help_icon ("recontask"); echo '

'; diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 1f74d028d0..55db2b3f33 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -53,7 +53,7 @@ if (isset ($_GET["delete"])) { if (isset($_GET["server"])) { $id_server= get_parameter_get ("server"); - echo "

".__('Pandora servers')." > ".__('Update Server')."

"; + echo "

".__('Pandora servers')." » ".__('Update Server')."

"; $sql = sprintf("SELECT name, ip_address, description FROM tserver WHERE id_server = %d",$id_server); $row = get_db_row_sql ($sql); echo ''; @@ -76,7 +76,7 @@ if (isset($_GET["server"])) { } else { $result = get_db_all_rows_in_table ("tserver"); - echo "

".__('Pandora servers')." > ".__('Manage servers')."

"; + echo "

".__('Pandora servers')." » ".__('Manage servers')."

"; if ($result !== false) { $table->cellpadding = 4; diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php new file mode 100644 index 0000000000..d1a34d8504 --- /dev/null +++ b/pandora_console/godmode/setup/file_manager.php @@ -0,0 +1,230 @@ +".__('attach_error').""; + } else { + // Delete temporal file + unlink ($_FILES['file']['tmp_name']); + } + + } +} + +if ($delete_file) { + echo "

".__('Deleting file')."

"; + $file = (string) get_parameter ('filename'); + $directory = (string) get_parameter ('directory'); + + $full_filename = $directory.'/'.$file; + if (!is_dir ($full_filename)){ + echo "

".__('Deleting')." ".$full_filename."

"; + unlink ($full_filename); + } +} + +echo "

".__('File manager')."

"; + +$directory = (string) get_parameter ('directory', "/"); + +// CREATE DIR +if ($create_dir) { + $dirname = (string) get_parameter ('dirname'); + if ($dirname) { + @mkdir ($directory.'/'.$dirname); + echo '

'.__('Created directory %s', $dirname).'

'; + } +} + +// A miminal security check to avoid directory traversal +if (preg_match ("/\.\./", $directory)) + $directory = "images"; +if (preg_match ("/^\//", $directory)) + $directory = "images"; +if (preg_match ("/^manager/", $directory)) + $directory = "images"; + +/* Add custom directories here */ +$fallback_directory = "images"; + +$available_directories['images'] = "images"; +$available_directories['attachment'] = "attachment"; +$available_directories['languages'] = "languages"; + +$banned_directories['include'] = true; +$banned_directories['godmode'] = true; +$banned_directories['operation'] = true; +$banned_directories['reporting'] = true; +$banned_directories['general'] = true; +$banned_directories[ENTERPRISE_DIR] = true; + +if (isset ($banned_directories[$directory])) + $directory = $fallback_directory; + +// Current directory +$available_directories[$directory] = $directory; + +$real_directory = realpath ($config['homedir'].'/'.$directory); + +$table->width = '50%'; + +$table->data = array (); + +$table->data[0][0] = __('Directory'); +$table->data[0][1] = print_select (get_file_manager_available_directories (), + 'directory', $directory, '', 'this.form.submit()', '', true, false); + +if (! is_file_manager_writable_dir ($real_directory)) { + echo "

".__('Current directory is not writable by HTTP Server')."

"; + echo '

'; + echo __('Please check that current directory has write rights for HTTP server'); + echo '

'; +} else { + $table->data[1][0] = __('Upload file'); + $table->data[1][1] = print_input_file ('file', true, $options = false); + $table->data[1][2] = print_submit_button (__('Go'), 'go', false, + 'class="sub next"', true); + $table->data[1][2] .= print_input_hidden ('upload_file', 1, true); +} + +echo ''; +print_table ($table); +echo ''; + +echo '

'.__('Index of %s', $directory).'

'; + +// List files +if (! is_dir ($real_directory)) { + echo __('Directory %s doesn\'t exist!', $directory); + return; +} + +$files = list_file_manager_dir ($real_directory); + +if (count ($files) == 0) { + echo __('No files found'); + return; +} + +$table->width = '90%'; +$table->class = 'listing'; + +$table->colspan = array (); +$table->data = array (); +$table->head = array (); +$table->size = array (); + +$table->size[0] = '24px'; + +$table->head[0] = ''; +$table->head[1] = __('Name'); +$table->head[2] = __('Last modification'); +$table->head[3] = __('Size'); +$table->head[4] = ''; + +$prev_dir = split ("/", $directory); +$prev_dir_str = ""; +for ($i = 0; $i < (count ($prev_dir) - 1); $i++) { + $prev_dir_str .= $prev_dir[$i]; + if ($i < (count ($prev_dir) - 2)) + $prev_dir_str .= "/"; +} + +if ($prev_dir_str != '') { + $table->data[0][0] = print_image ('go_previous.png', true); + $table->data[0][1] = ''; + $table->data[0][1] .= __('Parent directory'); + $table->data[0][1] .=''; + + $table->colspan[0][1] = 5; +} + +if (is_writable ($real_directory)) { + $table->data[0][0] = print_image ('images/mimetypes/directory.png', true, + array ('title' => __('Create directory'))); + $table->data[0][1] = ''; + $table->data[0][1] .= print_input_text ('dirname', '', '', 15, 255, true); + $table->data[0][1] .= print_submit_button (__('Create'), 'crt', false, 'class="sub next"', true); + $table->data[0][1] .= print_input_hidden ('directory', $directory, true); + $table->data[0][1] .= print_input_hidden ('create_dir', 1, true); + $table->data[0][1] .= ''; + + $table->colspan[0][1] = 5; +} + +foreach ($files as $fileinfo) { + $data = array (); + + switch ($fileinfo['mime']) { + case MIME_DIR: + $data[0] = print_image ('images/mimetypes/directory.png', true); + break; + case MIME_IMAGE: + $data[0] = print_image ('images/mimetypes/image.png', true); + break; + case MIME_ZIP: + $data[0] = print_image ('images/mimetypes/zip.png', true); + break; + default: + $data[0] = print_image ('images/mimetypes/unknown.png', true); + } + + if ($fileinfo['is_dir']) { + $data[1] = ''.$fileinfo['name'].''; + } else { + $data[1] = ''.$fileinfo['name'].''; + } + $data[2] = print_timestamp ($fileinfo['last_modified'], true, + array ('prominent' => true)); + if ($fileinfo['is_dir']) { + $data[3] = ''; + } else { + $data[3] = format_filesize ($fileinfo['size']); + } + + array_push ($table->data, $data); +} + +print_table ($table); +?> diff --git a/pandora_console/godmode/setup/filemgr.php b/pandora_console/godmode/setup/filemgr.php deleted file mode 100644 index 195b8cb2e6..0000000000 --- a/pandora_console/godmode/setup/filemgr.php +++ /dev/null @@ -1,266 +0,0 @@ -".__("attach_error").""; - } else { - // Delete temporal file - unlink ($_FILES['userfile']['tmp_name']); - } - - } -} - -// Delete file -$delete = get_parameter ("delete", ""); -if ($delete != ""){ - echo "

".__("Deleting file")."

"; - $file = get_parameter ("delete", ""); - $directory = get_parameter ("directory", ""); - - $full_filename = $directory . "/". $file; - if (!is_dir ($full_filename)){ - echo "

".__("Deleting")." ".$full_filename."

"; - unlink ($full_filename); - } -} - -echo "

".__("File manager")."

"; - -$current_directory = get_parameter ("directory", "/"); - -// CREATE DIR -// Upload file -if (isset($_GET["create_dir"])) { - $newdir = get_parameter ("newdir",""); - if ($newdir != ""){ - mkdir($current_directory."/".$newdir); - echo "

".__("Created directory '$newdir'")."

"; - } - -} - - -// A miminal security check to avoid directory traversal -if (preg_match("/\.\./", $current_directory)) - $current_directory = "images"; -if (preg_match("/^\//", $current_directory)) - $current_directory = "images"; -if (preg_match("/^manager/", $current_directory)) - $current_directory = "images"; - -echo ""; -echo "
"; - -echo "
"; -echo __("Base directory"); -echo ""; - - -/* Add custom directories here */ -$fallback_directory = "images"; - -$available_directory["images"] = "images"; -$available_directory["attachment"] = "attachment"; -$available_directory["include/languages"] = "languages"; - -$banned_directory["include"] = 1; -$banned_directory["godmode"] = 1; -$banned_directory["operation"] = 1; -$banned_directory["reporting"] = 1; -$banned_directory["general"] = 1; -$banned_directory["enterprise"] = 1; - -if (isset($banned_directory[$current_directory])) - $current_directory = $fallback_directory; - -// Current directory -$available_directory[$current_directory] = $current_directory; - -print_select ($available_directory, 'directory', $current_directory, '', '', '', false, false); -echo "  "; - -$real_directory = $config["homedir"] . "/". $current_directory; - -if (is_writable($real_directory)) { - echo "
"; - echo __("Upload new file"); - echo ""; - echo ""; - echo "  "; - echo ""; - echo ""; - echo "
"; -} else { - echo ""; - echo "
"; - echo "

".__('Current directory is not writtable by HTTP Server')."

"; - echo '

'; - echo __('Please check that current directory has write rights for HTTP server'); - echo "

"; -} - - -echo "

".__("Current directory"). " : ".$current_directory . "

"; -// Upload form - - // List files - - $directoryHandler = ""; - $result = array (); - if (! $directoryHandler = @opendir ($real_directory)) { - echo ("
\nerror: directory \"$current_directory\" doesn't exist!\n
\n"); - return 0; - } - - while (false !== ($fileName = @readdir ($directoryHandler))) { - $result[$fileName] = $fileName; - // TODO: Read filetype (image, directory) - // If directory create a link to navigate. - } - asort($result, SORT_STRING); - - if (@count ($result) === 0) { - echo __ ("No files found"); - } else { - asort ($result); - - echo ""; - - $prev_dir = split( "/", $current_directory ); - $prev_dir_str = ""; - for ($ax = 0; $ax < (count($prev_dir)-1); $ax++){ - - $prev_dir_str .= $prev_dir[$ax]; - if ($ax < (count($prev_dir)-2)) - $prev_dir_str .= "/"; - } - - if ($prev_dir_str != ""){ - echo ""; - } - echo "
"; - echo "".__("Go prev. directory")." "; - echo "
"; - echo __ ("Filename"); - echo ""; - echo __ ("Image info"); - echo ""; - echo __ ("Last update"); - echo ""; - echo __ ("Owner"); - echo ""; - echo __ ("Perms"); - echo ""; - echo __ ("Filesize"); - echo ""; - echo __ ("File type"); - echo ""; - echo __ ("Directory"); - echo ""; - echo __ ("Del"); - while (@count($result) > 0){ - $temp = array_shift ($result); - $fullfilename = $current_directory.'/'.$temp; - $mimetype = ""; - if (($temp != "..") AND ($temp != ".")){ - echo "
"; - if (!is_dir ($current_directory.'/'.$temp)){ - echo "$temp"; - } else - echo "/$temp"; - - echo ""; - if (preg_match("/image/", $mimetype)){ - list($ancho, $altura, $tipo, $atr) = getimagesize($fullfilename); - echo $ancho."x".$altura; - } - echo ""; - if (!is_dir ($fullfilename)) - echo date("F d Y H:i:s.", filemtime($fullfilename)); - echo ""; - if (!is_dir ($fullfilename)) - echo fileowner($fullfilename); - - echo ""; - if (!is_dir ($fullfilename)) - if (!is_readable($fullfilename)) - echo ""; - echo __("Read"); - - echo ""; - if (!is_dir ($fullfilename)) - echo filesize($fullfilename); - else - echo "<DIR>"; - - echo ""; - if (!is_dir ($fullfilename)) - echo $mimetype; - else - echo "<DIR>"; - - echo ""; - if (!is_dir ($fullfilename)) - echo ""; - else - echo ""; - echo ""; - echo ""; - } - } - echo "
"; - - if (is_writable($current_directory)){ - echo "

"; - echo "
"; - echo __("Create directory"); - echo "  "; - echo ""; - echo "  "; - echo ""; - echo "
"; - } - } - - -?> - diff --git a/pandora_console/godmode/setup/links.php b/pandora_console/godmode/setup/links.php index 161906dbf9..fe99de1d42 100644 --- a/pandora_console/godmode/setup/links.php +++ b/pandora_console/godmode/setup/links.php @@ -83,7 +83,7 @@ if (! give_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_use } // Create link - echo "

".__('Pandora Setup')." > "; + echo "

".__('Pandora Setup')." » "; echo __('Link management')."

"; echo ''; echo ''; @@ -111,7 +111,7 @@ if (! give_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_use } else { // Main list view for Links editor - echo "

".__('Pandora Setup')." > "; + echo "

".__('Pandora Setup')." » "; echo __('Link management')."

"; echo "
"; echo ""; diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index a6e7d852a7..63dd6f6c6d 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -88,7 +88,7 @@ if ((isset ($_GET["form_add"])) || (isset ($_GET["form_edit"]))) { } // Create news - echo "

".__('Pandora Setup')." > "; + echo "

".__('Pandora Setup')." » "; echo __('Site news management')."

"; echo '
".__('Link name')."
'; echo ''; @@ -117,7 +117,7 @@ if ((isset ($_GET["form_add"])) || (isset ($_GET["form_edit"]))) { "; echo '
'; } else { // Main list view for Links editor - echo "

".__('Pandora Setup')." > "; + echo "

".__('Pandora Setup')." » "; echo __('Site news management')."

"; echo ""; echo ""; diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 7417a273c3..f4a3960a6d 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -21,12 +21,24 @@ require_once ("include/config.php"); check_login (); +if (is_ajax ()) { + $get_os_icon = (bool) get_parameter ('get_os_icon'); + + if ($get_os_icon) { + $id_os = (int) get_parameter ('id_os'); + print_os_icon ($id_os, false); + return; + } + + return; +} + + if (! give_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Setup Management"); require ("general/noaccess.php"); return; } - // Load enterprise extensions enterprise_include ('godmode/setup/setup.php'); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index ad441421e4..f7f8a2d3f0 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -41,7 +41,7 @@ enterprise_include ('godmode/setup/setup_visuals.php'); require_once ('include/functions_themes.php'); -echo "

".__('Setup')." > "; +echo "

".__('Setup')." » "; echo __('Visual configuration')."

"; $table->width = '90%'; diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 4c93b15772..798c486cc6 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -137,9 +137,9 @@ if ((isset ($_GET["update_alert"])) && ($_GET["update_alert"] != -1)) { if (isset ($_GET["update_alert"])) { //the update_alert means the form should be displayed. If update_alert > 1 then an existing alert is updated if ($id_as) { - echo "

Pandora SNMP > ".__('Update alert')."

"; + echo "

".__('Update alert')."

"; } else { - echo "

Pandora SNMP > ".__('Create alert')."

"; + echo "

".__('Create alert')."

"; } echo ''; echo '
".__('Subject')."
'; @@ -250,7 +250,7 @@ if (isset ($_GET["update_alert"])) { // End table echo "
"; } else { - echo "

Pandora SNMP > ".__('Alert Overview')."

"; + echo "

".__('Alert Overview')."

"; //Overview $result = get_db_all_rows_in_table ("talert_snmp"); if ($result === false) { diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 82c0255c8d..a7ea660045 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -157,7 +157,7 @@ if ($delete_profile) { __('Could not be deleted')); } -echo "

".__('Pandora users')." > ".__('User detail editor')."

"; +echo "

".__('Pandora users')." » ".__('User detail editor')."

"; $table->width = '50%'; $table->data = array (); diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 6e8d18acca..8add74c61e 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -42,7 +42,7 @@ if (isset ($_GET["user_del"])) { //delete user __('There was a problem deleting the profile')); } -echo '

'.__('User management').' > '.__('Users defined in Pandora').'

'; +echo '

'.__('User management').' » '.__('Users defined in Pandora').'

'; $table->cellpadding = 4; $table->cellspacing = 4; diff --git a/pandora_console/images/mimetypes/directory.png b/pandora_console/images/mimetypes/directory.png new file mode 100644 index 0000000000..b67403d9fe Binary files /dev/null and b/pandora_console/images/mimetypes/directory.png differ diff --git a/pandora_console/images/mimetypes/image.png b/pandora_console/images/mimetypes/image.png new file mode 100644 index 0000000000..68da5027cf Binary files /dev/null and b/pandora_console/images/mimetypes/image.png differ diff --git a/pandora_console/images/mimetypes/unknown.png b/pandora_console/images/mimetypes/unknown.png new file mode 100644 index 0000000000..2d7f2d6017 Binary files /dev/null and b/pandora_console/images/mimetypes/unknown.png differ diff --git a/pandora_console/images/mimetypes/zip.png b/pandora_console/images/mimetypes/zip.png new file mode 100644 index 0000000000..9015426153 Binary files /dev/null and b/pandora_console/images/mimetypes/zip.png differ diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php new file mode 100644 index 0000000000..9b8904ab6b --- /dev/null +++ b/pandora_console/include/functions_filemanager.php @@ -0,0 +1,216 @@ + 'text/plain', + 'htm' => 'text/html', + 'html' => 'text/html', + 'php' => 'text/html', + 'css' => 'text/css', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'xml' => 'application/xml', + 'swf' => 'application/x-shockwave-flash', + 'flv' => 'video/x-flv', + // images + 'png' => 'image/png', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'gif' => 'image/gif', + 'bmp' => 'image/bmp', + 'ico' => 'image/vnd.microsoft.icon', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + // archives + 'zip' => 'application/zip', + 'rar' => 'application/x-rar-compressed', + 'exe' => 'application/x-msdownload', + 'msi' => 'application/x-msdownload', + 'cab' => 'application/vnd.ms-cab-compressed', + 'gz' => 'application/x-gzip', + 'gz' => 'application/x-bzip2', + // audio/video + 'mp3' => 'audio/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + // adobe + 'pdf' => 'application/pdf', + 'psd' => 'image/vnd.adobe.photoshop', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + // ms office + 'doc' => 'application/msword', + 'rtf' => 'application/rtf', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + // open office + 'odt' => 'application/vnd.oasis.opendocument.text', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet' + ); + + $ext = strtolower (array_pop (explode ('.', $filename))); + if (array_key_exists ($ext, $mime_types)) { + return $mime_types[$ext]; + } elseif (function_exists ('finfo_open')) { + $finfo = finfo_open (FILEINFO_MIME); + $mimetype = finfo_file ($finfo, $filename); + finfo_close ($finfo); + return $mimetype; + } else { + return 'application/octet-stream'; + } + } +} + + +/** + * Get the available directories of the file manager. + * + * @return array An array with all the directories where the file manager can + * operate. + */ +function get_file_manager_available_directories () { + $dirs = array (); + $dirs['images'] = "images"; + $dirs['attachment'] = "attachment"; + $dirs['languages'] = "languages"; + + return $dirs; +} + +/** + * Check if a dirname is available for the file manager. + * + * @param string Dirname to check. + * + * @return array An array with all the directories where the file manager can + * operate. + */ +function is_file_manager_available_directory ($dirname) { + $dirs = get_file_manager_available_directories (); + return isset ($dirs[$dirname]); +} + +/** + * Check if a directory is writable. + * + * @param string Directory path to check. + * @param bool If set, it will try to make the directory writeable if it's not. + * + * @param bool Wheter the directory is writeable or not. + */ +function is_file_manager_writable_dir ($dirpath, $force = false) { + if (! is_file_manager_available_directory (basename ($dirpath))) + return false; + if (! $force) + return is_writable ($dirpath); + return (is_writable ($dirpath) || @chmod ($dirpath, 0755)); +} + +/** + * Check if a directory is writable. + * + * @param string Directory path to check. + * @param bool If set, it will try to make the directory writeable if it's not. + * + * @param bool Wheter the directory is writeable or not. + */ +function get_file_manager_file_info ($filepath) { + global $config; + + $realpath = realpath ($filepath); + + $info = array ('mime' => MIME_UNKNOWN, + 'mime_extend' => mime_content_type ($filepath), + 'link' => 0, + 'is_dir' => false, + 'name' => basename ($realpath), + 'url' => $config['homeurl'].str_ireplace ($config['homedir'], '', $realpath), + 'realpath' => $realpath, + 'size' => filesize ($realpath), + 'last_modified' => filemtime ($realpath) + ); + + $zip_mimes = array ('application/zip', + 'application/x-rar-compressed', + 'application/x-gzip', + 'application/x-bzip2'); + if (is_dir ($filepath)) { + $info['mime'] = MIME_DIR; + $info['is_dir'] = true; + $info['size'] = 0; + } else if (strpos ($info['mime_extend'], 'image') === 0) { + $info['mime'] = MIME_IMAGE; + } else if (in_array ($info['mime_extend'], $zip_mimes)) { + $info['mime'] = MIME_ZIP; + } + + return $info; +} + +/** + * Check if a directory is writable. + * + * @param string Directory path to check. + * @param bool If set, it will try to make the directory writeable if it's not. + * + * @param bool Wheter the directory is writeable or not. + */ +function list_file_manager_dir ($dirpath) { + $files = array (); + $dirs = array (); + $dir = opendir ($dirpath); + while ($file = @readdir ($dir)) { + /* Ignore hidden files */ + if ($file[0] == '.') + continue; + $info = get_file_manager_file_info ($dirpath.'/'.$file); + if ($info['is_dir']) { + $dirs[$file] = $info; + } else { + $files[$file] = $info; + } + } + ksort ($files); + ksort ($dirs); + closedir ($dir); + + return array_merge ($dirs, $files); +} +?> diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 7ba8757c37..de867920be 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -673,7 +673,7 @@ function get_group_agents_detailed_reporting ($id_group, $period = 0, $date = 0, if ($return === false) echo $output; - + return $output; } diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 0b88691e9b..b745f4141b 100644 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -138,10 +138,8 @@ function delete_report ($id_report) { $report = get_report ($id_report); if ($report === false) return false; - $res1 = @process_sql_delete ('treport_content', array ('id_report' => $id_report)); - $res2 = @process_sql_delete ('treport', array ('id_report' => $id_report)); - - return $res1 && $res2; + @process_sql_delete ('treport_content', array ('id_report' => $id_report)); + return @process_sql_delete ('treport', array ('id_report' => $id_report)); } /** diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 6628a3f036..1b05bfa52b 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -230,7 +230,7 @@ function print_os_icon ($id_os, $name = true, $return = false) { return "-"; } - $output = ''.$os_name.''; + $output = ''.$os_name.''; if ($name === true) { $output .= ' - '.$os_name; @@ -583,14 +583,15 @@ function process_page_head ($string, $bitfield) { if ($config['https']) { /* Check with "on" because some web servers like Cherokee always set this value even if SSL is not enabled */ - if (isset ($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == true || $_SERVER['HTTPS'] == 'on')) { + if (isset ($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === true || $_SERVER['HTTPS'] == 'on')) { $protocol = 'https'; $ssl = true; } } $query = $protocol.'://' . $_SERVER['SERVER_NAME']; - if ($_SERVER['SERVER_PORT'] != 80 && ($ssl && $_SERVER['SERVER_PORT'] != 443)) { + + if ((!$ssl && $_SERVER['SERVER_PORT'] != 80) || ($ssl && $_SERVER['SERVER_PORT'] != 443)) { $query .= ":".$_SERVER['SERVER_PORT']; } $query .= $_SERVER['SCRIPT_NAME']; @@ -997,7 +998,7 @@ function print_moduletype_icon ($id_moduletype, $return = false) { function format_filesize ($bytes) { $bytes = (int) $bytes; $strs = array ('B', 'kB', 'MB', 'GB', 'TB'); - if ($bytes < 0) { + if ($bytes <= 0) { return "0 ".$strs[0]; } $con = 1024; @@ -1013,47 +1014,48 @@ function format_filesize ($bytes) { * * @return array An array with the image path, image width and image height. */ -function get_status_images_path() -{ +function get_status_images_path () { global $config; $imageset = $config["status_images_set"]; - if (strpos($imageset, ",") === false) $imageset .= ",40x18"; - list($imageset, $sizes) = split(",", $imageset, 2); + if (strpos ($imageset, ",") === false) + $imageset .= ",40x18"; + list ($imageset, $sizes) = split (",", $imageset, 2); - if (strpos($sizes, "x") === false) $sizes .= "x18"; - list($imagewidth, $imageheight) = split("x", $sizes, 2); // 40x18 + if (strpos ($sizes, "x") === false) + $sizes .= "x18"; + list ($imagewidth, $imageheight) = split ("x", $sizes, 2); - $imagespath = "images/status_sets/$imageset"; + $imagespath = 'images/status_sets/'.$imageset; - return array($imagespath); + return array ($imagespath); } -define('STATUS_MODULE_OK', 'module_ok.png'); -define('STATUS_MODULE_CRITICAL', 'module_critical.png'); -define('STATUS_MODULE_WARNING', 'module_warning.png'); +define ('STATUS_MODULE_OK', 'module_ok.png'); +define ('STATUS_MODULE_CRITICAL', 'module_critical.png'); +define ('STATUS_MODULE_WARNING', 'module_warning.png'); -define('STATUS_AGENT_CRITICAL', 'agent_critical.png'); -define('STATUS_AGENT_WARNING', 'agent_warning.png'); -define('STATUS_AGENT_DOWN', 'agent_down.png'); -define('STATUS_AGENT_OK', 'agent_ok.png'); -define('STATUS_AGENT_NO_DATA', 'agent_no_data.png'); -define('STATUS_AGENT_NO_MONITORS', 'agent_no_monitors.png'); +define ('STATUS_AGENT_CRITICAL', 'agent_critical.png'); +define ('STATUS_AGENT_WARNING', 'agent_warning.png'); +define ('STATUS_AGENT_DOWN', 'agent_down.png'); +define ('STATUS_AGENT_OK', 'agent_ok.png'); +define ('STATUS_AGENT_NO_DATA', 'agent_no_data.png'); +define ('STATUS_AGENT_NO_MONITORS', 'agent_no_monitors.png'); -define('STATUS_ALERT_FIRED', 'alert_fired.png'); -define('STATUS_ALERT_NOT_FIRED', 'alert_not_fired.png'); -define('STATUS_ALERT_DISABLED', 'alert_disabled.png'); +define ('STATUS_ALERT_FIRED', 'alert_fired.png'); +define ('STATUS_ALERT_NOT_FIRED', 'alert_not_fired.png'); +define ('STATUS_ALERT_DISABLED', 'alert_disabled.png'); -define('STATUS_SERVER_OK', 'server_ok.png'); -define('STATUS_SERVER_DOWN', 'server_down.png'); - -function print_status_image($type, $title = "", $return = false) { - list($imagepath) = get_status_images_path(); +define ('STATUS_SERVER_OK', 'server_ok.png'); +define ('STATUS_SERVER_DOWN', 'server_down.png'); +function print_status_image ($type, $title = "", $return = false) { + list ($imagepath) = get_status_images_path (); + $imagepath .= "/" . $type; - - return print_image ($imagepath, $return, array ("border" => 0, "title" => $title)); + + return print_image ($imagepath, $return, array ("title" => $title)); } ?> diff --git a/pandora_console/include/javascript/jquery.pandora.controls.js b/pandora_console/include/javascript/jquery.pandora.controls.js index ae8b65e519..1fab5751e1 100644 --- a/pandora_console/include/javascript/jquery.pandora.controls.js +++ b/pandora_console/include/javascript/jquery.pandora.controls.js @@ -164,9 +164,52 @@ }; } }); + + $.extend ({ + pandoraSelectOS: new function() { + this.defaults = { + alertSelect: "select#id_od", + spanPreview: "#os_preview", + debug: false + }; + + /* public methods */ + this.construct = function (settings) { + return this.each (function() { + this.config = {}; + this.config = $.extend (this.config, $.pandoraSelectOS.defaults, settings); + + var config = this.config; + + $(this).change (function () { + var id_os = this.value; + + $(config.spanPreview).fadeOut ('fast', function () { + $("img", config.spanPreview).remove (); + jQuery.post ('ajax.php', + {"page": "godmode/setup/setup", + "get_os_icon": 1, + "id_os": id_os + }, + function (data) { + $(config.spanPreview) + .append (data) + .fadeIn ('fast'); + }, + "html" + ); + }); + + }); + }); + }; + } + }); + $.fn.extend({ pandoraSelectGroup: $.pandoraSelectGroup.construct, pandoraSelectAgentModule: $.pandoraSelectAgentModule.construct, - pandoraSelectAgentAlert: $.pandoraSelectAgentAlert.construct + pandoraSelectAgentAlert: $.pandoraSelectAgentAlert.construct, + pandoraSelectOS: $.pandoraSelectOS.construct }); }) (jQuery); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 5357ff6e7d..3c5b2273b6 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -35,7 +35,7 @@ input, textarea { textarea { padding: 5px; min-height: 100px; - width: 100%; + width: 99%; } textarea.conf_editor { padding: 5px; diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index fe6a9ab5c6..759ba11329 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -102,7 +102,7 @@ if ($tab != '') { $url = $url.'&tab='.$tab; } -echo "

".__('Pandora Agents')." > ".__('Alerts').'

'; +echo "

".__('Pandora Agents')." » ".__('Alerts').'

'; echo ''; diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index be5efcec8c..daa72c470b 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], $group, "AR") || $module_id == 0) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Agent Data view"); require ("general/noaccess.php"); - exit; + return; } if (isset ($_GET["delete"])) { diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index fdb856c392..60c29699dc 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -53,7 +53,7 @@ $ag_group = get_parameter ("ag_group", $group_id); $ag_group = get_parameter_get ("ag_group_refresh", $ag_group); //if it isn't set, defaults to prev. value $search = get_parameter ("search", ""); -echo "

".__('Pandora Agents')." > ".__('Summary')."

"; +echo "

".__('Pandora Agents')." » ".__('Summary')."

"; // Show group selector (POST) if (isset($_POST["ag_group"])){ diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index e8ee80437f..090e1d77ec 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -36,7 +36,7 @@ if (! give_acl ($config["id_user"], $agent["id_grupo"], "AR")) { return; } -echo "

".__('Pandora Agents')." > ".__('Agent general information')."

"; +echo "

".__('Pandora Agents')." » ".__('Agent general information')."

"; // Blank space below title echo '
 
'; diff --git a/pandora_console/operation/agentes/estado_grupo.php b/pandora_console/operation/agentes/estado_grupo.php index 8131d93e0b..212451b0c8 100644 --- a/pandora_console/operation/agentes/estado_grupo.php +++ b/pandora_console/operation/agentes/estado_grupo.php @@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "AR")) { require ("general/noaccess.php"); exit; } -echo "

".__('Pandora Agents')." > ".__('Group view')."

"; +echo "

".__('Pandora Agents')." » ".__('Group view')."

"; // Update network modules for this group // Check for Network FLAG change request diff --git a/pandora_console/operation/agentes/estado_ultimopaquete.php b/pandora_console/operation/agentes/estado_ultimopaquete.php index 3a6af2cf0f..2c977da6c9 100644 --- a/pandora_console/operation/agentes/estado_ultimopaquete.php +++ b/pandora_console/operation/agentes/estado_ultimopaquete.php @@ -46,7 +46,7 @@ $label_group = 0; $last_label = ""; // Title -echo "

".__('Pandora Agents')." > "; +echo "

".__('Pandora Agents')." » "; echo __('Display of last data modules received by agent'); echo " "; echo "

"; diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index b18acb381f..f326f53fe3 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -98,7 +98,7 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){ $export_type = 3; // Standard table; // Header - echo "

".__('Pandora Agents')." > "; + echo "

".__('Pandora Agents')." » "; echo __('Database export results')."

"; if ($export_type == 1) { // CSV @@ -246,7 +246,7 @@ if ((isset($_POST["export"])) AND (! isset($_POST["update_agent"]))){ $config['js'][] = 'calendar'; - echo "

".__('Pandora Agents')." > "; + echo "

".__('Pandora Agents')." » "; echo __('Export data')."

"; echo ''; diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 9181bf6648..3ba2d76656 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -253,7 +253,7 @@ $simple = (boolean) get_parameter ('simple', 0); $regen = (boolean) get_parameter ('regen',1); // Always regen by default $font_size = (int) get_parameter ('font_size', 12); -echo '

'.__('Pandora Agents').' > '.__('Network Map').' '; +echo '

'.__('Pandora Agents').' » '.__('Network Map').' '; if ($pure == 1) { echo ''; print_image ("images/monitor.png", false, array ('title' => __('Normal screen'), 'alt' => __('Normal screen'))); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index f2de50de1d..7c6f152158 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -30,7 +30,7 @@ if (! give_acl ($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], exit; } -echo "

".__('Pandora Agents')." > ".__('Full list of Monitors')."

"; +echo "

".__('Pandora Agents')." » ".__('Full list of Monitors')."

"; $ag_freestring = get_parameter ("ag_freestring", ""); $ag_modulename = get_parameter ("ag_modulename", ""); diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index a81daf524c..828c1b8801 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -47,7 +47,7 @@ function print_cells_temp ($cells) { } -echo "

".__('Pandora Agents')." > ".__('Tactical view')."

"; +echo "

".__('Pandora Agents')." » ".__('Tactical view')."

"; $data = get_group_stats (); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 11685b6c90..6f90b4e5a4 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -171,7 +171,7 @@ $url = "index.php?sec=eventos&sec2=operation/events/events&search=".rawu echo ''; -echo "

".__('Events')." > ".__('Main event view'). " "; +echo "

".__('Events')." » ".__('Main event view'). " "; if ($config["pure"] == 1) { echo ''; diff --git a/pandora_console/operation/incidents/incident.php b/pandora_console/operation/incidents/incident.php index f456075d4c..8af80fce3e 100644 --- a/pandora_console/operation/incidents/incident.php +++ b/pandora_console/operation/incidents/incident.php @@ -172,7 +172,7 @@ if (empty ($result)) { $count = count ($result); } -echo '

'.__('Incident management').' > '.__('Manage incidents').'

+echo '

'.__('Incident management').' » '.__('Manage incidents').'

'.__('Filter').'

'; diff --git a/pandora_console/operation/incidents/incident_detail.php b/pandora_console/operation/incidents/incident_detail.php index 1a3b9c8faf..d951309752 100644 --- a/pandora_console/operation/incidents/incident_detail.php +++ b/pandora_console/operation/incidents/incident_detail.php @@ -207,10 +207,10 @@ echo "