fixed error on delete agent api

This commit is contained in:
marcos 2020-08-21 09:40:24 +02:00
parent f0a91cce56
commit 195f09a7cf
1 changed files with 3 additions and 3 deletions

View File

@ -1861,13 +1861,13 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3)
foreach ($servers as $server) {
if (metaconsole_connect($server) == NOERR) {
if ($other['data'][0] === '1') {
$idAgent[0] = agents_get_agent_id_by_alias($id);
$idAgent = agents_get_agent_id_by_alias($id);
} else {
$idAgent[0] = agents_get_agent_id($id, true);
}
if ($idAgent[0]) {
$result = agents_delete_agent($idAgent, true);
if (!empty($idAgent)) {
$result = agents_delete_agent($idAgent[0], true);
}
metaconsole_restore_db();