Commit 7e120ab0770885dd003c8a35ee7f100c8da21812
Exists in
master
and in
1 other branch
Merge branch 'master' of https://github.com/lightbase/cacic
Showing
3 changed files
with
28 additions
and
16 deletions
Show diff stats
src/Cacic/CommonBundle/Entity/AcaoRedeRepository.php
| ... | ... | @@ -83,13 +83,17 @@ class AcaoRedeRepository extends EntityRepository |
| 83 | 83 | $acoes = $em->getRepository( 'CacicCommonBundle:Acao' )->findAll(); |
| 84 | 84 | |
| 85 | 85 | foreach ($redes as $novaRede) { |
| 86 | + | |
| 86 | 87 | // Para cada rede, habilita as ações |
| 87 | - foreach ($acoes as $novaAcao) { | |
| 88 | - $new = $this->find( array( 'acao' => $novaAcao->getIdAcao(), 'rede' => $novaRede->getIdRede() )); | |
| 89 | - // Se não existir, cria a ação para a rede | |
| 90 | - if ( empty($new) ) { | |
| 91 | - $new = new AcaoRede(); | |
| 92 | - } | |
| 88 | + foreach ($acoes as $novaAcao){ | |
| 89 | + // com excessão do módulo patrimonio, que inicialmente é desabilitado | |
| 90 | + if ($novaAcao->getIdAcao() != "col_patr"){ | |
| 91 | + $new = $this->find( array( 'acao' => $novaAcao->getIdAcao(), 'rede' => $novaRede->getIdRede() )); | |
| 92 | + | |
| 93 | + // Se não existir, cria a ação para a rede | |
| 94 | + if ( empty($new) ) { | |
| 95 | + $new = new AcaoRede(); | |
| 96 | + } | |
| 93 | 97 | |
| 94 | 98 | // Agora cria a ação |
| 95 | 99 | $new->setAcao($novaAcao); |
| ... | ... | @@ -98,6 +102,7 @@ class AcaoRedeRepository extends EntityRepository |
| 98 | 102 | |
| 99 | 103 | // Grava as mudanças |
| 100 | 104 | $em->flush(); |
| 105 | + } | |
| 101 | 106 | } |
| 102 | 107 | |
| 103 | 108 | } | ... | ... |
src/Cacic/WSBundle/Controller/DefaultController.php
| ... | ... | @@ -122,14 +122,16 @@ class DefaultController extends Controller |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - | |
| 126 | 125 | $response = new Response(); |
| 127 | 126 | $response->headers->set('Content-Type', 'xml'); |
| 128 | 127 | $cacic_helper = new OldCacicHelper($this->get('kernel')); |
| 128 | + | |
| 129 | + $testcoleta = '[forca_coleta]' . $computador->getForcaColeta() . '[/forca_coleta]'; | |
| 129 | 130 | return $this->render('CacicWSBundle:Default:test.xml.twig', array( |
| 130 | 131 | 'configs'=> $cacic_helper->getTest( $request ), |
| 131 | 132 | 'computador' => $computador, |
| 132 | 133 | 'rede' => $rede, |
| 134 | + 'testcoleta' => $testcoleta, | |
| 133 | 135 | 'debugging' => $debugging, |
| 134 | 136 | 'ws_folder' => OldCacicHelper::CACIC_WEB_SERVICES_FOLDER_NAME, |
| 135 | 137 | 'cs_cipher' => $request->get('cs_cipher'), |
| ... | ... | @@ -144,7 +146,7 @@ class DefaultController extends Controller |
| 144 | 146 | public function configAction( Request $request ) |
| 145 | 147 | { |
| 146 | 148 | OldCacicHelper::autenticaAgente($request); |
| 147 | - | |
| 149 | + $logger = $this->get('logger'); | |
| 148 | 150 | $strNetworkAdapterConfiguration = OldCacicHelper::deCrypt( $request, $request->get('NetworkAdapterConfiguration') ); |
| 149 | 151 | $netmask = TagValueHelper::getValueFromTags( 'IPSubnet', $strNetworkAdapterConfiguration ); |
| 150 | 152 | $ip_computador = $request->get('te_ip_computador'); |
| ... | ... | @@ -232,7 +234,6 @@ class DefaultController extends Controller |
| 232 | 234 | { |
| 233 | 235 | |
| 234 | 236 | $servidorAutenticacao = $rede->getIdServidorAutenticacao(); |
| 235 | -// error_log('3333333333333333333333333333333333333333333333: '.$servidorAutenticacao->getInAtivo()); | |
| 236 | 237 | if (!empty($servidorAutenticacao) and $servidorAutenticacao->getInAtivo() == 'S'){ |
| 237 | 238 | $strPatrimonio = |
| 238 | 239 | '[ip]' . $servidorAutenticacao->getTeIpServidorAutenticacao() . '[/ip]' . |
| ... | ... | @@ -244,7 +245,8 @@ class DefaultController extends Controller |
| 244 | 245 | '[retorno2]' . $servidorAutenticacao->getTeAtributoRetornaEmail() . '[/retorno2]' . |
| 245 | 246 | '[retorno3]' . $servidorAutenticacao->getTeAtributoRetornaTelefone() . '[/retorno3]' . |
| 246 | 247 | '[tipo_protocolo]' . $servidorAutenticacao->getIdTipoProtocolo() . '[/tipo_protocolo]'. |
| 247 | - '[porta]' . $servidorAutenticacao->getNuPortaServidorAutenticacao() . '[/porta]' ; | |
| 248 | + '[porta]' . $servidorAutenticacao->getNuPortaServidorAutenticacao() . '[/porta]' ; | |
| 249 | +; | |
| 248 | 250 | $strPatrimonio ='[dados_ldap]' . OldCacicHelper::enCrypt($request, $strPatrimonio) . '[/dados_ldap]' ; |
| 249 | 251 | } |
| 250 | 252 | /*$dadosPatrimonio = $this->getDoctrine()->getRepository('CacicCommonBundle:ComputadorColeta')->findBy(array('idClass'=>'Patrimonio', 'idComputador'=>$computador->getIdComputador())); |
| ... | ... | @@ -382,7 +384,7 @@ class DefaultController extends Controller |
| 382 | 384 | if (in_array($so->getSgSo(),$arrSgSOtoOlds)) |
| 383 | 385 | { |
| 384 | 386 | $v_te_arq_ver_eng_w9x = trim($monitorado["teArqVerEngW9x"]); |
| 385 | - if ($v_te_arq_ver_eng_w9x=='') $v_te_arq_ver_eng_w9x = '.'; | |
| 387 | + if ($v_te_arq_ver_eng_w9x=='') $v_getRedete_arq_ver_eng_w9x = '.'; | |
| 386 | 388 | |
| 387 | 389 | $v_te_arq_ver_pat_w9x = trim($monitorado["teArqVerPatW9x"]); |
| 388 | 390 | if ($v_te_arq_ver_pat_w9x=='') $v_te_arq_ver_pat_w9x = '.'; |
| ... | ... | @@ -454,22 +456,25 @@ class DefaultController extends Controller |
| 454 | 456 | $strCollectsDefinitions .= '[Actions]' . $strAcoesSelecionadas . '[/Actions]'; |
| 455 | 457 | } |
| 456 | 458 | |
| 457 | - //error_log("333333333333333333333333333333333333333333: $strCollectsDefinitions"); | |
| 458 | - | |
| 459 | 459 | if (!empty($strCollectsDefinitions)) |
| 460 | 460 | $strCollectsDefinitions = OldCacicHelper::enCrypt($request, $strCollectsDefinitions); |
| 461 | 461 | |
| 462 | 462 | if($request->get('AgenteLinux')) |
| 463 | 463 | $agente_py = true; |
| 464 | 464 | |
| 465 | - $configs = $this->getDoctrine()->getRepository('CacicCommonBundle:ConfiguracaoLocal')->listarPorLocal($local->getIdLocal()); | |
| 465 | + //verifica se o modulo de patrimonio está habilitado | |
| 466 | + $patr = $this->getDoctrine()->getRepository('CacicCommonBundle:AcaoRede')->findOneBy( array('rede'=>$rede->getIdRede(), 'acao'=>'col_patr')); | |
| 467 | +// error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>:".$patr->getRede()->getIdRede()); | |
| 468 | + if (!empty($patr)) | |
| 469 | + $modPatrimonio = "S"; | |
| 470 | + else | |
| 471 | + $modPatrimonio = "N"; | |
| 466 | 472 | |
| 473 | + $configs = $this->getDoctrine()->getRepository('CacicCommonBundle:ConfiguracaoLocal')->listarPorLocal($local->getIdLocal()); | |
| 467 | 474 | //informações dos modulos do agente, nome, versao, hash |
| 468 | 475 | $redes_versoes_modulos = $this->getDoctrine()->getRepository('CacicCommonBundle:RedeVersaoModulo')->findBy( array( 'idRede'=>$rede->getIdRede() ) ); |
| 469 | - | |
| 470 | 476 | $nm_user_login_updates = OldCacicHelper::enCrypt($request, $rede->getNmUsuarioLoginServUpdates()); |
| 471 | 477 | $senha_serv_updates = OldCacicHelper::enCrypt($request, $rede->getTeSenhaLoginServUpdates()); |
| 472 | - | |
| 473 | 478 | $response = new Response(); |
| 474 | 479 | $response->headers->set('Content-Type', 'xml'); |
| 475 | 480 | return $this->render('CacicWSBundle:Default:config.xml.twig', array( |
| ... | ... | @@ -491,6 +496,7 @@ class DefaultController extends Controller |
| 491 | 496 | 'v_te_fila_ftp'=>$v_te_fila_ftp, |
| 492 | 497 | 'rede_grupos_ftp'=>$rede_grupos_ftp, |
| 493 | 498 | 'strPatrimonio'=>$strPatrimonio, |
| 499 | + 'modPatrimonio'=> $modPatrimonio, | |
| 494 | 500 | ), $response); |
| 495 | 501 | } |
| 496 | 502 | } | ... | ... |
src/Cacic/WSBundle/Resources/views/Default/config.xml.twig
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | <{{config.nmConfiguracao|upper}}>{{config.vlConfiguracao}}</{{config.nmConfiguracao|upper}}> |
| 6 | 6 | {% endfor %} |
| 7 | 7 | <TeDebugging>{{ debugging }}</TeDebugging> |
| 8 | + <ModPatrimonio>{{ modPatrimonio }}</ModPatrimonio> | |
| 8 | 9 | <IdComputador>{{ computador.getIdComputador() }}</IdComputador> |
| 9 | 10 | <WebManagerAddress>{{ rede.getTeServCacic() }}</WebManagerAddress> |
| 10 | 11 | <WebServicesFolderName>{{ ws_folder }}</WebServicesFolderName> | ... | ... |