Merge branch 'ent-6236-llamada-delete_agent-api-no-funciona-en-metaconsola' into 'develop'
fixed error on delete agent api See merge request artica/pandorafms!3409
This commit is contained in:
commit
f3e63ea9ec
|
@ -1861,13 +1861,13 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3)
|
||||||
foreach ($servers as $server) {
|
foreach ($servers as $server) {
|
||||||
if (metaconsole_connect($server) == NOERR) {
|
if (metaconsole_connect($server) == NOERR) {
|
||||||
if ($other['data'][0] === '1') {
|
if ($other['data'][0] === '1') {
|
||||||
$idAgent[0] = agents_get_agent_id_by_alias($id);
|
$idAgent = agents_get_agent_id_by_alias($id);
|
||||||
} else {
|
} else {
|
||||||
$idAgent[0] = agents_get_agent_id($id, true);
|
$idAgent[0] = agents_get_agent_id($id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($idAgent[0]) {
|
if (!empty($idAgent)) {
|
||||||
$result = agents_delete_agent($idAgent, true);
|
$result = agents_delete_agent($idAgent[0], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
|
Loading…
Reference in New Issue