2013-06-18 Miguel de Dios <miguel.dedios@artica.es>

* operation/incidents/incident.php,
	operation/incidents/incident_detail.php: fixed to set the SYSTEM as
	user for the incident.
	
	MERGED FROM THE BRANCH PANDORA_4.0




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8344 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-06-18 09:48:57 +00:00
parent effabbe24a
commit 639b55f084
3 changed files with 39 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2013-06-18 Miguel de Dios <miguel.dedios@artica.es>
* operation/incidents/incident.php,
operation/incidents/incident_detail.php: fixed to set the SYSTEM as
user for the incident.
MERGED FROM THE BRANCH PANDORA_4.0
2013-06-18 Miguel de Dios <miguel.dedios@artica.es>
* operation/snmpconsole/snmp_view.php: fixed the urls and forms to

View File

@ -90,7 +90,9 @@ elseif ($action == "update") {
$usuario = get_parameter ("usuario_form", $config["id_user"]);
$id_agent = get_parameter ("id_agent");
$sql = sprintf ("UPDATE tincidencia SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s', id_agent = %d WHERE id_incidencia = %d",
$sql = sprintf ("UPDATE tincidencia
SET titulo = '%s', origen = '%s', estado = %d, id_grupo = %d, id_usuario = '%s', prioridad = %d, descripcion = '%s', id_lastupdate = '%s', id_agent = %d
WHERE id_incidencia = %d",
$titulo, $origen, $estado, $grupo, $usuario, $prioridad, $descripcion, $config["id_user"], $id_agent, $id_inc);
$result = db_process_sql ($sql);
@ -101,6 +103,7 @@ elseif ($action == "update") {
ui_print_result_message ($result,
__('Successfully updated'),
__('Could not be updated'));
}
elseif ($action == "insert") {
//Create incident
@ -120,9 +123,14 @@ elseif ($action == "insert") {
$prioridad = get_parameter ("prioridad_form");
$id_creator = $config['id_user'];
$estado = get_parameter ("estado_form");
$id_agent = get_parameter ("id_agent");
$sql = sprintf ("INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator, id_agent, id_agente_modulo) VALUES
(NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent);
$usuario = get_parameter ("usuario_form", "");
$id_agent = get_parameter ("id_agent");
$sql = sprintf ("INSERT INTO tincidencia
(inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator, id_agent, id_agente_modulo)
VALUES
(NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0)",
$titulo, $descripcion, $usuario, $origen, $estado, $prioridad, $grupo, $config["id_user"], $id_agent);
$id_inc = db_process_sql ($sql, "insert_id");
if ($id_inc === false) {
@ -130,7 +138,7 @@ elseif ($action == "insert") {
}
else {
ui_print_success_message(__('Incident created'));
db_pandora_audit("Incident created", "User ".$config["id_user"]." created incident #".$id_inc);
db_pandora_audit("Incident created", "User " . $config["id_user"] . " created incident #" . $id_inc);
}
}
@ -339,7 +347,12 @@ else {
$data[4] = ui_print_group_icon ($row["id_grupo"], true);
$data[5] = ui_print_timestamp ($row["actualizacion"], true);
$data[6] = $row["origen"];
$data[7] = ui_print_username ($row["id_usuario"], true);
if (empty($row["id_usuario"])) {
$data[7] = 'SYSTEM';
}
else {
$data[7] = ui_print_username ($row["id_usuario"], true);
}
if (check_acl ($config["id_user"], $row["id_grupo"], "IM") || $config["id_user"] == $row["id_usuario"] || $config["id_user"] == $row["id_creator"]) {
$data[8] = html_print_checkbox ("id_inc[]", $row["id_incidencia"], false, true);

View File

@ -22,7 +22,7 @@ require_once ("include/functions_events.php"); //To get events group information
check_login ();
if (! check_acl ($config["id_user"], 0, "IR")) {
// Doesn't have access to this page
// Doesn't have access to this page
db_pandora_audit("ACL Violation", "Trying to access incident details");
require ("general/noaccess.php");
exit;
@ -56,7 +56,8 @@ if (isset ($_GET["id"])) {
if (isset ($_GET["insertar_nota"])) {
$nota = get_parameter ("nota");
$sql = sprintf ("INSERT INTO tnota (id_usuario, id_incident, nota) VALUES ('%s', %d, '%s')",$config["id_user"],$id_inc, $nota);
$sql = sprintf ("INSERT INTO tnota (id_usuario, id_incident, nota)
VALUES ('%s', %d, '%s')", $config["id_user"], $id_inc, $nota);
$id_nota = db_process_sql ($sql, "insert_id");
if ($id_nota !== false) {
@ -91,14 +92,19 @@ if (isset ($_GET["id"])) {
($id_owner == $config["id_user"])) AND isset ($_POST["delete_file"])) {
$file_id = (int) get_parameter ("delete_file", 0);
$filename = db_get_value ("filename", "tattachment", "id_attachment", $file_id);
$sql = sprintf ("DELETE FROM tattachment WHERE id_attachment = %d",$file_id);
$sql = sprintf ("
DELETE
FROM tattachment
WHERE id_attachment = %d",$file_id);
$result = db_process_sql ($sql);
if (!empty ($result)) {
if (file_exists($config['homedir'] . '/attachment/pand'.$row["id_attachment"].'_'.$row["filename"]. ".zip"))
unlink ($config["attachment_store"]."/pand".$file_id."_".io_safe_output($filename). ".zip");
if (file_exists($config['homedir'] . '/attachment/pand' . $row["id_attachment"].'_'.$row["filename"]. ".zip"))
unlink ($config["attachment_store"] .
"/pand" . $file_id . "_" . io_safe_output($filename) . ".zip");
else
unlink ($config["attachment_store"]."/pand".$file_id."_".io_safe_output($filename));
unlink ($config["attachment_store"] .
"/pand" . $file_id . "_" . io_safe_output($filename));
incidents_process_touch ($id_inc);