Commit 7b9e9b040133bfa4959c54545c7612541a7adef7
1 parent
b2a8ca76
Exists in
master
and in
1 other branch
Correcoes logicas diversas, adequacoes aos blocos de internacionalizacao e sincr…
…onizacao com servidor de desenvolvimento Dataprev/ES git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@499 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
12 changed files
with
172 additions
and
62 deletions
Show diff stats
relatorios/alteracoes_hardware/index.php
... | ... | @@ -48,7 +48,7 @@ require_once('../../include/inicio_relatorios_inc.php'); |
48 | 48 | </td> |
49 | 49 | </tr> |
50 | 50 | </table> |
51 | -<form action="rel_alteracoes_hardware.php" target="_blank" method="post" ENCTYPE="multipart/form-data" name="form1" onsubmit="return valida_form()"> | |
51 | +<form action="rel_alteracoes_hardware.php" target="_blank" method="post" ENCTYPE="multipart/form-data" name="forma" onsubmit="return valida_form()"> | |
52 | 52 | <table width="90%" border="0" align="center" cellpadding="5" cellspacing="1"> |
53 | 53 | <tr> |
54 | 54 | <? | ... | ... |
relatorios/antivirus/index.php
... | ... | @@ -265,6 +265,64 @@ |
265 | 265 | <td valign="top"> </td> |
266 | 266 | </tr> |
267 | 267 | <tr> |
268 | + <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" align="center"> | |
269 | + <tr> | |
270 | + <td class="label" colspan="2">Selecione os servidores de atualização | |
271 | + para consulta: (opcional)</td> | |
272 | + </tr> | |
273 | + <tr> | |
274 | + <td height="1" bgcolor="#333333" colspan="2"></td> | |
275 | + </tr> | |
276 | + <tr> | |
277 | + <td height="1"><table border="0" cellpadding="0" cellspacing="0"> | |
278 | + <tr> | |
279 | + <td><div align="left"> | |
280 | + <? /* Consulto todos os servidores já catalogados no banco. */ | |
281 | + $query = "SELECT distinct te_servidor | |
282 | + FROM officescan | |
283 | + WHERE te_servidor <> '' | |
284 | + ORDER BY te_servidor"; | |
285 | + $result = mysql_query($query) or die('Ocorreu um erro durante a consulta à tabela officescan ou sua sessão expirou!'); | |
286 | + | |
287 | + /* Agora monto os itens do combo de so's. */ | |
288 | + while($campos = mysql_fetch_array($result)) { | |
289 | + $itens_combo_servidores = $itens_combo_servidores . '<option value="' . $campos['te_servidor']. '">' . $campos['te_servidor'] . '</option>'; | |
290 | + } | |
291 | + ?> | |
292 | + | |
293 | +<select multiple id="frm_te_servidor[]" name="frm_te_servidor[]" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
294 | +<? | |
295 | +/*echo '<option value="" selected>Todos</option>';*/ | |
296 | +echo $itens_combo_servidores; ?> | |
297 | + </select></div> | |
298 | + </td> | |
299 | + <td width="40"> | |
300 | + <div align="center"> | |
301 | + <input type="button" value=" > " onClick="move(this.form.elements['frm_te_servidor[]'], this.form.elements['frm_te_serv_sel[]'])" name="B332"> | |
302 | + <br> | |
303 | + <br> | |
304 | + <input type="button" value=" < " onClick="move(this.form.elements['frm_te_serv_sel[]'], this.form.elements['frm_te_servidor[]'])" name="B432"> | |
305 | + </div> | |
306 | + </td> | |
307 | + <td> </td> | |
308 | +<td><select multiple name="frm_te_serv_sel[]" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
309 | + | |
310 | + </select></td> | |
311 | + <td> </td> | |
312 | + </tr> | |
313 | + </table></td> | |
314 | + </tr> | |
315 | + <tr> | |
316 | + <td colspan="2" class="descricao"> (Dica: | |
317 | + use SHIFT ou CTRL para selecionar múltiplos itens)</td> | |
318 | + </tr> | |
319 | + </table></td> | |
320 | + </tr> | |
321 | + <tr> | |
322 | + <td valign="top"> </td> | |
323 | + </tr> | |
324 | + | |
325 | + <tr> | |
268 | 326 | <td valign="top"> |
269 | 327 | <table width="100%" border="0" cellpadding="0" cellspacing="1" align="center"> |
270 | 328 | |
... | ... | @@ -313,7 +371,9 @@ |
313 | 371 | <input name="submit" type="submit" id="submit" onClick="ChecaTodasAsRedes(),<? echo ($_SESSION['cs_nivel_administracao']<>1 && |
314 | 372 | $_SESSION['cs_nivel_administracao']<>2?"SelectAll(this.form.elements['list2[]'])":"SelectAll(this.form.elements['list12[]'])")?>, |
315 | 373 | SelectAll(this.form.elements['list4[]']), |
316 | - SelectAll(this.form.elements['list6[]'])" value=" Gerar Relatório "> | |
374 | + SelectAll(this.form.elements['list6[]']), | |
375 | + SelectAll(this.form.elements['frm_te_servidor[]']), | |
376 | + SelectAll(this.form.elements['frm_te_serv_sel[]'])" value=" Gerar Relatório "> | |
317 | 377 | </div></td> |
318 | 378 | </tr> |
319 | 379 | <tr> | ... | ... |
relatorios/antivirus/rel_antivirus.php
... | ... | @@ -10,6 +10,28 @@ if($_POST['submit']) |
10 | 10 | $_SESSION["list12"] = $_POST['list12']; |
11 | 11 | $_SESSION["cs_situacao"] = $_POST["cs_situacao"]; |
12 | 12 | $_SESSION["cs_exibe_info_patrimonial"] = $_POST["frmCsExibeInfoPatrimonial"]; |
13 | + $_SESSION["te_servidor"] = ''; | |
14 | + if (count($_POST["frm_te_serv_sel"]) > 0) | |
15 | + { | |
16 | + for ( $i = 0; $i < count($_POST["frm_te_serv_sel"]); $i++ ) | |
17 | + if ($_POST["frm_te_serv_sel"]) | |
18 | + { | |
19 | + $_SESSION["te_servidor"] .= ($_SESSION["te_servidor"]<>''?',':''); | |
20 | + $_SESSION["te_servidor"] .= '"'.$_POST["frm_te_serv_sel"][$i].'"'; | |
21 | + } | |
22 | + $_SESSION["te_servidor"] = ($_SESSION["te_servidor"]<>''?' AND officescan.te_servidor in ('.$_SESSION["te_servidor"].')':''); | |
23 | + } | |
24 | + else | |
25 | + { | |
26 | + // se nenhum servidor foi escolhido (opcional), então utiliza todos disponiveis | |
27 | + for( $i = 0; $i < count($_POST["frm_te_servidor"]); $i++ ) | |
28 | + if ($_POST["frm_te_servidor"]) | |
29 | + { | |
30 | + $_SESSION["te_servidor"] .= ($_SESSION["te_servidor"]<>''?',':''); | |
31 | + $_SESSION["te_servidor"] .= '"'.$_POST["frm_te_servidor"][$i].'"'; | |
32 | + } | |
33 | + $_SESSION["te_servidor"] = ($_SESSION["te_servidor"]<>''?' AND officescan.te_servidor in ('.$_SESSION["te_servidor"].')':''); | |
34 | + } | |
13 | 35 | |
14 | 36 | $_SESSION['where_date'] = ''; |
15 | 37 | |
... | ... | @@ -106,8 +128,8 @@ for( $i = 1; $i < count($_SESSION["list4"] ); $i++ ) |
106 | 128 | |
107 | 129 | // Aqui pego todas as configurações de hardware que deseja exibir |
108 | 130 | for( $i = 0; $i < count($_SESSION["list6"] ); $i++ ) |
109 | - $campos_software = $campos_software . $_SESSION["list6"][$i]; | |
110 | - | |
131 | + $campos_software .= $_SESSION["list6"][$i]; | |
132 | + | |
111 | 133 | // Aqui substitui todas as strings \ por vazio que a variável $campos_hardware retorna |
112 | 134 | $campos_software = str_replace('\\', '', $campos_software); |
113 | 135 | |
... | ... | @@ -126,6 +148,7 @@ $query = 'SELECT distinct computadores.te_node_address, |
126 | 148 | FROM so, |
127 | 149 | computadores |
128 | 150 | LEFT JOIN officescan ON computadores.te_node_address = officescan.te_node_address and computadores.id_so = officescan.id_so '. |
151 | + $_SESSION["te_servidor"]. | |
129 | 152 | $from. ' |
130 | 153 | WHERE TRIM(computadores.te_nome_computador) <> "" AND |
131 | 154 | computadores.id_so = so.id_so AND |
... | ... | @@ -133,10 +156,6 @@ $query = 'SELECT distinct computadores.te_node_address, |
133 | 156 | $_SESSION['where_date']. |
134 | 157 | $query_redes .' |
135 | 158 | ORDER BY ' . $orderby; |
136 | - | |
137 | -//if ($_SERVER['REMOTE_ADDR']=='10.71.0.58') | |
138 | -// echo $query . '<br>'; | |
139 | - | |
140 | 159 | $result = mysql_query($query) or die('Erro no select ou sua sessão expirou!'); |
141 | 160 | |
142 | 161 | $cor = 0; |
... | ... | @@ -148,17 +167,20 @@ echo '<table cellpadding="2" cellspacing="0" border="1" bordercolor="#999999" bo |
148 | 167 | <td nowrap align="left"><font size="1" face="Verdana, Arial"> </font></td>'; |
149 | 168 | |
150 | 169 | $intColunaDHI = 0; // Coluna apenas para ordenar pela Data/Hora de Instalacao |
151 | - | |
170 | +$strTripaColunasValidas = '#'; | |
152 | 171 | for ($i=2; $i < mysql_num_fields($result); $i++) |
153 | 172 | {//Table Header |
154 | 173 | $iAux = $i; |
155 | 174 | $iAux = ($iAux==6?7:$iAux); |
156 | 175 | $iAux = ($iAux==8?9:$iAux); |
157 | - // Não mostro as colunas datas/horas, usadas para ordenação | |
176 | + // Não posso mostrar as colunas datas/horas usadas para ordenação | |
158 | 177 | if (mysql_field_name($result, $i)<>'DHI' && mysql_field_name($result, $i)<>'DHUC') |
178 | + { | |
159 | 179 | print '<td nowrap align="left"><b><font size="1" face="Verdana, Arial"><a href="?orderby=' . ($iAux+1) . '">'. mysql_field_name($result, $i) .'</a></font><b></td>'; |
180 | + $strTripaColunasValidas .= $i . '#'; | |
181 | + } | |
160 | 182 | } |
161 | - | |
183 | + | |
162 | 184 | // Caso seja selecionada a exibição de Informações Patrimoniais... |
163 | 185 | if ($_SESSION['cs_exibe_info_patrimonial']<>'') |
164 | 186 | { |
... | ... | @@ -260,16 +282,26 @@ while ($row = mysql_fetch_row($result)) |
260 | 282 | echo "<td nowrap align='left'><font size='1' face='Verdana, Arial'><a href='../computador/computador.php?te_node_address=". $row[0] ."&id_so=". $row[1] ."' target='_blank'>" . $row[2] ."</a> </td>"; |
261 | 283 | for ($i=3; $i < $fields; $i++) |
262 | 284 | { |
263 | - if ($i <> 7 && $i <> 9) // Não mostro os valores datas/horas, usados para ordenação | |
285 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial" '; | |
286 | + if ($row[$i] == 'N') | |
287 | + echo 'color="#FF0000"><strong>N</strong>'; | |
288 | + else | |
264 | 289 | { |
265 | - echo '<td nowrap align="left"><font size="1" face="Verdana, Arial" '; | |
266 | - if ($row[$i] == 'N') | |
267 | - echo 'color="#FF0000"><strong>N</strong>'; | |
268 | - else | |
269 | - echo '>'.$row[$i]; | |
270 | - | |
271 | - echo ' </td>'; | |
272 | - } | |
290 | + echo '>'; | |
291 | + | |
292 | + // Não posso mostrar as colunas datas/horas usadas para ordenação | |
293 | + $boolExibe = false; | |
294 | + $j = $i-1; | |
295 | + while ($j < $fields && !$boolExibe) | |
296 | + { | |
297 | + $j++; | |
298 | + $boolExibe = stripos2($strTripaColunasValidas, '#'.$j.'#',false); | |
299 | + } | |
300 | + $i = $j; | |
301 | + | |
302 | + echo $row[$i]; | |
303 | + } | |
304 | + echo ' </td>'; | |
273 | 305 | } |
274 | 306 | if ($_SESSION['cs_exibe_info_patrimonial']<>'') |
275 | 307 | { | ... | ... |
relatorios/compartilhamentos/rel_compartilhamentos.php
... | ... | @@ -137,8 +137,7 @@ $query = "SELECT DISTINCT compartilhamentos.id_so, |
137 | 137 | compartilhamentos.id_so = computadores.id_so) AND |
138 | 138 | compartilhamentos.id_so IN ($so_selecionados) AND |
139 | 139 | nm_dir_compart <> '' |
140 | - $query_redes | |
141 | - GROUP BY compartilhamentos.id_so,compartilhamentos.te_node_address | |
140 | + $query_redes | |
142 | 141 | ORDER BY computadores.te_nome_computador ASC "; |
143 | 142 | |
144 | 143 | $resultado = mysql_query($query) or die('Erro no select '. mysql_error().' ou sua sessão expirou!'); | ... | ... |
relatorios/computador/inc_hardware.php
... | ... | @@ -183,7 +183,7 @@ else |
183 | 183 | </tr> |
184 | 184 | <? |
185 | 185 | echo $linha; |
186 | - // Obtenho os nomes do hardware passível de controle | |
186 | + // Obtenho os nomes dos hardwares passíveis de controle | |
187 | 187 | $arrDescricoesColunasComputadores = getDescricoesColunasComputadores(); |
188 | 188 | |
189 | 189 | $strQueryTotalizaGeralExistentes = ' SELECT cs_tipo_componente, | ... | ... |
relatorios/computador/inc_unidades_disco.php
... | ... | @@ -54,7 +54,7 @@ else |
54 | 54 | echo '<tr><td><br> |
55 | 55 | <table border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#999999" bordercolordark="#E1E1E1"> |
56 | 56 | <tr bgcolor="'.$strPreenchimentoPadrao.'"> |
57 | - <td nowrap rowspan="2" class="opcao_tabela"><div align="center">Letra</div></td>'; | |
57 | + <td nowrap rowspan="2" class="opcao_tabela"><div align="center">Rótulo</div></td>'; | |
58 | 58 | echo '<td nowrap rowspan="2" class="opcao_tabela"><div align="center">Sist. Arq.</div></td> |
59 | 59 | <td nowrap rowspan="2" class="opcao_tabela"><div align="center">Nº Serial</div></td> |
60 | 60 | <td nowrap rowspan="2" class="opcao_tabela"><div align="center">Tam. (MB)</div></td> |
... | ... | @@ -87,7 +87,7 @@ else |
87 | 87 | $grafico = ' '; |
88 | 88 | |
89 | 89 | echo '<tr> |
90 | - <td nowrap align="center" class="opcao_tabela">'. $row['te_letra'] .':</td>'; | |
90 | + <td nowrap align="center" class="opcao_tabela">'. $row['te_letra'] .'</td>'; | |
91 | 91 | echo '<td nowrap align="center" class="opcao_tabela"> '. $row['cs_sist_arq'] .'</td> |
92 | 92 | <td nowrap align="center" class="opcao_tabela"> '. $row['nu_serial'] .'</td> |
93 | 93 | <td nowrap align="center" class="opcao_tabela"> '. $row['nu_capacidade'] .'</td> | ... | ... |
relatorios/hardware/rel_hardware.php
... | ... | @@ -103,9 +103,9 @@ else |
103 | 103 | { |
104 | 104 | $locais_selecionados .= ",'" . $_SESSION["list12"][$i] . "'"; |
105 | 105 | } |
106 | - $query_redes = ' AND a.id_ip_rede = redes.id_ip_rede '; | |
107 | - $query_redes .= ' AND redes.id_local IN ('. $locais_selecionados .')'; | |
108 | - $query_redes .= ' AND redes.id_local = locais.id_local '; | |
106 | + $query_redes = 'AND a.id_ip_rede = redes.id_ip_rede AND | |
107 | + redes.id_local IN ('. $locais_selecionados .') AND | |
108 | + redes.id_local = locais.id_local '; | |
109 | 109 | $select = ' ,sg_local as Local '; |
110 | 110 | $from = ' ,redes,locais '; |
111 | 111 | } |
... | ... | @@ -134,15 +134,14 @@ else { $orderby = '3'; } //por Nome Comp. |
134 | 134 | a.te_nome_computador as "Nome Comp.", |
135 | 135 | sg_so as "S.O.", |
136 | 136 | a.te_ip as "IP"' . |
137 | - $select . | |
138 | - ($campos_hardware?','.$campos_hardware:"") . | |
139 | - ' | |
137 | + $select .' | |
140 | 138 | FROM so LEFT JOIN computadores a ON (a.id_so = so.id_so) '. |
141 | 139 | $from . ' |
142 | 140 | WHERE TRIM(a.te_nome_computador) <> "" AND |
143 | 141 | a.id_so IN ('. $so_selecionados .') '. |
144 | 142 | $query_redes .' |
145 | 143 | ORDER BY ' . $orderby; |
144 | +// $campos_hardware . | |
146 | 145 | |
147 | 146 | $result = mysql_query($query) or die('Erro no select ou sua sessão expirou!'); |
148 | 147 | ... | ... |
relatorios/inventario_softwares/index.php
... | ... | @@ -172,7 +172,7 @@ require_once('../../include/inicio_relatorios_inc.php'); |
172 | 172 | |
173 | 173 | /* Agora monto os itens do combo de hardwares selecionadas. */ |
174 | 174 | while($campos_aplicativos_selecionados=mysql_fetch_array($result_aplicativos_selecionados)) { |
175 | - echo '<option value=' . $campos_aplicativos_selecionados['id_software_inventariado'] . '>' . capa_string($campos_aplicativos_selecionados['nm_software_inventariado'],28) . '</option>'; | |
175 | + echo '<option value=' . $campos_aplicativos_selecionados['id_software_inventariado'] . ' title="'.$campos_aplicativos_selecionados['nm_software_inventariado'].'">' . capa_string($campos_aplicativos_selecionados['nm_software_inventariado'],28) . '</option>'; | |
176 | 176 | } ?> |
177 | 177 | </select> |
178 | 178 | </div></td> | ... | ... |
relatorios/patrimonio/rel_patrimonio.php
... | ... | @@ -260,7 +260,7 @@ else |
260 | 260 | { |
261 | 261 | $from .= ' ,patrimonio, computadores '; |
262 | 262 | } |
263 | -$query = " SELECT computadores.te_node_address, | |
263 | +$query = " SELECT DISTINCT computadores.te_node_address, | |
264 | 264 | so.id_so, |
265 | 265 | computadores.te_nome_computador as 'Nome Comp.', |
266 | 266 | sg_so as 'S.O.', |
... | ... | @@ -321,7 +321,7 @@ else |
321 | 321 | { |
322 | 322 | if (trim($row[$i])<>'' && in_array($i,$arr_in_destacar_duplicidade)) |
323 | 323 | { |
324 | - array_push($v_arr_campos_valores,$i . ',' . trim($row[$i])); | |
324 | + array_push($v_arr_campos_valores,$i . ',' . trim(strtolower($row[$i]))); | |
325 | 325 | } |
326 | 326 | } |
327 | 327 | $num_registro ++; |
... | ... | @@ -341,7 +341,9 @@ else |
341 | 341 | $v_chave = $i . ',' . trim($row[$i]); |
342 | 342 | if ($v_arr_total_campos_valores[$v_chave]>1) |
343 | 343 | { |
344 | - if ($v_registro_atual <> $num_registro) $v_campos_valores_duplicados .= 'r='.$num_registro.'#'; | |
344 | + if ($v_registro_atual <> $num_registro) | |
345 | + $v_campos_valores_duplicados .= 'r='.$num_registro.'#'; | |
346 | + | |
345 | 347 | $v_registro_atual = $num_registro; |
346 | 348 | $v_campos_valores_duplicados .= '#c='.$i.'#'; |
347 | 349 | } | ... | ... |
relatorios/tcpip/rel_tcpip.php
... | ... | @@ -67,7 +67,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0 |
67 | 67 | <br> |
68 | 68 | <? |
69 | 69 | require_once('../../include/library.php'); |
70 | -// Comentado temporariamente - AntiSpy(); | |
70 | +AntiSpy(); | |
71 | 71 | conecta_bd_cacic(); |
72 | 72 | |
73 | 73 | $redes_selecionadas = ''; |
... | ... | @@ -174,6 +174,6 @@ if (count($_SESSION["list8"])>0) |
174 | 174 | gerado pelo <strong>CACIC</strong> - Configurador Automático e Coletor |
175 | 175 | de Informações Computacionais</font><br> |
176 | 176 | <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Software desenvolvido |
177 | - pela Dataprev - Escritório do Espírito Santo</font></p> | |
177 | + pela Dataprev - Unidade Regional Espírito Santo</font></p> | |
178 | 178 | </body> |
179 | 179 | </html> | ... | ... |
ws/get_config.php
... | ... | @@ -44,8 +44,7 @@ if ($_POST['padding_key']) |
44 | 44 | $strPaddingKey = $_POST['padding_key']; // A versão inicial do agente em Python exige esse complemento na chave... |
45 | 45 | } |
46 | 46 | |
47 | -//$boolPyCACIC = (trim(DeCrypt($key,$iv,$_POST['agente'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) == 'pycacic'?1:0); | |
48 | -$boolAgenteLinux = (trim(DeCrypt($key,$iv,$_POST['AgenteLinux'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) <> ''?1:0); | |
47 | +$boolAgenteLinux = (trim(DeCrypt($key,$iv,$_POST['AgenteLinux'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) <> ''?true:false); | |
49 | 48 | |
50 | 49 | // Obtenho o IP da estação por meio da decriptografia... |
51 | 50 | $v_id_ip_estacao = trim(DeCrypt($key,$iv,$_POST['id_ip_estacao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)); |
... | ... | @@ -53,7 +52,7 @@ $v_id_ip_estacao = trim(DeCrypt($key,$iv,$_POST['id_ip_estacao'],$v_cs_cipher,$v |
53 | 52 | // ...caso o IP esteja inválido, obtenho-o a partir de variável do servidor |
54 | 53 | if (substr_count($v_id_ip_estacao,'zf')>0 || trim($v_id_ip_estacao)=='') |
55 | 54 | $v_id_ip_estacao = $_SERVER['REMOTE_ADDR']; |
56 | - | |
55 | + | |
57 | 56 | $v_dados_rede = getDadosRede(); |
58 | 57 | |
59 | 58 | // Essa condição testa se foi o "chkcacic" chamado para instalação ou o "Gerente de Coletas" para validar IP da estação... |
... | ... | @@ -71,12 +70,16 @@ if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$str |
71 | 70 | { |
72 | 71 | $v_array_versoes_agentes = parse_ini_file($MainFolder . '/repositorio/versoes_agentes.ini'); |
73 | 72 | if ($boolAgenteLinux) |
74 | - $retorno_xml_values .= '<PYCACIC>' . EnCrypt($key,$iv,$v_array_versoes_agentes['PyCACIC'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/PYCACIC>'; | |
73 | + { | |
74 | + // Arghh! O PyCACIC espera pelo nome completo do pacote TGZ | |
75 | + $retorno_xml_values .= '<' . 'TE_PACOTE_PYCACIC_DISPONIVEL>' . EnCrypt($key,$iv,$v_array_versoes_agentes['te_pacote_PyCACIC'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_PACOTE_PYCACIC_DISPONIVEL>'; | |
76 | + $retorno_xml_values .= '<' . 'TE_HASH_PYCACIC>' . EnCrypt($key,$iv,$v_array_versoes_agentes['te_pacote_PyCACIC_HASH'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_HASH_PYCACIC>'; | |
77 | + } | |
75 | 78 | else |
76 | 79 | { |
77 | - $retorno_xml_values .= '<CACIC2>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2>'; | |
80 | + $retorno_xml_values .= '<CACIC2>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2>'; | |
78 | 81 | $retorno_xml_values .= '<GER_COLS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['ger_cols.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/GER_COLS>'; |
79 | - $retorno_xml_values .= '<CHKSIS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS>'; | |
82 | + $retorno_xml_values .= '<CHKSIS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe'] ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS>'; | |
80 | 83 | } |
81 | 84 | } |
82 | 85 | } |
... | ... | @@ -388,16 +391,21 @@ else |
388 | 391 | FROM redes_versoes_modulos |
389 | 392 | WHERE id_ip_rede = "'.$id_ip_rede.'" AND |
390 | 393 | id_local = '.$v_dados_rede['id_local']; |
391 | - | |
394 | + | |
395 | + //if $boolAgenteLinux && | |
392 | 396 | $result_modulos = mysql_query($query_modulos); |
393 | 397 | while ($row_modulos = mysql_fetch_array($result_modulos)) |
394 | 398 | { |
395 | - if ($boolAgenteLinux && $row['cs_tipo_so'] == 'GNU/LINUX') | |
396 | - $retorno_xml_values .= '<' . 'TE_VERSAO_PYCACIC_DISPONIVEL>' . EnCrypt($key,$iv,$row_modulos['te_versao_modulo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_VERSAO_PYCACIC_DISPONIVEL>'; | |
397 | - else | |
398 | - $retorno_xml_values .= '<' . 'DT_VERSAO_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '_DISPONIVEL>' . EnCrypt($key,$iv,$row_modulos['te_versao_modulo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/DT_VERSAO_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '_DISPONIVEL>'; | |
399 | - | |
400 | - $retorno_xml_values .= '<' . 'TE_HASH>' . EnCrypt($key,$iv,$row_modulos['te_hash'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_HASH>'; | |
399 | + if ($boolAgenteLinux && trim($row_modulos['cs_tipo_so']) == 'GNU/LINUX') | |
400 | + { | |
401 | + $retorno_xml_values .= '<' . 'TE_PACOTE_PYCACIC_DISPONIVEL>' . EnCrypt($key,$iv,$row_modulos['nm_modulo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_PACOTE_PYCACIC_DISPONIVEL>'; | |
402 | + $retorno_xml_values .= '<' . 'TE_HASH_PYCACIC>' . EnCrypt($key,$iv,$row_modulos['te_hash'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_HASH_PYCACIC>'; | |
403 | + } | |
404 | + elseif (!$boolAgenteLinux) | |
405 | + { | |
406 | + $retorno_xml_values .= '<' . 'DT_VERSAO_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '_DISPONIVEL>' . EnCrypt($key,$iv,$row_modulos['te_versao_modulo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/DT_VERSAO_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '_DISPONIVEL>'; | |
407 | + $retorno_xml_values .= '<' . 'TE_HASH_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '>' . EnCrypt($key,$iv,$row_modulos['te_hash'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/TE_HASH_' . str_replace('.EXE','',strtoupper($row_modulos['nm_modulo'])) . '>'; | |
408 | + } | |
401 | 409 | } |
402 | 410 | |
403 | 411 | if ($v_retorno_MONITORADOS <> '') | ... | ... |
ws/mapa_acesso.php
... | ... | @@ -26,11 +26,22 @@ $v_compress_level = 0; // Mantido em 0(zero) para desabilitar a Compressão/Deco |
26 | 26 | $v_cs_cipher = (trim($_POST['cs_cipher']) <> ''?trim($_POST['cs_cipher']) : '4'); |
27 | 27 | $v_cs_compress = (trim($_POST['cs_compress']) <> ''?trim($_POST['cs_compress']) : '4'); |
28 | 28 | |
29 | +$strPaddingKey = ''; | |
30 | + | |
31 | +// O agente PyCACIC envia o valor "padding_key" para preenchimento da palavra chave para decriptação/encriptação | |
32 | +if ($_POST['padding_key']) | |
33 | + { | |
34 | + // Valores específicos para trabalho com o PyCACIC - 04 de abril de 2008 - Rogério Lino - Dataprev/ES | |
35 | + $strPaddingKey = $_POST['padding_key']; // A versão inicial do agente em Python exige esse complemento na chave... | |
36 | + } | |
37 | + | |
38 | +$boolAgenteLinux = (trim(DeCrypt($key,$iv,$_POST['AgenteLinux'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) <> ''?true:false); | |
39 | + | |
29 | 40 | |
30 | 41 | // Para agilizar o processo de verificação da versão... |
31 | -$te_versao_mapa = DeCrypt($key,$iv,$_POST['te_versao_mapa'] ,$v_cs_cipher,$v_cs_compress); | |
42 | +$te_versao_mapa = DeCrypt($key,$iv,$_POST['te_versao_mapa'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
32 | 43 | |
33 | -$retorno_xml_header = '<?xml version="1.0" encoding="iso-8859-1" ?><STATUS>OK</STATUS><' .'CONFIGS>'; //(?? Deve ser coisa do Macromedia DreamWeaver... - Anderson Peterle) | |
44 | +$retorno_xml_header = '<?xml version="1.0" encoding="iso-8859-1" ?><STATUS>OK</STATUS><' .'CONFIGS>'; //(?? Deve ser coisa do Macromedia DreamWeaver... - Anderson Peterle) | |
34 | 45 | $retorno_xml_values = ''; |
35 | 46 | |
36 | 47 | $boolVersaoCorreta = true; |
... | ... | @@ -40,18 +51,17 @@ if ($te_versao_mapa <> '') |
40 | 51 | $v_array_versoes_agentes = parse_ini_file('../repositorio/install/versoes_agentes.ini'); |
41 | 52 | if ($v_array_versoes_agentes['mapacacic.exe'] <> $te_versao_mapa) |
42 | 53 | { |
43 | - $retorno_xml_values = '<TE_VERSAO_MAPA>'.EnCrypt($key,$iv,$v_array_versoes_agentes['mapacacic.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,'').'</TE_VERSAO_MAPA>'; | |
54 | + $retorno_xml_values = '<TE_VERSAO_MAPA>'.EnCrypt($key,$iv,$v_array_versoes_agentes['mapacacic.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</TE_VERSAO_MAPA>'; | |
44 | 55 | $boolVersaoCorreta = false; |
45 | 56 | } |
46 | 57 | } |
47 | - | |
58 | + | |
48 | 59 | if ($boolVersaoCorreta) |
49 | 60 | { |
50 | 61 | // Autenticação do agente MapaCacic.exe: |
51 | - autentica_agente($key,$iv,$v_cs_cipher,$v_cs_compress,''); | |
52 | - | |
62 | + autentica_agente($key,$iv,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
53 | 63 | // Essa condição testa se a chamada trouxe o valor de cs_mapa-cacic, enviado por MapaCacic.exe |
54 | - if (trim(DeCrypt($key,$iv,$_POST['cs_MapaCacic'],$v_cs_cipher,$v_cs_compress,''))=='S') | |
64 | + if (trim(DeCrypt($key,$iv,$_POST['cs_MapaCacic'],$v_cs_cipher,$v_cs_compress,$strPaddingKey))=='S') | |
55 | 65 | { |
56 | 66 | $v_dados_rede = getDadosRede(); |
57 | 67 | conecta_bd_cacic(); |
... | ... | @@ -63,15 +73,15 @@ if ($boolVersaoCorreta) |
63 | 73 | locais c |
64 | 74 | WHERE a.id_grupo_usuarios = b.id_grupo_usuarios AND |
65 | 75 | b.id_grupo_usuarios = 7 AND |
66 | - a.nm_usuario_acesso = '". trim(DeCrypt($key,$iv,$_POST['nm_acesso'],$v_cs_cipher,$v_cs_compress,'')) ."' AND | |
76 | + a.nm_usuario_acesso = '". trim(DeCrypt($key,$iv,$_POST['nm_acesso'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) ."' AND | |
67 | 77 | a.id_local = c.id_local AND |
68 | 78 | a.te_senha = "; |
69 | 79 | //SHA1('". trim(DeCrypt($key,$iv,$_POST['te_senha'],$v_cs_cipher,$v_cs_compress)) ."')"; |
70 | 80 | |
71 | 81 | // Solução temporária, até total convergência para versões 4.0.2 ou maior de MySQL |
72 | 82 | // Anderson Peterle - Dataprev/ES - 04/09/2006 |
73 | - $v_AUTH_SHA1 = " SHA1('". trim(DeCrypt($key,$iv,$_POST['te_senha'],$v_cs_cipher,$v_cs_compress,'')) ."')"; | |
74 | - $v_AUTH_PASSWORD = " PASSWORD('". trim(DeCrypt($key,$iv,$_POST['te_senha'],$v_cs_cipher,$v_cs_compress,'')) ."')"; | |
83 | + $v_AUTH_SHA1 = " SHA1('". trim(DeCrypt($key,$iv,$_POST['te_senha'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) ."')"; | |
84 | + $v_AUTH_PASSWORD = " PASSWORD('". trim(DeCrypt($key,$iv,$_POST['te_senha'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) ."')"; | |
75 | 85 | |
76 | 86 | // Para MySQL 4.0.2 ou maior |
77 | 87 | // Anderson Peterle - Dataprev/ES - 04/09/2006 |
... | ... | @@ -89,8 +99,8 @@ if ($boolVersaoCorreta) |
89 | 99 | if (mysql_num_rows($result_qry_usuario)>0) |
90 | 100 | { |
91 | 101 | $row = mysql_fetch_array($result_qry_usuario); |
92 | - $retorno_xml_values .= '<ID_USUARIO>'.EnCrypt($key,$iv,$row['id_usuario'],$v_cs_cipher,$v_cs_compress,$v_compress_level,'').'</ID_USUARIO>'; | |
93 | - $retorno_xml_values .= '<NM_USUARIO_COMPLETO>'.EnCrypt($key,$iv,$row['nm_usuario_completo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,'').'</NM_USUARIO_COMPLETO>'; | |
102 | + $retorno_xml_values .= '<ID_USUARIO>'.EnCrypt($key,$iv,$row['id_usuario'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</ID_USUARIO>'; | |
103 | + $retorno_xml_values .= '<NM_USUARIO_COMPLETO>'.EnCrypt($key,$iv,$row['nm_usuario_completo'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</NM_USUARIO_COMPLETO>'; | |
94 | 104 | $_SESSION['id_usuario'] = $row['id_usuario']; |
95 | 105 | GravaLog('ACE',$_SERVER['SCRIPT_NAME'],'acesso'); |
96 | 106 | } | ... | ... |