Fixed message issue
This commit is contained in:
parent
93d70da822
commit
0e12402469
|
@ -231,7 +231,7 @@ if ($create_agent) {
|
|||
if ($alias == '') {
|
||||
$agent_creation_error = __('No agent alias specified');
|
||||
$agent_created_ok = 0;
|
||||
} else if (group_allow_more_agents($grupo, true) === false) {
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
$agent_creation_error = __('Agent cannot be created due to the maximum agent limit for this group');
|
||||
$agent_created_ok = 0;
|
||||
} else {
|
||||
|
@ -1039,7 +1039,7 @@ if ($update_agent) {
|
|||
|
||||
if ($grupo <= 0) {
|
||||
ui_print_error_message(__('The group id %d is incorrect.', $grupo));
|
||||
} else if (group_allow_more_agents($grupo, true) === false) {
|
||||
} else if (group_allow_more_agents($grupo, true, 'update') === false) {
|
||||
ui_print_error_message(__('Agent cannot be updated due to the maximum agent limit for this group'));
|
||||
} else if ($exists_ip) {
|
||||
ui_print_error_message(__('Duplicate main IP address'));
|
||||
|
|
|
@ -1480,7 +1480,7 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
|||
}
|
||||
|
||||
// Check if group allow more agents or have limit stablished.
|
||||
if (group_allow_more_agents($idGroup) === false) {
|
||||
if (group_allow_more_agents($idGroup, true, 'update') === false) {
|
||||
returnError('Agent cannot be updated due to the maximum agent limit for this group');
|
||||
return;
|
||||
}
|
||||
|
@ -1686,7 +1686,7 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
|||
returnError('The agent name already exists in DB.');
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
|
||||
returnError('The group does not exist.');
|
||||
} else if (group_allow_more_agents($grupo) === false) {
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
returnError('Agent cannot be created due to the maximum agent limit for this group');
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
|
||||
returnError('The OS does not exist.');
|
||||
|
|
Loading…
Reference in New Issue