Added the handling of agent's address list at new_agent/update_agent API call.

This commit is contained in:
Hirofumi Kosaka 2016-07-21 17:15:22 +09:00
parent b7681c23c8
commit 517cf4c1a3
1 changed files with 12 additions and 2 deletions

View File

@ -1061,7 +1061,12 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
'id_parent' => $idParent,
'custom_id' => $customId),
array('id_agente' => $id_agent));
if ( $return && !empty($ip)) {
// register ip for this agent in 'taddress'
agents_add_address ($id_agent, $ip);
}
returnData('string',
array('type' => 'string', 'data' => (int)((bool)$return)));
}
@ -1154,7 +1159,12 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) {
'server_name' => $nameServer,
'id_parent' => $idParent,
'custom_id' => $customId));
if (!empty($idAgente) && !empty($ip)) {
// register ip for this agent in 'taddress'
agents_add_address ($idAgente, $ip);
}
returnData('string',
array('type' => 'string', 'data' => $idAgente));
}