From f43a9becea4e1bf0c73db27aa14b781ce675ff65 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 4 Mar 2010 16:22:25 +0000 Subject: [PATCH] 2010-03-04 Sancho Lerena * pandoradb_data.sql: Added news, default timezone and other minor changes. GIS is disabled by default now. * include/config_process.php: Force a timezone if not defined. * operation/gis_maps/index.php, operation/agentes/gis_view.php: Config.php and header stuff * operation/servers/view_server_detail.php operation/menu.php: Recon operation detail is now shown in the left menu. * admin_access_logs.php, db/db_audit.php db/db_info.php db/db_event.php agentes/configurar_agente.php gis_maps/configure_gis_map.php gis_maps/index.php: More headers and config.php include stuff. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2469 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 22 ++++++++++++++ pandora_console/godmode/admin_access_logs.php | 5 ++-- .../godmode/agentes/configurar_agente.php | 6 ++++ pandora_console/godmode/db/db_audit.php | 5 ++-- pandora_console/godmode/db/db_event.php | 4 +-- pandora_console/godmode/db/db_info.php | 4 +-- .../godmode/gis_maps/configure_gis_map.php | 3 ++ pandora_console/godmode/gis_maps/index.php | 2 +- pandora_console/include/config_process.php | 6 +++- .../operation/agentes/gis_view.php | 3 +- pandora_console/operation/gis_maps/index.php | 6 ++-- pandora_console/operation/menu.php | 16 ++++++++++ .../operation/servers/view_server_detail.php | 19 +++++------- pandora_console/pandoradb_data.sql | 29 +++++++++---------- 14 files changed, 86 insertions(+), 44 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d20e12eacd..1ea51cd369 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,25 @@ +2010-03-04 Sancho Lerena + + * pandoradb_data.sql: Added news, default timezone and other + minor changes. GIS is disabled by default now. + + * include/config_process.php: Force a timezone if not defined. + + * operation/gis_maps/index.php, + operation/agentes/gis_view.php: Config.php and header stuff + + * operation/servers/view_server_detail.php + operation/menu.php: Recon operation detail is now shown in the left + menu. + + * admin_access_logs.php, + db/db_audit.php + db/db_info.php + db/db_event.php + agentes/configurar_agente.php + gis_maps/configure_gis_map.php + gis_maps/index.php: More headers and config.php include stuff. + 2010-03-04 Raúl Mateos * (lot of files): Updated year and headers. diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 81e0454efc..954a61c933 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -29,13 +29,14 @@ if (! give_acl ($config['id_user'], 0, "PM")) { exit; } -echo "

" . __('Pandora audit') . " » " .__('Review Logs') . "

"; +print_page_header (__('Pandora audit')." » ".__('Review Logs'), "", false, "", true ); + $offset = get_parameter ("offset", 0); $tipo_log = get_parameter ("tipo_log", 'all'); echo ''; echo "
"; -echo '

'.__('Filter').'

'; +echo ''.__('Filter').''; echo "
"; if ($config['flash_charts']) { echo graphic_user_activity (300, 140); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 8ae5fde767..a7159bad3f 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -247,6 +247,12 @@ if ($id_agente) { // IE might not always show an empty div, added space echo '
 
'; } +// Create agent +else { + + print_page_header (__('Agent manager'), "images/bricks.png", false, "", true); + +} $delete_conf_file = (bool) get_parameter('delete_conf_file'); diff --git a/pandora_console/godmode/db/db_audit.php b/pandora_console/godmode/db/db_audit.php index e6c731b011..ac7ce8bb6d 100644 --- a/pandora_console/godmode/db/db_audit.php +++ b/pandora_console/godmode/db/db_audit.php @@ -16,6 +16,8 @@ // Load global vars global $config; +print_page_header (__('Database audit purge'), "", false, "", true); + check_login (); if (! give_acl ($config['id_user'], 0, "DM")) { @@ -66,9 +68,6 @@ if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil } # End of get parameters block -echo "

".__('Database maintenance')." » "; -echo __('Database audit purge')."

