2006-03-27 05:37:27 +02:00
< ? php
2006-07-19 20:29:12 +02:00
2009-06-08 20:17:33 +02:00
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
2007-02-20 02:38:59 +01:00
2006-07-19 20:29:12 +02:00
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
2008-04-01 15:53:11 +02:00
// as published by the Free Software Foundation for version 2.
2006-07-19 20:29:12 +02:00
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
2009-06-08 20:17:33 +02:00
2008-04-01 15:53:11 +02:00
2008-12-10 21:15:38 +01:00
require_once ( " include/config.php " );
require_once ( " include/functions_incidents.php " );
2007-02-06 16:38:29 +01:00
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
check_login ();
if ( ! give_acl ( $config [ 'id_user' ], 0 , " IR " )) {
2008-12-10 21:15:38 +01:00
audit_db ( $config [ 'id_user' ], $config [ " remote_addr " ], " ACL Violation " , " Trying to access incident viewer " );
2007-02-05 18:45:14 +01:00
require ( " general/noaccess.php " );
exit ;
}
2007-02-19 08:44:07 +01:00
// Take input parameters
// Offset adjustment
2008-09-19 18:08:59 +02:00
if ( isset ( $_GET [ " offset " ])) {
$offset = get_parameter_get ( " offset " );
} else {
$offset = 0 ;
}
2007-02-19 08:44:07 +01:00
2008-12-10 21:15:38 +01:00
// Check action. Try to get author and group
$action = get_parameter_get ( " action " );
if ( $action == " mass " ) {
$id_inc = get_parameter_post ( " id_inc " , array ());
$delete_btn = get_parameter_post ( " delete_btn " , - 1 );
$own_btn = get_parameter_post ( " own_btn " , - 1 );
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
foreach ( $id_inc as $incident ) {
if ( give_acl ( $config [ 'id_user' ], get_incidents_group ( $incident ), " IM " ) || get_incidents_author ( $incident ) == $config [ " id_user " ] || get_incidents_owner ( $incident ) == $config [ " id_user " ]) {
continue ;
2006-03-27 05:37:27 +02:00
}
2008-12-10 21:15:38 +01:00
audit_db ( $config [ " id_user " ], $config [ " remote_addr " ], " ACL Forbidden " , " Mass-update or deletion of incident " );
require ( " general/noaccess.php " );
exit ;
2006-03-27 05:37:27 +02:00
}
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
if ( $delete_btn != - 1 ) {
$result = delete_incidents ( $id_inc );
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/users/configure_user.php: Complete rewritten to fix minor
errors and fit the Pandora style.
* include/auth/ldap.php: Removed process_user_isadmin(). Renamed
process_user_password() to update_user_password(). Renamed
process_user_info to update_user(). update_user_password() does not
require old password anymore.
* include/functions_db.php: Added empty checks on
create_user_profile().
* include/functions_ui.php: print_error_message() renamed to
print_result_message().
* godmode/agentes/configurar_agente.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/reporting_builder.php,
operation/agentes/alerts_status.php, operation/events/events.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/messages/message.php, operation/snmpconsole/snmp_view.php,
operation/users/user_edit.php: Renamed print_result_message(). Some
translatable strings reused to simplify i18n work.
* godmode/users/user_list.php: Renamed print_result_message(). Use
cross.png for deletion links. Style corrections.
* godmode/setup/news.php: Renamed print_result_message(). Use
process_sql_delete() instead of direct mysql_query.
* godmode/reporting/map_builder.php: Renamed print_result_message().
Style correction on process_sql_update().
* godmode/alerts/configure_alert_compound.php: Renamed
print_result_message(). Fixed steps_clean div.
* godmode/setup/setup.php: Return control to index instead of exit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-26 12:14:49 +01:00
print_result_message ( $result ,
__ ( 'Successfully deleted' ),
__ ( 'Could not be deleted' ));
2008-12-10 21:15:38 +01:00
}
if ( $own_btn != - 1 ) {
$result = process_incidents_chown ( $id_inc , $config [ " id_user " ]);
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/users/configure_user.php: Complete rewritten to fix minor
errors and fit the Pandora style.
* include/auth/ldap.php: Removed process_user_isadmin(). Renamed
process_user_password() to update_user_password(). Renamed
process_user_info to update_user(). update_user_password() does not
require old password anymore.
* include/functions_db.php: Added empty checks on
create_user_profile().
* include/functions_ui.php: print_error_message() renamed to
print_result_message().
* godmode/agentes/configurar_agente.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/reporting_builder.php,
operation/agentes/alerts_status.php, operation/events/events.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/messages/message.php, operation/snmpconsole/snmp_view.php,
operation/users/user_edit.php: Renamed print_result_message(). Some
translatable strings reused to simplify i18n work.
* godmode/users/user_list.php: Renamed print_result_message(). Use
cross.png for deletion links. Style corrections.
* godmode/setup/news.php: Renamed print_result_message(). Use
process_sql_delete() instead of direct mysql_query.
* godmode/reporting/map_builder.php: Renamed print_result_message().
Style correction on process_sql_update().
* godmode/alerts/configure_alert_compound.php: Renamed
print_result_message(). Fixed steps_clean div.
* godmode/setup/setup.php: Return control to index instead of exit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-26 12:14:49 +01:00
print_result_message ( $result ,
2009-06-24 Jorge Gonzalez <jorgegonz@artica.es>
* include/functions_reporting.php, include/functions_ui.php,
* operation/incidents/incident.php,
* operation/snmpconsole/snmp_view.php, operation/events/events.php,
* operation/agentes/tactical.php, godmode/users/user_list.php,
* godmode/users/configure_user.php,
* godmode/profiles/profile_list.php,
* godmode/agentes/module_manager_editor_wmi.php,
* godmode/agentes/massive_edit_modules.php,
* godmode/agentes/manage_config_remote.php,
* godmode/modules/manage_network_components_form_network.php,
* godmode/modules/manage_network_components_form_wmi.php,
* godmode/servers/manage_export.php,
* godmode/servers/manage_recontask.php,
* godmode/servers/modificar_server.php: Some translatable strings
* reused to simplify i18n work.
* include/languages/es.po, include/languages/es.mo: Updated Spanish
* translation.
* include/languages/index.pot: Updated po template.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1763 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-24 15:36:29 +02:00
__ ( 'Successfully reclaimed ownership' ),
__ ( 'Could not reclame ownership' ));
2008-12-10 21:15:38 +01:00
}
} elseif ( $action == " update " ) {
$id_inc = get_parameter ( " id_inc " , 0 );
$author = get_incidents_author ( $id_inc );
$owner = get_incidents_owner ( $id_inc );
$grupo = get_incidents_group ( $id_inc );
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
if ( $author != $config [ " id_user " ] && $owner != $config [ " id_user " ] && ! give_acl ( $config [ 'id_user' ], $grupo , " IM " )) { // Only admins (manage incident) or owners/creators can modify incidents
audit_db ( $author , $config [ " remote_addr " ], " ACL Forbidden " , " Update incident # " . $id_inc );
require ( " general/noaccess.php " );
exit ;
2007-02-06 16:38:29 +01:00
}
2008-12-10 21:15:38 +01:00
$titulo = get_parameter_post ( " titulo " );
$descripcion = get_parameter_post ( " descripcion " );
$origen = get_parameter_post ( " origen_form " );
$prioridad = get_parameter_post ( " prioridad_form " , 0 );
$estado = get_parameter_post ( " estado_form " , 0 );
$grupo = get_parameter_post ( " grupo_form " , 1 );
$usuario = get_parameter_post ( " usuario_form " , $config [ " id_user " ]);
$sql = sprintf ( " UPDATE tincidencia SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s' WHERE id_incidencia = %d " ,
$titulo , $origen , $estado , $grupo , $usuario , $prioridad , $descripcion , $config [ " id_user " ], $id_inc );
$result = process_sql ( $sql );
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
if ( $result !== false ) {
audit_db ( $config [ " id_user " ], $config [ " remote_addr " ], " Incident updated " , " User " . $config [ 'id_user' ] . " updated incident # " . $id_inc );
}
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/users/configure_user.php: Complete rewritten to fix minor
errors and fit the Pandora style.
* include/auth/ldap.php: Removed process_user_isadmin(). Renamed
process_user_password() to update_user_password(). Renamed
process_user_info to update_user(). update_user_password() does not
require old password anymore.
* include/functions_db.php: Added empty checks on
create_user_profile().
* include/functions_ui.php: print_error_message() renamed to
print_result_message().
* godmode/agentes/configurar_agente.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/reporting_builder.php,
operation/agentes/alerts_status.php, operation/events/events.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/messages/message.php, operation/snmpconsole/snmp_view.php,
operation/users/user_edit.php: Renamed print_result_message(). Some
translatable strings reused to simplify i18n work.
* godmode/users/user_list.php: Renamed print_result_message(). Use
cross.png for deletion links. Style corrections.
* godmode/setup/news.php: Renamed print_result_message(). Use
process_sql_delete() instead of direct mysql_query.
* godmode/reporting/map_builder.php: Renamed print_result_message().
Style correction on process_sql_update().
* godmode/alerts/configure_alert_compound.php: Renamed
print_result_message(). Fixed steps_clean div.
* godmode/setup/setup.php: Return control to index instead of exit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-26 12:14:49 +01:00
print_result_message ( $result ,
__ ( 'Successfully updated' ),
__ ( 'Could not be updated' ));
2008-12-10 21:15:38 +01:00
} elseif ( $action == " insert " ) {
//Create incident
2008-11-10 18:35:27 +01:00
$grupo = get_parameter_post ( " grupo_form " , 1 );
2008-12-10 21:15:38 +01:00
if ( ! give_acl ( $config [ 'id_user' ], $grupo , " IW " )) {
audit_db ( $config [ " id_user " ], $config [ " remote_addr " ], " ACL Forbidden " , " User " . $config [ " id_user " ] . " tried to update incident " );
require ( " general/noaccess.php " );
exit ;
}
// Read input variables
$titulo = get_parameter_post ( " titulo " );
$descripcion = get_parameter_post ( " descripcion " );
$origen = get_parameter_post ( " origen_form " );
$prioridad = get_parameter_post ( " prioridad_form " );
$id_creator = $config [ 'id_user' ];
$estado = get_parameter_post ( " estado_form " );
$sql = sprintf ( " INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator) VALUES
( NOW (), NOW (), '%s' , '%s' , '%s' , '%s' , % d , % d , '%s' , '%s' ) " , $titulo , $descripcion , $config["id_user"] , $origen , $estado , $prioridad , $grupo , $config["id_user"] );
$id_inc = process_sql ( $sql , " insert_id " );
if ( $id_inc === false ) {
echo '<h3 class="error">' . __ ( 'Error creating incident' ) . '</h3>' ;
2007-02-06 16:38:29 +01:00
} else {
2008-12-10 21:15:38 +01:00
audit_db ( $config [ " id_user " ], $config [ " remote_addr " ], " Incident created " , " User " . $config [ " id_user " ] . " created incident # " . $id_inc );
2007-02-06 16:38:29 +01:00
}
}
2007-02-05 18:45:14 +01:00
// Search
2008-09-19 18:08:59 +02:00
$filter = " " ;
$texto = ( string ) get_parameter ( " texto " , " " );
if ( $texto != " " )
$filter .= sprintf ( " AND (titulo LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') " , $texto , $texto );
2009-03-25 21:53:34 +01:00
$usuario = ( string ) get_parameter ( " usuario " , " " );
2009-03-25 19:43:30 +01:00
if ( $usuario != " " )
2008-09-19 18:08:59 +02:00
$filter .= sprintf ( " AND id_usuario = '%s' " , $usuario );
$estado = ( int ) get_parameter ( " estado " , - 1 );
2009-03-25 19:43:30 +01:00
if ( $estado > 0 ) //-1 = All
2008-09-19 18:08:59 +02:00
$filter .= sprintf ( " AND estado = %d " , $estado );
$grupo = ( int ) get_parameter ( " grupo " , 1 );
2009-03-25 19:43:30 +01:00
if ( $grupo > 1 ) {
2008-09-19 18:08:59 +02:00
$filter .= sprintf ( " AND id_grupo = %d " , $grupo );
if ( give_acl ( $config [ 'id_user' ], $grupo , " IM " ) == 0 ) {
2008-12-10 21:15:38 +01:00
audit_db ( $config [ " id_user " ], $config [ " remote_addr " ], " ACL Forbidden " , " User tried to read incidents from group without access " );
2009-02-12 22:04:02 +01:00
include ( " general/noaccess.php " );
exit ;
2006-03-27 05:37:27 +02:00
}
2007-02-05 18:45:14 +01:00
}
2006-03-27 05:37:27 +02:00
2008-09-19 18:08:59 +02:00
$prioridad = ( int ) get_parameter ( " prioridad " , - 1 );
if ( $prioridad != - 1 ) //-1 = All
$filter .= sprintf ( " AND prioridad = %d " , $prioridad );
2007-02-05 18:45:14 +01:00
2008-09-19 18:08:59 +02:00
$offset = ( int ) get_parameter ( " offset " , 0 );
2008-11-14 16:37:32 +01:00
$groups = get_user_groups ( $config [ " id_user " ], " IR " );
2006-03-27 05:37:27 +02:00
2008-09-19 18:08:59 +02:00
//Select incidencts where the user has access to ($groups from
//get_user_groups), array_keys for the id, implode to pass to SQL
$sql = " SELECT * FROM tincidencia WHERE
id_grupo IN ( " .implode ( " , " ,array_keys ( $groups )). " ) " . $filter . "
ORDER BY actualizacion DESC LIMIT " . $offset . " , " . $config["block_size"] ;
2007-02-19 08:44:07 +01:00
2008-09-19 18:08:59 +02:00
$result = get_db_all_rows_sql ( $sql );
if ( empty ( $result )) {
$result = array ();
$count = 0 ;
} else {
$count = count ( $result );
2007-02-05 18:45:14 +01:00
}
2006-03-27 05:37:27 +02:00
2009-04-13 Esteban Sanchez <estebans@artica.es>
* 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.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
echo '<h2>' . __ ( 'Incident management' ) . ' » ' . __ ( 'Manage incidents' ) . ' </ h2 >
2009-03-20 20:57:13 +01:00
< form name = " visualizacion " method = " post " action = " index.php?sec=incidencias&sec2=operation/incidents/incident " >
< table class = " databox " cellpadding = " 4 " cellspacing = " 4 " width = " 95% " >< tr >
< td valign = " middle " >< h3 > '.__(' Filter ').' </ h3 > ' ;
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
$fields = get_incidents_status ();
2009-03-25 19:43:30 +01:00
print_select ( $fields , " estado " , $estado , 'javascript:this.form.submit();' , __ ( 'All incidents' ), - 1 , false , false , false , 'w155' );
2008-09-19 18:08:59 +02:00
//Legend
echo '</td><td valign="middle"><noscript>' ;
2009-03-20 20:57:13 +01:00
print_submit_button ( __ ( 'Show' ), 'submit-estado' , false , array ( " class " => " sub " ));
2008-12-10 21:15:38 +01:00
2009-03-25 19:43:30 +01:00
echo '</noscript></td><td rowspan="7" class="f9" style="padding-left: 30px; vertical-align: top;"><h3>' . __ ( 'Status' ) . '</h3>' ;
2008-12-10 21:15:38 +01:00
foreach ( get_incidents_status () as $id => $str ) {
print_incidents_status_img ( $id );
echo ' - ' . $str . '<br />' ;
}
2009-03-25 19:43:30 +01:00
echo '</td><td rowspan="7" class="f9" style="padding-left: 30px; vertical-align: top;"><h3>' . __ ( 'Priority' ) . '</h3>' ;
2008-12-10 21:15:38 +01:00
foreach ( get_incidents_priorities () as $id => $str ) {
print_incidents_priority_img ( $id );
echo ' - ' . $str . '<br />' ;
}
echo '</td></tr><tr><td>' ;
$fields = get_incidents_priorities ();
2008-09-19 18:08:59 +02:00
2009-03-25 19:43:30 +01:00
print_select ( $fields , " prioridad " , $prioridad , 'javascript:this.form.submit();' , __ ( 'All priorities' ), - 1 , false , false , false , 'w155' );
2008-09-19 18:08:59 +02:00
2009-03-25 19:43:30 +01:00
echo '</td></tr><tr><td>' ;
2008-09-19 18:08:59 +02:00
2009-03-25 19:43:30 +01:00
print_select ( get_users_info (), " usuario " , $usuario , 'javascript:this.form.submit();' , __ ( 'All users' ), " " , false , false , false , " w155 " );
2008-09-19 18:08:59 +02:00
2009-03-25 19:43:30 +01:00
echo '</td></tr><tr><td>' ;
print_select ( $groups , " grupo " , $grupo , 'javascript:this.form.submit();' , '' , '' , false , false , false , 'w155' );
echo '</td></tr><tr><td>' ;
2006-03-27 05:37:27 +02:00
2009-03-25 19:43:30 +01:00
print_input_text ( 'texto' , $texto , '' , 45 );
echo ' ' ;
print_input_image ( " submit " , " images/zoom.png " , __ ( 'Search' ), 'padding:0;' , false , array ( " alt " => __ ( 'Search' )));
2006-03-27 05:37:27 +02:00
2009-03-25 19:43:30 +01:00
echo " </td></tr></table> " ;
echo '</form>' ;
2006-03-27 05:37:27 +02:00
2008-09-19 18:08:59 +02:00
if ( $count < 1 ) {
echo '<div class="nf">' . __ ( 'No incidents match your search filter' ) . '</div><br />' ;
2007-02-05 18:45:14 +01:00
} else {
2006-03-27 05:37:27 +02:00
// TOTAL incidents
2009-03-20 20:57:13 +01:00
$url = " index.php?sec=incidencias&sec2=operation/incidents/incident " ;
2006-03-27 05:37:27 +02:00
2008-11-10 18:35:27 +01:00
$estado = - 1 ;
2006-03-27 05:37:27 +02:00
// add form filter values for group, priority, state, and search fields: user and text
2008-09-19 18:08:59 +02:00
if ( $grupo != - 1 )
2009-03-20 20:57:13 +01:00
$url .= " &grupo= " . $grupo ;
2008-09-19 18:08:59 +02:00
if ( $prioridad != - 1 )
2009-03-20 20:57:13 +01:00
$url .= " &prioridad= " . $prioridad ;
2008-09-19 18:08:59 +02:00
if ( $estado != - 1 )
2009-03-20 20:57:13 +01:00
$url .= " &estado= " . $estado ;
2008-09-19 18:08:59 +02:00
if ( $usuario != '' )
2009-03-20 20:57:13 +01:00
$url .= " &usuario= " . $usuario ;
2008-09-19 18:08:59 +02:00
if ( $texto != '' )
2009-03-20 20:57:13 +01:00
$url .= " &texto= " . $texto ;
2006-03-27 05:37:27 +02:00
2007-02-05 18:45:14 +01:00
// Show pagination
2009-06-23 16:40:54 +02:00
pagination ( $count + $offset , $url , $offset , 15 , false ); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
2008-09-19 18:08:59 +02:00
echo '<br />' ;
2006-03-27 05:37:27 +02:00
// Show headers
2009-03-25 19:43:30 +01:00
$table -> width = " 100% " ;
2008-09-19 18:08:59 +02:00
$table -> class = " databox " ;
$table -> cellpadding = 4 ;
$table -> cellspacing = 4 ;
$table -> head = array ();
$table -> data = array ();
$table -> size = array ();
$table -> align = array ();
$table -> head [ 0 ] = __ ( 'ID' );
$table -> head [ 1 ] = __ ( 'Status' );
$table -> head [ 2 ] = __ ( 'Incident' );
$table -> head [ 3 ] = __ ( 'Priority' );
$table -> head [ 4 ] = __ ( 'Group' );
$table -> head [ 5 ] = __ ( 'Updated' );
$table -> head [ 6 ] = __ ( 'Source' );
$table -> head [ 7 ] = __ ( 'Owner' );
2008-12-10 21:15:38 +01:00
$table -> head [ 8 ] = 'X' ;
2008-09-19 18:08:59 +02:00
$table -> size [ 0 ] = 43 ;
$table -> size [ 7 ] = 50 ;
$table -> align [ 1 ] = " center " ;
$table -> align [ 3 ] = " center " ;
$table -> align [ 4 ] = " center " ;
$table -> align [ 8 ] = " center " ;
2009-08-07 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/index.php,
pandora_console/operation/users/user.php, operation/incidents/incident.php,
operation/agentes/status_monitor.php, operation/agentes/estado_agente.php,
operation/agentes/alerts_status.php, include/styles/pandora.css,
include/styles/pandora_black.css,include/styles/pandora_blackmetal.css,
include/styles/pandora_width.css, include/styles/pandora_minimal.css,
include/styles/pandora_red.css: the table list now has rows with alternate
colours for easy see the data.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-10 11:55:53 +02:00
$rowPair = true ;
$iterator = 0 ;
2008-09-19 18:08:59 +02:00
foreach ( $result as $row ) {
2009-08-07 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/index.php,
pandora_console/operation/users/user.php, operation/incidents/incident.php,
operation/agentes/status_monitor.php, operation/agentes/estado_agente.php,
operation/agentes/alerts_status.php, include/styles/pandora.css,
include/styles/pandora_black.css,include/styles/pandora_blackmetal.css,
include/styles/pandora_width.css, include/styles/pandora_minimal.css,
include/styles/pandora_red.css: the table list now has rows with alternate
colours for easy see the data.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-10 11:55:53 +02:00
if ( $rowPair )
$table -> rowclass [ $iterator ] = 'rowPair' ;
else
$table -> rowclass [ $iterator ] = 'rowOdd' ;
$rowPair = ! $rowPair ;
$iterator ++ ;
2008-09-19 18:08:59 +02:00
$data = array ();
2009-03-20 20:57:13 +01:00
$data [ 0 ] = '<a href="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=' . $row [ " id_incidencia " ] . '">' . $row [ " id_incidencia " ] . '</a>' ;
2008-12-10 21:15:38 +01:00
$attach = get_incidents_attach ( $row [ " id_incidencia " ]);
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
if ( ! empty ( $attach ))
2009-05-13 15:40:42 +02:00
$data [ 0 ] .= ' ' . print_image ( " images/attachment.png " , true , array ( " style " => " align:middle; " ));
2008-12-10 21:15:38 +01:00
$data [ 1 ] = print_incidents_status_img ( $row [ " estado " ], true );
2008-09-19 18:08:59 +02:00
2009-03-20 20:57:13 +01:00
$data [ 2 ] = '<a href="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=' . $row [ " id_incidencia " ] . '">' . safe_input ( substr ( $row [ " titulo " ], 0 , 45 )) . '</a>' ;
2008-12-10 21:15:38 +01:00
$data [ 3 ] = print_incidents_priority_img ( $row [ " prioridad " ], true );
2008-09-19 18:08:59 +02:00
2008-12-16 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/logon_ok.php, godmode/agentes/modificar_agente.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_recontask.php, godmode/setup/news.php,
operation/agentes/datos_agente.php, operation/agentes/estado_agente.php,
operation/agentes/status_events.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incidents.php,
operation/incidents/incident_detail.php, operation/messages/message.php:
Function updates and new function definitions
* include/functions.php: safe_input used utf_decode which gives problems
with foreign chars since everything else is (or should be UTF-8) fixed.
format_datetime is no longer necessary - use print_timestamp for output.
Extended multibyte wrapper functions.
* include/functions_db.php: give_server_name is now get_server_name;
dame_so_name is now get_os_name; dame_so_icon is now print_os_icon;
show_icon_group is now print_group_icon; give_network_profile_name is now
get_networkprofile_name; smal_event_table is now print_events_table
* include/functions_events.php: print_events_table was moved here and
fixed. Now calculates the cutoff of event and agent text.
* include/functions_html.php: Added title to print_table function and
updated documentation. print_timestamp now uses the new function
definitions (array) and handles 0-dates better. print_group_icon and
print_os_icon added and extended. Added print_agent_name. This function
fixes issues that show up when cutting off agent names with multibyte char
* operation/servers/view_server.php: Rewrite with new functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1295 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-17 15:26:42 +01:00
$data [ 4 ] = print_group_icon ( $row [ " id_grupo " ], true );
2007-02-05 18:45:14 +01:00
2008-12-16 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/logon_ok.php, godmode/agentes/modificar_agente.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_recontask.php, godmode/setup/news.php,
operation/agentes/datos_agente.php, operation/agentes/estado_agente.php,
operation/agentes/status_events.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incidents.php,
operation/incidents/incident_detail.php, operation/messages/message.php:
Function updates and new function definitions
* include/functions.php: safe_input used utf_decode which gives problems
with foreign chars since everything else is (or should be UTF-8) fixed.
format_datetime is no longer necessary - use print_timestamp for output.
Extended multibyte wrapper functions.
* include/functions_db.php: give_server_name is now get_server_name;
dame_so_name is now get_os_name; dame_so_icon is now print_os_icon;
show_icon_group is now print_group_icon; give_network_profile_name is now
get_networkprofile_name; smal_event_table is now print_events_table
* include/functions_events.php: print_events_table was moved here and
fixed. Now calculates the cutoff of event and agent text.
* include/functions_html.php: Added title to print_table function and
updated documentation. print_timestamp now uses the new function
definitions (array) and handles 0-dates better. print_group_icon and
print_os_icon added and extended. Added print_agent_name. This function
fixes issues that show up when cutting off agent names with multibyte char
* operation/servers/view_server.php: Rewrite with new functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1295 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-17 15:26:42 +01:00
$data [ 5 ] = print_timestamp ( $row [ " actualizacion " ], true );
2008-09-19 18:08:59 +02:00
$data [ 6 ] = $row [ " origen " ];
2008-12-10 21:15:38 +01:00
$data [ 7 ] = print_username ( $row [ " id_usuario " ], true );
2008-09-19 18:08:59 +02:00
2008-12-10 21:15:38 +01:00
if ( give_acl ( $config [ " id_user " ], $row [ " id_grupo " ], " IM " ) || $config [ " id_user " ] == $row [ " id_usuario " ] || $config [ " id_user " ] == $row [ " id_creator " ]) {
$data [ 8 ] = print_checkbox ( " id_inc[] " , $row [ " id_incidencia " ], false , true );
2008-09-19 18:08:59 +02:00
} else {
$data [ 8 ] = '' ;
2006-03-27 05:37:27 +02:00
}
2008-09-19 18:08:59 +02:00
array_push ( $table -> data , $data );
2006-03-27 05:37:27 +02:00
}
2008-09-19 18:08:59 +02:00
2009-03-20 20:57:13 +01:00
echo '<form method="post" action="' . $url . '&action=mass" style="margin-bottom: 0px;">' ;
2008-09-19 18:08:59 +02:00
print_table ( $table );
2009-10-26 Ramon Novoa <rnovoa@artica.es>
* extensions/update_manager.php,
operation/incidents/incident.php,
operation/menu.php,
godmode/setup/links.php,
godmode/users/configure_user.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/agent_manager.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php,
godmode/reporting/graph_builder.php,
godmode/alerts/alert_templates.php,
godmode/menu.php: Several ACL related fixes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-26 19:51:29 +01:00
echo '<div style="text-align:right; float:right; padding-right: 30px;">' ;
if ( give_acl ( $config [ " id_user " ], 0 , " IW " )) {
2008-12-10 21:15:38 +01:00
print_submit_button ( __ ( 'Delete incidents' ), 'delete_btn' , false , 'class="sub delete"' );
2009-10-26 Ramon Novoa <rnovoa@artica.es>
* extensions/update_manager.php,
operation/incidents/incident.php,
operation/menu.php,
godmode/setup/links.php,
godmode/users/configure_user.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/agent_manager.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php,
godmode/reporting/graph_builder.php,
godmode/alerts/alert_templates.php,
godmode/menu.php: Several ACL related fixes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-26 19:51:29 +01:00
}
if ( give_acl ( $config [ " id_user " ], 0 , " IM " )) {
2008-12-10 21:15:38 +01:00
print_submit_button ( __ ( 'Become owner' ), 'own_btn' , false , 'class="sub upd"' );
}
2009-10-26 Ramon Novoa <rnovoa@artica.es>
* extensions/update_manager.php,
operation/incidents/incident.php,
operation/menu.php,
godmode/setup/links.php,
godmode/users/configure_user.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/agent_manager.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php,
godmode/reporting/graph_builder.php,
godmode/alerts/alert_templates.php,
godmode/menu.php: Several ACL related fixes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-26 19:51:29 +01:00
echo '</div>' ;
2008-12-10 21:15:38 +01:00
echo '</form>' ;
2008-09-19 18:08:59 +02:00
unset ( $table );
2007-02-05 18:45:14 +01:00
}
2006-03-27 05:37:27 +02:00
2008-09-19 18:08:59 +02:00
if ( give_acl ( $config [ " id_user " ], 0 , " IW " )) {
2008-12-10 21:15:38 +01:00
echo '<div style="text-align:right; float:right; padding-right: 30px;">' ;
2009-03-20 20:57:13 +01:00
echo '<form method="post" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&insert_form=1">' ;
2008-09-19 18:08:59 +02:00
print_submit_button ( __ ( 'Create incident' ), 'crt' , false , 'class="sub next"' );
2008-12-10 21:15:38 +01:00
echo '</form>' ;
echo '</div>' ;
2006-03-27 05:37:27 +02:00
}
2008-12-10 21:15:38 +01:00
echo '<div style="clear:both"> </div>' ;
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
?>