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 29dfd3df9b
commit 3a7e5fcf2f
1 changed files with 12 additions and 2 deletions

View File

@ -1088,7 +1088,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)));
}
@ -1181,7 +1186,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));
}