Commit 3c3f70c79b54f6cdedd9fec725701ac2b564b611
1 parent
e4ac1540
Exists in
master
and in
1 other branch
Adiciona mais uma possibilidade de identificar o MAC Address e a Máscara de rede
Showing
3 changed files
with
28 additions
and
1 deletions
Show diff stats
src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php
| ... | ... | @@ -100,7 +100,7 @@ class ComputadorColetaRepository extends EntityRepository |
| 100 | 100 | { |
| 101 | 101 | $_dql = "SELECT c |
| 102 | 102 | FROM CacicCommonBundle:Classe c |
| 103 | - WHERE c.nmClassName NOT IN ('SoftwareList', 'Patrimonio') | |
| 103 | + WHERE c.nmClassName NOT IN ('SoftwareList') | |
| 104 | 104 | ORDER BY c.nmClassName"; |
| 105 | 105 | |
| 106 | 106 | $_dql = $this->getEntityManager()->createQuery( $_dql ); | ... | ... |
src/Cacic/WSBundle/Controller/ColetaController.php
| ... | ... | @@ -58,10 +58,18 @@ class ColetaController extends Controller |
| 58 | 58 | //$ultimo_login = TagValueHelper::getValueFromTags( 'UserName' , $strComputerSystem); |
| 59 | 59 | $grava_teste = ''; |
| 60 | 60 | |
| 61 | + // Caso não tenha encontrado, tenta pegar a variável da requisição | |
| 62 | + if (empty($te_node_address)) { | |
| 63 | + $te_node_adress = $request->get('te_node_address'); | |
| 64 | + } | |
| 65 | + | |
| 61 | 66 | //vefifica se existe SO coletado se não, insere novo SO |
| 62 | 67 | $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$te_so) ); |
| 63 | 68 | $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->findOneBy( array('idSo'=>$so, 'teNodeAddress'=>$te_node_adress) ); |
| 64 | 69 | $netmask = TagValueHelper::getValueFromTags( 'IPSubnet', $strNetworkAdapterConfiguration ); |
| 70 | + if (empty($netmask)) { | |
| 71 | + $netmask = $request->get('netmask'); | |
| 72 | + } | |
| 65 | 73 | $ip_computador = $request->get('te_ip_computador'); |
| 66 | 74 | if ( empty($ip_computador) ){ |
| 67 | 75 | $ip_computador = TagValueHelper::getValueFromTags( 'IPAddress', $strNetworkAdapterConfiguration ); | ... | ... |
src/Cacic/WSBundle/Controller/DefaultController.php
| ... | ... | @@ -96,6 +96,15 @@ class DefaultController extends Controller |
| 96 | 96 | #$logger->debug("333333333333333333333333333333333333: $ip_computador"); |
| 97 | 97 | $logger->debug("Teste de Conexão! Ip do computador: $ip_computador Máscara da rede: $netmask"); |
| 98 | 98 | |
| 99 | + // Caso não tenha encontrado, tenta pegar a variável da requisição | |
| 100 | + if (empty($te_node_address)) { | |
| 101 | + $te_node_address = $request->get('te_node_address'); | |
| 102 | + } | |
| 103 | + | |
| 104 | + if (empty($netmask)) { | |
| 105 | + $netmask = $request->get('netmask'); | |
| 106 | + } | |
| 107 | + | |
| 99 | 108 | //vefifica se existe SO coletado se não, insere novo SO |
| 100 | 109 | $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so ); |
| 101 | 110 | $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); |
| ... | ... | @@ -181,6 +190,16 @@ class DefaultController extends Controller |
| 181 | 190 | } |
| 182 | 191 | |
| 183 | 192 | $te_node_adress = TagValueHelper::getValueFromTags( 'MACAddress', OldCacicHelper::deCrypt( $request, $request->get('NetworkAdapterConfiguration'))); |
| 193 | + | |
| 194 | + // Caso não tenha encontrado, tenta pegar a variável da requisição | |
| 195 | + if (empty($te_node_address)) { | |
| 196 | + $te_node_address = $request->get('te_node_address'); | |
| 197 | + } | |
| 198 | + | |
| 199 | + if (empty($netmask)) { | |
| 200 | + $netmask = $request->get('netmask'); | |
| 201 | + } | |
| 202 | + | |
| 184 | 203 | $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$request->get( 'te_so' ))); |
| 185 | 204 | $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); |
| 186 | 205 | $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress, $rede, $so, $ip_computador ); | ... | ... |