#10353 Removed name validation for new network components

This commit is contained in:
Jorge Rincon 2023-04-13 11:36:57 +02:00
parent 0e8a74a4b8
commit 53d813fa0b
1 changed files with 3 additions and 16 deletions

View File

@ -340,14 +340,7 @@ if ($type >= MODULE_TYPE_REMOTE_SNMP && $type <= MODULE_TYPE_REMOTE_SNMP_PROC) {
} }
if ($is_management_allowed === true && $create_component) { if ($is_management_allowed === true && $create_component) {
$name_check = db_get_value( if ($name) {
'name',
'tnetwork_component',
'name',
$name
);
if ($name && !$name_check) {
$id = network_components_create_network_component( $id = network_components_create_network_component(
$name, $name,
$type, $type,
@ -427,14 +420,8 @@ if ($is_management_allowed === true && $create_component) {
AUDIT_LOG_MODULE_MANAGEMENT, AUDIT_LOG_MODULE_MANAGEMENT,
'Fail try to create remote component' 'Fail try to create remote component'
); );
// Other cases.
if ($name_check !== false) { ui_print_error_message(__('Could not be created'));
// If name exists, advice about it.
ui_print_error_message(__('Could not be created because the component exists'));
} else {
// Other cases.
ui_print_error_message(__('Could not be created'));
}
include_once 'godmode/modules/manage_network_components_form.php'; include_once 'godmode/modules/manage_network_components_form.php';
return; return;