"; - echo ""; echo "
"; $result = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(fecha) AS first_date, MAX(fecha) AS latest_date FROM tsesion"); diff --git a/pandora_console/godmode/db/db_event.php b/pandora_console/godmode/db/db_event.php index 2e314ba608..ae98602d90 100644 --- a/pandora_console/godmode/db/db_event.php +++ b/pandora_console/godmode/db/db_event.php @@ -18,6 +18,8 @@ global $config; check_login (); +print_page_header (__('Event database cleanup'), "", false, "", true); + if (! give_acl ($config['id_user'], 0, "DM")) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management Event"); require ("general/noaccess.php"); @@ -39,8 +41,6 @@ if (isset ($_POST["date_purge"])){ } # End of get parameters block -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"); $table->data = array (); diff --git a/pandora_console/godmode/db/db_info.php b/pandora_console/godmode/db/db_info.php index 5ac21c25f5..1a2b86ca5f 100644 --- a/pandora_console/godmode/db/db_info.php +++ b/pandora_console/godmode/db/db_info.php @@ -22,6 +22,8 @@ if ($config['flash_charts']) { require('include/fgraph.php'); } +print_page_header (__('Database information'), "", false, "", true); + check_login (); if (! give_acl ($config['id_user'], 0, "DM")) { @@ -40,8 +42,6 @@ if (! give_acl ($config['id_user'], 0, "DM")) { - A more powerful selection (by Agent, by Module, etc). */ -echo "

".__('Database maintenance')." » "; -echo __('Database information')."

"; if ($config['flash_charts']) { $width=600; diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index c06e78759e..06e17f38f2 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -17,6 +17,9 @@ global $config; check_login (); +print_page_header (__('GIS Maps builder'), "images/server_web.png", false, "gis_map_builder", true); + + require_once ('include/functions_gis.php'); require_javascript_file('openlayers.pandora'); diff --git a/pandora_console/godmode/gis_maps/index.php b/pandora_console/godmode/gis_maps/index.php index 4b13080a47..aca423d884 100644 --- a/pandora_console/godmode/gis_maps/index.php +++ b/pandora_console/godmode/gis_maps/index.php @@ -53,7 +53,7 @@ switch ($action) { break; } -print_page_header (__('GIS Maps builder'), "images/server_web.png", false, "gis_map_builder", true); +print_page_header (__('GIS Maps builder'), "images/server_web.png", false, "", true); $table->width = '500px'; $table->head[0] = __('Map name'); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 59508cd091..7939485326 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC100301'; // Remember is YYMMDD +$build_version = 'PC100303'; // Remember is YYMMDD $pandora_version = 'v3.1-dev'; /* Help to debug problems. Override global PHP configuration */ @@ -76,6 +76,10 @@ $config["remote_addr"] = $_SERVER['REMOTE_ADDR']; $config['user_language'] = $config["language"]; // Set a the system timezone default +if ((!isset($config["timezone"])) OR ($config["timezone"] == "")){ + $config["timezone"] = "Europe/Berlin"; +} + date_default_timezone_set($config["timezone"]); // Set user language if provided, overriding System language diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index 3ea7460140..36a458c3d5 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -35,11 +35,10 @@ $agentId = get_parameter('id_agente'); $agent_name = get_agent_name($agentId); $agentData = getDataLastPositionAgent($id_agente); -echo "

".__('Received data from')." ". $agent_name . "

"; echo "

" . __("Map with the last position/s") . " " . human_time_description ($period) ."

"; /* Map with the current position */ -echo "
"; +echo "
"; if (!getAgentMap($agentId, "500px", "98%", true, true, $period)) { echo "
" . __("There is no default map.") . "
"; } diff --git a/pandora_console/operation/gis_maps/index.php b/pandora_console/operation/gis_maps/index.php index 10d0f826b4..fabe3c2fc5 100644 --- a/pandora_console/operation/gis_maps/index.php +++ b/pandora_console/operation/gis_maps/index.php @@ -14,7 +14,7 @@ */ // Load global vars -require_once ("include/config.php"); +global $config; // Login check check_login (); @@ -23,7 +23,7 @@ require_once ('include/functions_gis.php'); require_javascript_file('openlayers.pandora'); -print_page_header(__('GIS Maps')." » ".__('Summary'), "images/server_web.png", false, "gis_map_summary"); +print_page_header(__('GIS Maps')." » ".__('Summary'), "images/server_web.png", false, ""); $maps = getMaps(); @@ -66,4 +66,4 @@ if (!empty ($table->data)) { echo '
'.__('No maps found').'
'; } unset ($table); -?> \ No newline at end of file +?> diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 2afe5b30a8..4fe00aba11 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -118,6 +118,22 @@ if (give_acl ($config['id_user'], 0, "AR")) { $menu["estado_server"]["text"] = __('Pandora servers'); $menu["estado_server"]["sec2"] = "operation/servers/view_server"; $menu["estado_server"]["id"] = "oper-servers"; + + $sub = array (); + // Show all recon servers, and generate menu for details + + $servers = get_db_all_rows_sql ('SELECT * FROM tserver WHERE server_type = 3'); + if ($servers === false) { + $servers = array (); + } + + foreach ($servers as $serverItem) { + $sub["operation/servers/view_server_detail&server_id=".$serverItem["id_server"]]["text"] = $serverItem["name"]; + } + + $menu["estado_server"]["sub"] = $sub; + //End of server view + //End of server view } diff --git a/pandora_console/operation/servers/view_server_detail.php b/pandora_console/operation/servers/view_server_detail.php index a38a68a55d..d6d03c8f1f 100644 --- a/pandora_console/operation/servers/view_server_detail.php +++ b/pandora_console/operation/servers/view_server_detail.php @@ -19,6 +19,13 @@ global $config; check_login (); +$id_server = (int) get_parameter ("server_id", -1); + +$options = "
  • "; + +print_page_header (__('Pandora servers'), "images/server.png", false, "", false, $options); + + if (! give_acl ($config['id_user'], 0, "AR")) { audit_db ($config["id_user"], $REMOTE_ADDR, "ACL Violation", "Trying to access recon task viewer"); @@ -42,21 +49,9 @@ if (give_acl ($config['id_user'], 0, "PM")) { } } -$id_server = (int) get_parameter ("server_id", -1); $server_name = get_server_name ($id_server); $recon_tasks = get_db_all_rows_field_filter ("trecon_task", "id_recon_server", $id_server); -echo "

    ".__('Pandora servers')." » "; -echo __('Configuration detail') . " - ".safe_input ($server_name); -echo ' '; -print_image ("images/refresh.png"); -echo " "; -if (check_acl ($config["id_user"],0,"PW")){ - echo ""; -} -echo "

    "; - - // Show network tasks for Recon Server if ($recon_tasks === false) { $recon_tasks = array (); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 35b2e7ba48..55e4b54940 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -47,7 +47,7 @@ INSERT INTO `tconfig` VALUES (6,'graph_res','5'), (7,'step_compact','1'), (8,'db_scheme_version','3.1-dev'), -(9,'db_scheme_build','PD100209'), +(9,'db_scheme_build','PD100302'), (13,'show_unknown','0'), (14,'show_lastalerts','1'), (15,'style','pandora'), @@ -64,8 +64,10 @@ INSERT INTO `tconfig` VALUES (26, 'prominent_time', 0), (27, 'timesource', 'system'), (28, 'realtimestats', '1'), -(29, 'stats_interval', '300'), -(30, 'activate_gis', '1'); +(29, 'stats_interval', '60'), +(30, 'activate_gis', '0'), +(31, 'timezone', 'Europe/Berlin'); + UNLOCK TABLES; @@ -160,11 +162,10 @@ UNLOCK TABLES; LOCK TABLES `tlink` WRITE; INSERT INTO `tlink` VALUES (1,'Pandora FMS Manual','https://openideas.info/wiki/index.php?title=Pandora_3.x:Documentation'), -(2,'ArticaST','http://www.artica.es'), -(3,'Pandora FMS','http://pandora.sourceforge.net'), -(4,'Babel Enterprise','http://babel.sourceforge.net'), -(5,'Openideas','http://www.openideas.info'), -(6,'Google','http://www.google.com'); +(2,'Pandora FMS','http://pandorafms.org'), +(3,'Report a bug','https://sourceforge.net/tracker/?func=add&group_id=155200&atid=794852'), +(4,'Suggest new feature','http://sourceforge.net/tracker/?group_id=155200&atid=794855'), +(5,'Module library','http://pandorafms.org/?sec=community&sec2=repository&lng=es'); UNLOCK TABLES; -- @@ -218,19 +219,14 @@ INSERT INTO `ttipo_modulo` VALUES (16,'remote_snmp_inc',3,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'), (17,'remote_snmp_string',5,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'), (18,'remote_snmp_proc',4,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'), - (21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'), (22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'), (23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png'), - (30,'log4x',0,'Log4x','mod_log4x.png'), - (100,'keep_alive',-1,'KeepAlive','mod_keepalive.png'); --- Not yet implemented --- (19,'image_jpg',9,'Image JPG data', 'mod_image_jpg.png'), --- (20,'image_png',9,'Image PNG data', 'mod_image_png.png'); --- Categoria field is used to segregate several types (plugin, agents, network) on their data +-- Categoria field is used to segregate several types +-- (plugin, agents, network) on their data -- types, could be used or could be avoided and use directly primary key (id_tipo) -- @@ -251,7 +247,8 @@ INSERT INTO `tusuario_perfil` VALUES (1,'admin',5,1,'admin'); INSERT INTO `tperfil` VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0),(4,'Group coordinator',1,1,1,1,1,1,1,0,0,0),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1); -INSERT INTO `tnews` VALUES (1,'admin','Welcome to Pandora FMS 3.0!','This is the new Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.\r\n\r\nThe Pandora FMS Team.',NOW()); +INSERT INTO `tnews` VALUES (1,'admin','Welcome to Pandora FMS 3.1!','This is the new Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.\r\n\r\nThe Pandora FMS Team.',NOW()), +(2,'admin','New GIS Feature','Try our new GIS representation, activate GIS in Setup to see new available options.',NOW()); INSERT INTO tmodule VALUES (1,'Agent module'); INSERT INTO tmodule VALUES (2,'Network module');