From 8a43421b49aad8d5ee2a72d44a4a41247de2d35e Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 27 Oct 2022 15:18:15 +0200 Subject: [PATCH] Fix module type validadion on api set create network module --- pandora_console/include/functions_api.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 0f5f01590d..8b8c46e7c3 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3587,6 +3587,19 @@ function api_set_create_network_module($id, $thrash1, $other, $thrash3) // Column 'module_macros' cannot be null. } + $type_exist = db_get_value_filter( + 'id_tipo', + 'ttipo_modulo', + [ + 'id_tipo' => $values['id_tipo_modulo'], + ] + ); + + if ((bool) $type_exist === false) { + returnError('Module type does not exist'); + return; + } + if ($agent_by_alias) { $agents_affected = 0; $idModule = false;