2006-10-08 16:04:10 +02:00
|
|
|
<?php
|
|
|
|
|
2008-08-22 20:07:32 +02:00
|
|
|
// Pandora FMS - the Flexible Monitoring System
|
|
|
|
// ============================================
|
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
|
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
2007-02-20 02:38:59 +01:00
|
|
|
|
2006-10-08 16:04:10 +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-08-22 20:07:32 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2006-10-08 16:04:10 +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-08-22 20:07:32 +02:00
|
|
|
|
|
|
|
|
2006-10-08 16:04:10 +02:00
|
|
|
// Load global vars
|
2007-06-21 20:58:35 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
require_once ("include/config.php");
|
|
|
|
require_once ("include/functions_incidents.php");
|
|
|
|
require_once ("include/functions_events.php"); //To get events group information
|
2006-10-08 16:04:10 +02: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 ();
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
if (! give_acl ($config["id_user"], 0, "IR")) {
|
2007-02-05 18:45:14 +01:00
|
|
|
// Doesn't have access to this page
|
2008-12-10 21:15:38 +01:00
|
|
|
audit_db ($config["id_user"], $config["remote_addr"], "ACL Violation", "Trying to access incident details");
|
|
|
|
require ("general/noaccess.php");
|
2007-02-05 18:45:14 +01:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
|
|
|
$inicio = get_system_time (); //Just inits the variable
|
|
|
|
$actualizacion = get_system_time ();
|
2008-11-10 18:35:27 +01:00
|
|
|
|
2007-02-05 18:45:14 +01:00
|
|
|
// EDITION MODE
|
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
|
|
|
if (isset ($_GET["id"])) {
|
2008-12-10 21:15:38 +01:00
|
|
|
$id_inc = get_parameter_get ("id", 0);
|
2008-09-19 18:08:59 +02:00
|
|
|
|
2007-02-05 18:45:14 +01:00
|
|
|
// Obtain group of this incident
|
2008-09-19 18:08:59 +02:00
|
|
|
$row = get_db_row ("tincidencia","id_incidencia",$id_inc);
|
|
|
|
|
2007-02-05 18:45:14 +01:00
|
|
|
// Get values
|
|
|
|
$titulo = $row["titulo"];
|
|
|
|
$texto = $row["descripcion"];
|
2008-12-10 21:15:38 +01:00
|
|
|
$inicio = strtotime ($row["inicio"]);
|
|
|
|
$actualizacion = strtotime ($row["actualizacion"]);
|
2007-02-05 18:45:14 +01:00
|
|
|
$estado = $row["estado"];
|
|
|
|
$prioridad = $row["prioridad"];
|
|
|
|
$origen = $row["origen"];
|
2008-12-10 21:15:38 +01:00
|
|
|
$usuario = $row["id_usuario"]; //owner
|
2007-02-05 18:45:14 +01:00
|
|
|
$id_grupo = $row["id_grupo"];
|
2008-12-10 21:15:38 +01:00
|
|
|
$id_creator = $row["id_creator"]; //creator
|
|
|
|
$id_lastupdate = $row["id_lastupdate"]; //last updater
|
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
// Note add - everybody that can read incidents, can add notes
|
|
|
|
if (isset ($_GET["insertar_nota"])) {
|
|
|
|
$nota = get_parameter_post ("nota");
|
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$sql = sprintf ("INSERT INTO tnota (id_usuario, id_incident, nota) VALUES ('%s', %d, '%s')",$config["id_user"],$id_inc, $nota);
|
2008-09-19 18:08:59 +02:00
|
|
|
$id_nota = process_sql ($sql, "insert_id");
|
|
|
|
|
|
|
|
if ($id_nota !== false) {
|
2008-12-10 21:15:38 +01:00
|
|
|
process_incidents_touch ($id_inc);
|
2008-09-19 18:08:59 +02:00
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
print_error_message ($id_nota, __('Note successfully added'), __('Error adding note'));
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Delete note
|
2008-12-10 21:15:38 +01:00
|
|
|
if (isset ($_POST["delete_nota"])) {
|
|
|
|
$id_nota = get_parameter_post ("delete_nota", 0);
|
|
|
|
$note_user = get_incidents_notes_author ($id_nota);
|
|
|
|
if (((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($note_user == $config["id_user"])) OR ($id_owner == $config["id_user"])) {
|
2008-09-19 18:08:59 +02:00
|
|
|
// Only admins (manage incident) or owners can modify
|
2008-12-10 21:15:38 +01:00
|
|
|
// incidents notes. note authors are
|
2008-09-19 18:08:59 +02:00
|
|
|
// able to delete their own notes
|
2008-12-10 21:15:38 +01:00
|
|
|
$result = delete_incidents_note ($id_nota);
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
if (!empty ($result)) {
|
2008-12-10 21:15:38 +01:00
|
|
|
process_incidents_touch ($id_inc);
|
2007-05-27 04:55:55 +02:00
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
print_error_message ($id_nota, __('Note successfully deleted'), __('Error deleting note'));
|
2006-10-08 16:04:10 +02:00
|
|
|
}
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Delete file
|
2008-12-10 21:15:38 +01:00
|
|
|
if (((give_acl ($config["id_user"], $id_grupo, "IM")==1) OR ($id_owner == $config["id_user"])) AND isset ($_POST["delete_file"])) {
|
|
|
|
$file_id = (int) get_parameter_post ("delete_file", 0);
|
|
|
|
$filename = get_db_value ("filename", "tattachment", "id_attachment", $file_id);
|
|
|
|
$sql = sprintf ("DELETE FROM tattachment WHERE id_attachment = %d",$file_id);
|
|
|
|
$result = process_sql ($sql);
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
if (!empty ($result)) {
|
|
|
|
unlink ($config["attachment_store"]."/pand".$file_id."_".$filename);
|
2008-12-10 21:15:38 +01:00
|
|
|
process_incidents_touch ($id_inc);
|
2008-09-19 18:08:59 +02:00
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
|
|
|
|
print_error_message ($result, __('File successfully deleted from database'), __('Unable to delete file'));
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Upload file
|
2008-12-10 21:15:38 +01:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IW") == 1) AND isset ($_GET["upload_file"]) AND ($_FILES['userfile']['name'] != "")) {
|
|
|
|
$description = get_parameter_post ("file_description", __('No description available'));
|
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
// Insert into database
|
|
|
|
$filename = safe_input ($_FILES['userfile']['name']);
|
|
|
|
$filesize = safe_input ($_FILES['userfile']['size']);
|
|
|
|
|
|
|
|
//The following is if you have clamavlib installed
|
|
|
|
//(php5-clamavlib) and enabled in php.ini
|
|
|
|
//http://www.howtoforge.com/scan_viruses_with_php_clamavlib
|
2008-12-10 21:15:38 +01:00
|
|
|
if (extension_loaded ('clamav')) {
|
2008-09-19 18:08:59 +02:00
|
|
|
cl_setlimits (5, 1000, 200, 0, 10485760);
|
|
|
|
$malware = cl_scanfile ($_FILES['file']['tmp_name']);
|
|
|
|
if ($malware) {
|
|
|
|
$error = 'Malware detected: '.$malware.'<br>ClamAV version: '.clam_get_version();
|
|
|
|
die ($error); //On malware, we die because it's not good to handle it
|
2006-10-08 16:04:10 +02:00
|
|
|
}
|
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
$sql = sprintf ("INSERT INTO tattachment (id_incidencia, id_usuario, filename, description, size)
|
|
|
|
VALUES (%d, '%s', '%s', '%s', %d)", $id_inc, $config["id_user"],$filename,$description,$filesize);
|
|
|
|
|
|
|
|
$id_attachment = process_sql ($sql,"insert_id");
|
|
|
|
|
|
|
|
// Copy file to directory and change name
|
|
|
|
if ($id_attachment !== false) {
|
|
|
|
$nombre_archivo = $config["attachment_store"]."/pand".$id_attachment."_".$filename;
|
|
|
|
$result = copy ($_FILES['userfile']['tmp_name'], $nombre_archivo);
|
|
|
|
} else {
|
|
|
|
echo '<h3 class="error">'.__('File could not be saved due to database error').'</h3>';
|
|
|
|
$result = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result !== false) {
|
|
|
|
unlink ($_FILES['userfile']['tmp_name']);
|
2008-12-10 21:15:38 +01:00
|
|
|
process_incidents_touch ($id_inc);
|
2008-09-19 18:08:59 +02:00
|
|
|
} else {
|
|
|
|
process_sql ("DELETE FROM tattachment WHERE id_attachment = ".$id_attachment);
|
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
|
|
|
|
print_error_message ($result, __('File uploaded'), __('File could not be saved. Contact the Pandora Administrator for more information'));
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
2007-02-06 16:38:29 +01:00
|
|
|
} // else Not given id
|
|
|
|
// Create incident from event... read event data
|
2008-09-19 18:08:59 +02:00
|
|
|
elseif (isset ($_GET["insert_form"])) {
|
|
|
|
$titulo = "";
|
|
|
|
$descripcion = "";
|
|
|
|
$origen = "";
|
|
|
|
$prioridad = 0;
|
|
|
|
$id_grupo = 0;
|
|
|
|
$estado = 0;
|
|
|
|
$texto = "";
|
|
|
|
$usuario = $config["id_user"];
|
|
|
|
$id_creator = $config["id_user"];
|
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
if (isset ($_GET["from_event"])) {
|
2008-09-19 18:08:59 +02:00
|
|
|
$event = get_parameter_get ("from_event");
|
2008-12-10 21:15:38 +01:00
|
|
|
$titulo = get_event_description ($event);
|
|
|
|
$id_grupo = get_event_group ($event);
|
2008-09-19 18:08:59 +02:00
|
|
|
$origen = "Pandora FMS event";
|
|
|
|
unset ($event);
|
|
|
|
}
|
|
|
|
$prioridad = 0;
|
|
|
|
$id_grupo = 0;
|
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"], "HACK","Trying to get to incident details in an unusual way");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
2007-02-06 16:38:29 +01:00
|
|
|
|
|
|
|
|
2007-02-05 18:45:14 +01:00
|
|
|
// ********************************************************************************************************
|
|
|
|
// ********************************************************************************************************
|
|
|
|
// Show the form
|
|
|
|
// ********************************************************************************************************
|
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
//This is for the pretty slide down attachment form
|
|
|
|
echo "<script type=\"text/javascript\">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#file_control').hide();
|
|
|
|
$('#add_note').hide();
|
|
|
|
$('input#submit-attachment').click(function() {
|
|
|
|
$('#submit-attachment').fadeOut('fast');
|
|
|
|
$('#file_control').slideDown('slow');
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
$('input#submit-note_control').click(function() {
|
|
|
|
$('#submit-note_control').fadeOut('fast');
|
|
|
|
$('#add_note').slideDown('slow');
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});</script>";
|
|
|
|
|
|
|
|
|
|
|
|
if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"]
|
|
|
|
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=update">';
|
|
|
|
echo '<input type="hidden" name="id_inc" value="'.$id_inc.'">';
|
|
|
|
echo '<h2>'.__('Incident management').' > '.__('Incident details').' #'.$id_inc.'</h2>';
|
2007-02-05 18:45:14 +01:00
|
|
|
} else {
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=insert">';
|
|
|
|
echo '<h2>'.__('Incident management').' > '.__('Create incident').'</h2>';
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
echo '<table cellpadding="4" cellspacing="4" class="databox" width="650px">';
|
|
|
|
echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class="datos">';
|
|
|
|
|
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
|
|
|
print_input_text ("titulo", $titulo,'', 70);
|
2007-05-28 21:15:44 +02:00
|
|
|
} else {
|
2008-09-19 18:08:59 +02:00
|
|
|
print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
echo '</td></tr>';
|
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
echo '<tr><td class="datos2"><b>'.__('Opened at').'</b></td><td class="datos2"><i>'.date ($config['date_format'], $inicio).'</i></td>';
|
|
|
|
echo '<td class="datos2"><b>'.__('Updated at').'</b><td class="datos2"><i>'.date ($config['date_format'], $actualizacion).'</i></td></tr>';
|
2008-09-19 18:08:59 +02:00
|
|
|
|
|
|
|
echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
|
|
|
|
|
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
print_select (get_users_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
|
2007-04-18 23:45:03 +02:00
|
|
|
} else {
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
print_select (get_users_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
|
2007-04-18 23:45:03 +02:00
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
2008-12-10 21:15:38 +01:00
|
|
|
print_select (get_incidents_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
|
2008-09-19 18:08:59 +02:00
|
|
|
} else {
|
2008-12-10 21:15:38 +01:00
|
|
|
print_select (get_incidents_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td></tr>';
|
|
|
|
|
|
|
|
echo '<tr><td class="datos2"><b>'.__('Source').'</b></td><td class="datos2">';
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
$fields = array ();
|
|
|
|
$return = get_db_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen");
|
|
|
|
if ($return === false)
|
|
|
|
$return[0] = $estado; //Something must be displayed
|
|
|
|
|
|
|
|
foreach ($return as $row) {
|
|
|
|
$fields[$row["origen"]] = $row["origen"];
|
|
|
|
}
|
2007-02-05 18:45:14 +01:00
|
|
|
|
|
|
|
// Only owner could change source or user with Incident management privileges
|
2008-09-19 18:08:59 +02:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
2008-11-10 18:35:27 +01:00
|
|
|
print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135');
|
2007-04-18 23:45:03 +02:00
|
|
|
} else {
|
2008-11-10 18:35:27 +01:00
|
|
|
print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135', true);
|
2007-04-18 23:45:03 +02:00
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
2007-02-05 18:45:14 +01:00
|
|
|
|
|
|
|
// Group combo
|
2008-09-19 18:08:59 +02:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
2008-11-14 16:37:32 +01:00
|
|
|
print_select (get_user_groups ($config["id_user"], "IR"), "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
|
2007-04-18 23:45:03 +02:00
|
|
|
} else {
|
2008-11-14 16:37:32 +01:00
|
|
|
print_select (get_user_groups ($config["id_user"], "IR"), "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="datos">';
|
|
|
|
|
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
2008-12-10 21:15:38 +01:00
|
|
|
print_select (get_incidents_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
|
2007-04-18 23:45:03 +02:00
|
|
|
} else {
|
2008-12-10 21:15:38 +01:00
|
|
|
print_select (get_incidents_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
|
2007-04-18 23:45:03 +02:00
|
|
|
}
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">';
|
|
|
|
if (empty ($id_creator)) {
|
|
|
|
echo 'SYSTEM';
|
|
|
|
} else {
|
|
|
|
echo $id_creator.' (<i>'.dame_nombre_real ($id_creator).'</i>)';
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td></tr><tr><td class="datos2" colspan="4">';
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
|
|
|
print_textarea ("descripcion", 15, 80, safe_input ($texto), 'style="height:200px;"');
|
2007-04-18 23:45:03 +02:00
|
|
|
} else {
|
2008-09-19 18:08:59 +02:00
|
|
|
print_textarea ("descripcion", 15, 80, safe_input ($texto), 'style="height:200px;" disabled');
|
2007-04-18 23:45:03 +02:00
|
|
|
}
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-09-19 18:08:59 +02:00
|
|
|
echo '</td></tr></table><div style="width: 600px; text-align:right;">';
|
2007-02-05 18:45:14 +01:00
|
|
|
// Only if user is the used who opened incident or (s)he is admin
|
2008-12-10 21:15:38 +01:00
|
|
|
if (isset ($id_inc) AND ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
|
2008-09-19 18:08:59 +02:00
|
|
|
print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
|
|
|
|
} elseif (give_acl ($config["id_user"], $id_grupo, "IW")) {
|
|
|
|
print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
|
|
|
|
} else {
|
|
|
|
print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
|
|
|
|
}
|
|
|
|
echo "</div></form>";
|
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
//If we're actually working on an incident
|
2008-09-19 18:08:59 +02:00
|
|
|
if (isset ($id_inc)) {
|
2008-12-10 21:15:38 +01:00
|
|
|
// ********************************************************************
|
|
|
|
// Notes
|
|
|
|
// ********************************************************************
|
|
|
|
|
2008-11-10 18:35:27 +01:00
|
|
|
echo '<div>';
|
|
|
|
print_submit_button (__('Add note'), "note_control", false, 'class="sub next"');
|
|
|
|
echo '</div><div>';
|
|
|
|
echo '<form id="add_note" name="nota" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&insertar_nota=1&id='.$id_inc.'">';
|
|
|
|
echo '<table cellpadding="4" cellspacing="4" class="databox" width="600px">
|
|
|
|
<tr><td class="datos2"><textarea name="nota" rows="5" cols="70" style="height: 100px;"></textarea></td>
|
|
|
|
<td valign="bottom"><input name="addnote" type="submit" class="sub wand" value="'.__('Add').'"></td></tr>
|
|
|
|
</table></form></div><div>';
|
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$result = get_incidents_notes ($id_inc);
|
|
|
|
|
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->class = "databox";
|
|
|
|
$table->width = 600;
|
|
|
|
$table->data = array ();
|
|
|
|
$table->head = array ();
|
|
|
|
|
2008-11-10 18:35:27 +01:00
|
|
|
foreach ($result as $row) {
|
2008-12-10 21:15:38 +01:00
|
|
|
$data = array ();
|
|
|
|
$data[0] = '<img src="images/page_white_text.png" border="0" />';
|
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[1] = __('Author').': '.print_username ($row["id_usuario"], true).' ('.print_timestamp ($row["timestamp"], true).')';
|
2008-12-10 21:15:38 +01:00
|
|
|
array_push ($table->data, $data);
|
|
|
|
|
|
|
|
$data = array ();
|
|
|
|
$data[0] = '';
|
2008-11-10 18:35:27 +01:00
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($row["id_usuario"] == $config["id_user"])) {
|
2008-12-10 21:15:38 +01:00
|
|
|
$data[0] .= print_input_image ("delete_nota", "images/cross.png", $row["id_nota"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true);
|
2008-11-10 18:35:27 +01:00
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
$data[1] = safe_input ($row["nota"]);
|
|
|
|
array_push ($table->data, $data);
|
2007-02-05 18:45:14 +01:00
|
|
|
}
|
2008-12-10 21:15:38 +01:00
|
|
|
|
|
|
|
if (!empty ($table->data)) {
|
|
|
|
echo "<h3>".__('Notes attached to incident').'<h3>';
|
|
|
|
echo '<form method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'">';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</form>';
|
|
|
|
}
|
|
|
|
unset ($table);
|
|
|
|
|
2007-02-05 18:45:14 +01:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
// ************************************************************
|
|
|
|
// Files attached to this incident
|
|
|
|
// ************************************************************
|
2007-06-21 20:58:35 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$result = get_incidents_attach ($id_inc);
|
2007-06-21 20:58:35 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->class = "databox";
|
|
|
|
$table->width = 650;
|
|
|
|
$table->head = array ();
|
|
|
|
$table->data = array ();
|
2008-09-19 18:08:59 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$table->head[0] = __('Filename');
|
|
|
|
$table->head[1] = __('Description');
|
|
|
|
$table->head[2] = __('Size');
|
|
|
|
$table->head[3] = __('Delete');
|
2008-09-19 18:08:59 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
$table->align[2] = "center";
|
|
|
|
$table->align[3] = "center";
|
2008-11-10 18:35:27 +01:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
foreach ($result as $row) {
|
|
|
|
$data[0] = '<img src="images/disk.png" border="0" align="top" /> <a target="_new" href="attachment/pand'.$row["id_attachment"].'_'.$row["filename"].'"><b>'.$row["filename"].'</b></a>';
|
|
|
|
$data[1] = $row["description"];
|
|
|
|
$data[2] = format_for_graph ($row["size"])."B";
|
|
|
|
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
|
|
|
$data[3] = print_input_image ("delete_file", "images/cross.png", $row["id_attachment"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true);
|
|
|
|
} else {
|
|
|
|
$data[3] = '';
|
|
|
|
}
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
2006-10-08 16:04:10 +02:00
|
|
|
|
2008-12-10 21:15:38 +01:00
|
|
|
if (!empty ($table->data)) {
|
|
|
|
echo "<h3>".__('Attached files')."</h3>";
|
|
|
|
echo '<form method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'">';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</form>';
|
|
|
|
}
|
|
|
|
unset ($table);
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
// Upload control
|
|
|
|
// ************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
// Upload control
|
|
|
|
if ((give_acl($config["id_user"], $id_grupo, "IW")==1)) {
|
|
|
|
echo '<div>';
|
|
|
|
print_submit_button (__('Add attachment'), "attachment", false, 'class="sub next"');
|
|
|
|
echo '</div>';
|
|
|
|
echo '<div><form method="post" id="file_control" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data">';
|
|
|
|
echo '<table cellpadding="4" cellspacing="3" class="databox" width="400">
|
|
|
|
<tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr>
|
|
|
|
<tr><td class="datos2">'.__('Description').'</td><td class="datos2" colspan="3"><input type="text" name="file_description" size="47"></td></tr>
|
|
|
|
<tr><td rowspan="2" style="text-align: right;"> <input type="submit" name="upload" value="'.__('Upload').'" class="sub wand"></td></tr>
|
|
|
|
</table></form></div>';
|
|
|
|
}
|
2008-09-19 18:08:59 +02:00
|
|
|
}
|
2006-10-08 16:04:10 +02:00
|
|
|
?>
|