2006-03-27 05:37:27 +02:00
< ? php
2006-07-19 20:29:12 +02:00
2008-08-22 20:07:32 +02:00
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
2008-04-01 15:53:11 +02:00
// Please see http://pandora.sourceforge.net 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.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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 ,
__ ( 'Ssuccessfully reclaimed ownership' ),
__ ( 'Could not reclame owners' ));
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-04-02 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Final DB changes proposed for closing this month the DB
scheme. tagente-> new server_name field to assign server (old fields will
be removed). talert_templates has two new types (warning, critical).
tevento has "user_comment" new field. Tserver has three new fields,
server_type (so some old fields will be deleted), threads and queued_modules
this last two are for statistical options. Tusuario add language type to
override global language.
* update_manager/main.php: Minor changes for correct ACL usage. Non PM
users could see in what revision it the system, but only that.
* pandoradb_migrate_v2.x_to_v3.0.sql: Updated script for new DB changes.
* general/noaccess.php: Added footer and ending div. Page was very ugly
when showing noaccess errors, nobody see it ???.
* godmode/menu.php: A LOT of ACL fixes on several options.
* godmode/agentes/agent_manager.php: Fixed a crazy floating icon.
* godmode/agentes/manage_config_remote.php: A LOT of changes, rewriting
stuff, because was not working. This also adds a lot of ACL checks.
* godmode/agentes/massive_config.php, massive*: ACL changes.
* godmode/agentes/modificar_agente.php: Fixed ACL problems.
* godmode/agentes/module_manager_editor.php: Fixed bad module categories for
some types (data, plugin and prediction).
* godmode/alerts/alert_list.php: Fixed ACL problem.
* godmode/reporting/graph_builder.php: Added ACl restriction for
non-viewable agents for current user. Seems to be a problem with data
with more than 2 sources.
* godmode/reporting/map_builder.php: ACL checks improved.
* godmode/reporting/reporting_builder.php: ACL checks added (was missing),
some code ported from 2.1, other is new. New fields shown in list.
* include/functions.php: Fixed the annoying bug of "bad counters" in
function human_time_description_raw(). Function used,format_numeric() should
not be used never to calculate nothing, only to print formatted strings.
* include/functions_db.php: Added function user_access_to_agent() to know
if a given user has access to a given agent.
* include/functioins_report.php: get_report() should let admin to watch any
report. Fixed.
* agentes/alerts_status.php: Fixed ACL problem for view alert.
* operation/incidents/incident.php: Bad call for pagination() was giving
problems to pagination call. Somebody changes pagination() interface and
make this broken. Please if you change any interface, be sure that is compatible
with old code or make a post in the list about this !
* godmode/users/user_edit.php: Additional ACL check to do not let anybody
to watch non accesible users. Even for see the username or description.
* reporting/pchart_graph.php:Progress bar shown text in white when > 60%.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1594 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-02 21:16:59 +02:00
pagination ( $count , $url , $offset , 1 , false );
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 " ;
foreach ( $result as $row ) {
$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-03-20 20:57:13 +01:00
$data [ 0 ] .= ' ' . print_image ( " images/file.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 );
2008-12-10 21:15:38 +01:00
if ( give_acl ( $config [ " id_user " ], 0 , " IM " )) {
echo '<div style="text-align:right; float:right; padding-right: 30px;">' ;
print_submit_button ( __ ( 'Delete incidents' ), 'delete_btn' , false , 'class="sub delete"' );
print_submit_button ( __ ( 'Become owner' ), 'own_btn' , false , 'class="sub upd"' );
echo '</div>' ;
}
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
?>