Commit 4fe0c76cf065a3e002748e44a5dc7782b25b992f
Exists in
master
and in
1 other branch
Corrige a inseração de IP Vazio na coleta do Cacic
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
src/Cacic/CommonBundle/Entity/ComputadorRepository.php
... | ... | @@ -285,7 +285,7 @@ class ComputadorRepository extends EntityRepository |
285 | 285 | /* |
286 | 286 | * Metodo responsável por inserir coletas iniciais, assim que o cacic é instalado |
287 | 287 | */ |
288 | - public function getComputadorPreCole( Request $request , $te_so , $te_node_adress, $rede, $so ) | |
288 | + public function getComputadorPreCole( Request $request , $te_so , $te_node_adress, $rede, $so, $ip_computador ) | |
289 | 289 | { |
290 | 290 | //recebe dados via POST, deCripata dados, e attribui a variaveis |
291 | 291 | $computer_system = OldCacicHelper::deCrypt( $request, $request->request->get('ComputerSystem'), true ); |
... | ... | @@ -320,7 +320,7 @@ class ComputadorRepository extends EntityRepository |
320 | 320 | $computador->setTeVersaoCacic( $te_versao_cacic ); |
321 | 321 | $computador->setTeVersaoGercols( $te_versao_gercols ); |
322 | 322 | $computador->setTeUltimoLogin( TagValueHelper::getValueFromTags( 'UserName' ,$computer_system ) ); |
323 | - $computador->setTeIpComputador( TagValueHelper::getValueFromTags( 'IPAddress' ,$network_adapter ) ); | |
323 | + $computador->setTeIpComputador( $ip_computador ); | |
324 | 324 | $computador->setNmComputador( TagValueHelper::getValueFromTags( 'Caption' ,$computer_system )); |
325 | 325 | $this->getEntityManager()->persist( $computador ); |
326 | 326 | ... | ... |
src/Cacic/WSBundle/Controller/DefaultController.php
... | ... | @@ -83,7 +83,7 @@ class DefaultController extends Controller |
83 | 83 | //vefifica se existe SO coletado se não, insere novo SO |
84 | 84 | $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so ); |
85 | 85 | $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); |
86 | - $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $te_so, $te_node_address, $rede, $so ); | |
86 | + $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $te_so, $te_node_address, $rede, $so, $ip_computador ); | |
87 | 87 | //$local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() )); |
88 | 88 | $local = $rede->getIdLocal(); |
89 | 89 | |
... | ... | @@ -161,7 +161,7 @@ class DefaultController extends Controller |
161 | 161 | $te_node_adress = TagValueHelper::getValueFromTags( 'MACAddress', OldCacicHelper::deCrypt( $request, $request->get('NetworkAdapterConfiguration'))); |
162 | 162 | $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$request->get( 'te_so' ))); |
163 | 163 | $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); |
164 | - $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress, $rede, $so ); | |
164 | + $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress, $rede, $so, $ip_computador ); | |
165 | 165 | //$local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() )); |
166 | 166 | $local = $rede->getIdLocal(); |
167 | 167 | $data = new \DateTime('NOW'); | ... | ... |