Blocks nonexistent id_agent when updating modules with api #3191
This commit is contained in:
parent
a344615359
commit
7e6f3c46c4
|
@ -1900,6 +1900,12 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// Check if agent exists
|
||||
$check_id_agent = db_get_value ('id_agente', 'tagente', 'id_agente', $other['data'][0]);
|
||||
if (!$check_id_agent) {
|
||||
returnError('error_update_data_module', __('Error updating network module. Id_agent doesn\'t exists.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$network_module_fields = array('id_agente',
|
||||
|
@ -2097,6 +2103,12 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// Check if agent exists
|
||||
$check_id_agent = db_get_value ('id_agente', 'tagente', 'id_agente', $other['data'][0]);
|
||||
if (!$check_id_agent) {
|
||||
returnError('error_update_data_module', __('Error updating plugin module. Id_agent doesn\'t exists.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$plugin_module_fields = array('id_agente',
|
||||
|
@ -2416,6 +2428,12 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// Check if agent exists
|
||||
$check_id_agent = db_get_value ('id_agente', 'tagente', 'id_agente', $other['data'][0]);
|
||||
if (!$check_id_agent) {
|
||||
returnError('error_update_data_module', __('Error updating data module. Id_agent doesn\'t exists.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$data_module_fields = array('id_agente',
|
||||
|
@ -2673,6 +2691,12 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// Check if agent exists
|
||||
$check_id_agent = db_get_value ('id_agente', 'tagente', 'id_agente', $other['data'][0]);
|
||||
if (!$check_id_agent) {
|
||||
returnError('error_update_data_module', __('Error updating snmp module. Id_agent doesn\'t exists.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# SNMP version 3
|
||||
|
|
Loading…
Reference in New Issue