#13520 fixed message error when create snmp policy

This commit is contained in:
Daniel Cebrian 2024-04-29 15:45:57 +02:00
parent ed5ddc1799
commit b60b96239f
1 changed files with 6 additions and 1 deletions

View File

@ -1588,7 +1588,12 @@ function snmp_browser_create_modules_snmp(
enterprise_include_once('include/functions_policies.php'); enterprise_include_once('include/functions_policies.php');
foreach ($id_target as $policy) { foreach ($id_target as $policy) {
$ids[] = policies_create_module($oid['oid'], $policy, 2, $values); $exist = db_get_row_filter('tpolicy_modules', ['name' => $oid['oid'], 'id_policy' => $policy], '*');
if ($exist !== false) {
$ids[] = false;
} else {
$ids[] = policies_create_module($oid['oid'], $policy, 2, $values);
}
} }
} }
} }