mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
fixed error on delete agent api
This commit is contained in:
parent
f0a91cce56
commit
195f09a7cf
@ -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…
x
Reference in New Issue
Block a user