2013-05-13 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/configurar_agente.php, include/functions_tags.php, include/functions_incidents.php, include/functions_agents.php, operation/messages/message_list.php: erased the SQL transitions. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8125 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b064082064
commit
e93f2580e2
|
@ -1,3 +1,9 @@
|
|||
2013-05-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/agentes/configurar_agente.php, include/functions_tags.php,
|
||||
include/functions_incidents.php, include/functions_agents.php,
|
||||
operation/messages/message_list.php: erased the SQL transitions.
|
||||
|
||||
2013-05-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_graph.php: fixed PHP warnings.
|
||||
|
|
|
@ -1101,7 +1101,6 @@ if ($delete_module) { // DELETE agent module !
|
|||
|
||||
//Init transaction
|
||||
$error = 0;
|
||||
db_process_sql_begin ();
|
||||
|
||||
// First delete from tagente_modulo -> if not successful, increment
|
||||
// error. NOTICE that we don't delete all data here, just marking for deletion
|
||||
|
@ -1203,11 +1202,9 @@ if ($delete_module) { // DELETE agent module !
|
|||
|
||||
//Check for errors
|
||||
if ($error != 0) {
|
||||
db_process_sql_rollback ();
|
||||
ui_print_error_message(__('There was a problem deleting the module'));
|
||||
}
|
||||
else {
|
||||
db_process_sql_commit ();
|
||||
ui_print_success_message(__('Module deleted succesfully'));
|
||||
|
||||
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
|
||||
|
@ -1293,8 +1290,6 @@ if ($updateGIS) {
|
|||
$previusAgentGISData = db_get_row_sql("SELECT *
|
||||
FROM tgis_data_status WHERE tagente_id_agente = " . $idAgente);
|
||||
|
||||
db_process_sql_begin();
|
||||
|
||||
db_process_sql_update('tagente', array('update_gis_data' => $updateGisData),
|
||||
array('id_agente' => $idAgente));
|
||||
|
||||
|
@ -1336,7 +1331,6 @@ if ($updateGIS) {
|
|||
"description" => __('Insert by Pandora Console')
|
||||
));
|
||||
}
|
||||
db_process_sql_commit();
|
||||
}
|
||||
|
||||
// -----------------------------------
|
||||
|
|
|
@ -83,8 +83,6 @@ function agents_create_agent ($name, $id_group, $interval, $ip_address, $values
|
|||
$values['intervalo'] = $interval;
|
||||
$values['direccion'] = $ip_address;
|
||||
|
||||
db_process_sql_begin ();
|
||||
|
||||
$id_agent = db_process_sql_insert ('tagente', $values);
|
||||
if ($id_agent === false) {
|
||||
db_process_sql_rollback ();
|
||||
|
@ -94,7 +92,7 @@ function agents_create_agent ($name, $id_group, $interval, $ip_address, $values
|
|||
// Create address for this agent in taddress
|
||||
agents_add_address ($id_agent, $ip_address);
|
||||
|
||||
// Create special module agent_keepalive
|
||||
// Create special module agent_keepalive
|
||||
$values_modules = array ('id_tipo_modulo' => 100,
|
||||
'descripcion' => __('Agent keepalive monitor'),
|
||||
'id_modulo' => 1,
|
||||
|
@ -108,8 +106,6 @@ function agents_create_agent ($name, $id_group, $interval, $ip_address, $values
|
|||
return false;
|
||||
}
|
||||
|
||||
db_process_sql_commit ();
|
||||
|
||||
db_pandora_audit ("Agent management", "New agent '$name' created");
|
||||
|
||||
return $id_agent;
|
||||
|
@ -1693,9 +1689,6 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
|
|||
if (! is_array ($id_agents))
|
||||
$id_agents = (array) $id_agents;
|
||||
|
||||
//Start transaction
|
||||
db_process_sql_begin ();
|
||||
|
||||
foreach ($id_agents as $id_agent) {
|
||||
$id_agent = (int) $id_agent; //Cast as integer
|
||||
if ($id_agent < 1)
|
||||
|
@ -1807,11 +1800,9 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
|
|||
}
|
||||
|
||||
if ($error) {
|
||||
db_process_sql_rollback ();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
db_process_sql_commit ();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,9 +242,7 @@ function incidents_delete_incident ($id_incident) {
|
|||
$attachments = array ();
|
||||
$errors = 0;
|
||||
|
||||
//Start transaction
|
||||
db_process_sql_begin ();
|
||||
|
||||
|
||||
foreach ($ids as $id_inc) {
|
||||
//Delete incident
|
||||
$ret = db_process_sql_delete('tincidencia', array('id_incidencia' => $id_inc));
|
||||
|
@ -267,11 +265,8 @@ function incidents_delete_incident ($id_incident) {
|
|||
}
|
||||
|
||||
if ($errors > 0) {
|
||||
//This will also rollback the audit log
|
||||
db_process_sql_rollback ();
|
||||
return false;
|
||||
}
|
||||
db_process_sql_commit ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -288,12 +283,6 @@ function incidents_delete_note ($id_note, $transact = true) {
|
|||
$id_note = (array) safe_int ($id_note, 1); //cast as array
|
||||
$errors = 0;
|
||||
|
||||
//Start transaction
|
||||
if ($transact == true){
|
||||
db_process_sql_begin ();
|
||||
db_process_sql_commit ();
|
||||
}
|
||||
|
||||
//Delete notes
|
||||
foreach ($id_note as $id) {
|
||||
$ret = db_process_sql_delete ('tnota', array ('id_nota' => $id));
|
||||
|
@ -302,15 +291,7 @@ function incidents_delete_note ($id_note, $transact = true) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($transact == true && $errors > 0) {
|
||||
db_process_sql_rollback ();
|
||||
return false;
|
||||
}
|
||||
elseif ($transact == true) {
|
||||
db_process_sql_commit ();
|
||||
return true;
|
||||
}
|
||||
elseif ($errors > 0) {
|
||||
if ($errors > 0) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
@ -332,11 +313,6 @@ function incidents_delete_attach ($id_attach, $transact = true) {
|
|||
$id_attach = (array) safe_int ($id_attach, 1); //cast as array
|
||||
$errors = 0;
|
||||
|
||||
//Start transaction
|
||||
if ($transact == true) {
|
||||
db_process_sql_begin ();
|
||||
}
|
||||
|
||||
//Delete attachment
|
||||
foreach ($id_attach as $id) {
|
||||
$filename = db_get_value ("filename", "tattachment", "id_attachment", $id);
|
||||
|
@ -348,15 +324,7 @@ function incidents_delete_attach ($id_attach, $transact = true) {
|
|||
unlink ($config["attachment_store"]."/pand".$id."_".$filename);
|
||||
}
|
||||
|
||||
if ($transact == true && $errors > 0) {
|
||||
db_process_sql_rollback ();
|
||||
return false;
|
||||
}
|
||||
elseif ($transact == true) {
|
||||
db_process_sql_commit ();
|
||||
return true;
|
||||
}
|
||||
elseif ($errors > 0) {
|
||||
if ($errors > 0) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -420,8 +420,6 @@ function tags_insert_module_tag ($id_agent_module, $tags) {
|
|||
function tags_insert_policy_module_tag ($id_agent_module, $tags) {
|
||||
$errn = 0;
|
||||
|
||||
db_process_sql_begin();
|
||||
|
||||
$values = array();
|
||||
foreach ($tags as $tag) {
|
||||
//Protect against default insert
|
||||
|
@ -436,11 +434,9 @@ function tags_insert_policy_module_tag ($id_agent_module, $tags) {
|
|||
}
|
||||
|
||||
if ($errn > 0) {
|
||||
db_process_sql_rollback();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
db_process_sql_commit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,22 +60,15 @@ if ($delete_msg) {
|
|||
if ($multiple_delete) {
|
||||
$ids = (array)get_parameter('delete_multiple', array());
|
||||
|
||||
db_process_sql_begin();
|
||||
|
||||
foreach ($ids as $id) {
|
||||
$result = db_process_sql_delete ('tmensajes',
|
||||
array ('id_mensaje' => $id));
|
||||
|
||||
if ($result === false) {
|
||||
db_process_sql_rollback();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
db_process_sql_commit();
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting messages'));
|
||||
|
|
Loading…
Reference in New Issue