Commit 6a7f67c3eb69be2778c77274815c6c4f8e9dfbbb
1 parent
5de72606
Exists in
master
and in
1 other branch
alterações do Anderson PeteRle no gerente
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@438 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
11 changed files
with
548 additions
and
257 deletions
Show diff stats
admin/redes/detalhes_rede.php
| ... | ... | @@ -14,14 +14,6 @@ |
| 14 | 14 | Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | 15 | */ |
| 16 | 16 | session_start(); |
| 17 | -/* | |
| 18 | - * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 19 | - */ | |
| 20 | -if(!isset($_SESSION['id_usuario'])) | |
| 21 | - die('Acesso negado!'); | |
| 22 | -else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 23 | -} | |
| 24 | - | |
| 25 | 17 | require_once('../../include/library.php'); |
| 26 | 18 | |
| 27 | 19 | AntiSpy(); |
| ... | ... | @@ -289,8 +281,8 @@ function valida_form() |
| 289 | 281 | $pos = substr_count($_SERVER['HTTP_REFERER'],'navegacao'); |
| 290 | 282 | ?> |
| 291 | 283 | <body <? if (!$pos) echo 'background="../../imgs/linha_v.gif"';?> onLoad="SetaCampo('<? echo ($_SESSION['cs_nivel_administracao']<>1?'frm_te_mascara_rede':'frm_id_local')?>')"> |
| 292 | -<script language="JavaScript" type="text/javascript" src="../../include/cacic.js"></script> | |
| 293 | -<form action="detalhes_rede.php" method="post" ENCTYPE="multipart/form-data" name="form" onSubmit="return valida_form()"> | |
| 284 | +<script language="javascript" type="text/javascript" src="../../include/cacic.js"></script> | |
| 285 | +<form action="detalhes_rede.php" method="post" ENCTYPE="multipart/form-data" name="form" id="form" onSubmit="return valida_form()"> | |
| 294 | 286 | <table width="90%" border="0" align="center"> |
| 295 | 287 | <tr> |
| 296 | 288 | <td class="cabecalho">Detalhes da Subrede <? echo mysql_result($result, 0, 'id_ip_rede'); ?></td> |
| ... | ... | @@ -366,7 +358,8 @@ $pos = substr_count($_SERVER['HTTP_REFERER'],'navegacao'); |
| 366 | 358 | Subrede:</td> |
| 367 | 359 | <td class="label"><br> |
| 368 | 360 | Máscara:</td> |
| 369 | - <td class="label"> </td> | |
| 361 | + <td class="label"><br> | |
| 362 | + Abrangência:</td> | |
| 370 | 363 | </tr> |
| 371 | 364 | <tr> |
| 372 | 365 | <td colspan="4" height="1" bgcolor="#333333"></td> |
| ... | ... | @@ -375,8 +368,11 @@ $pos = substr_count($_SERVER['HTTP_REFERER'],'navegacao'); |
| 375 | 368 | <td> </td> |
| 376 | 369 | <td> <input name="frm_id_ip_rede" id="frm_id_ip_rede" readonly="" type="text" value="<? echo mysql_result($result, 0, 'id_ip_rede'); ?>" size="16" maxlength="16" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > |
| 377 | 370 | <input name="id_ip_rede" type="hidden" id="id_ip_rede" value="<? echo mysql_result($result, 0, 'id_ip_rede'); ?>" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > </td> |
| 378 | - <td> <input name="frm_te_mascara_rede" type="text" id="frm_te_mascara_rede" value="<? echo mysql_result($result, 0, 'te_mascara_rede'); ?>" size="15" maxlength="15" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="return VerificaRedeMascara(this.form);SetaClassNormal(this);" > </td> | |
| 379 | - <td> </td> | |
| 371 | + <td> <input name="frm_te_mascara_rede" type="text" id="frm_te_mascara_rede" value="<? echo mysql_result($result, 0, 'te_mascara_rede'); ?>" size="15" maxlength="15" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="return VerRedeMascara(this.form.name,false,true);SetaClassNormal(this);" > </td> | |
| 372 | + <td nowrap="nowrap"><input name="frm_id_ip_inicio" id="frm_id_ip_inicio" disabled="disabled" type="text" class="normal"> | |
| 373 | + a | |
| 374 | + <input name="frm_id_ip_fim" id="frm_id_ip_fim" disabled="disabled" type="text" class="normal"> | |
| 375 | + </td> | |
| 380 | 376 | </tr> |
| 381 | 377 | <tr> |
| 382 | 378 | <td> </td> |
| ... | ... | @@ -390,7 +386,8 @@ $pos = substr_count($_SERVER['HTTP_REFERER'],'navegacao'); |
| 390 | 386 | </tr> |
| 391 | 387 | <tr> |
| 392 | 388 | <td nowrap> </td> |
| 393 | - <td nowrap><input name="frm_nm_rede" type="text" id="frm_nm_rede" value="<? echo mysql_result($result, 0, 'nm_rede'); ?>" size="50" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" ></td> | |
| 389 | + <td nowrap><input name="frm_nm_rede" type="text" id="frm_nm_rede" value="<? echo mysql_result($result, 0, 'nm_rede'); ?>" size="50" maxlength="100" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
| 390 | + </td> | |
| 394 | 391 | <td> </td> |
| 395 | 392 | <td> </td> |
| 396 | 393 | </tr> |
| ... | ... | @@ -865,6 +862,10 @@ $pos = substr_count($_SERVER['HTTP_REFERER'],'navegacao'); |
| 865 | 862 | </p> |
| 866 | 863 | </table> |
| 867 | 864 | </table> |
| 865 | +<script language="javascript" type="text/javascript"> | |
| 866 | +VerRedeMascara('form',true,false); | |
| 867 | +</script> | |
| 868 | + | |
| 868 | 869 | </form> |
| 869 | 870 | </body> |
| 870 | 871 | </html> | ... | ... |
admin/redes/incluir_rede.php
| ... | ... | @@ -14,14 +14,6 @@ |
| 14 | 14 | Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | 15 | */ |
| 16 | 16 | session_start(); |
| 17 | -/* | |
| 18 | - * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 19 | - */ | |
| 20 | -if(!isset($_SESSION['id_usuario'])) | |
| 21 | - die('Acesso negado!'); | |
| 22 | -else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 23 | -} | |
| 24 | - | |
| 25 | 17 | include_once "../../include/library.php"; |
| 26 | 18 | |
| 27 | 19 | AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| ... | ... | @@ -208,7 +200,7 @@ function SetaServidorUpdates() |
| 208 | 200 | |
| 209 | 201 | function valida_form(frmForm) |
| 210 | 202 | { |
| 211 | - | |
| 203 | + VerRedeMascara(frmForm.name,true,false); | |
| 212 | 204 | if ( document.form.frm_nu_limite_ftp.value == "" ) |
| 213 | 205 | { |
| 214 | 206 | document.form.frm_nu_limite_ftp.value = "30"; |
| ... | ... | @@ -290,10 +282,7 @@ function valida_form(frmForm) |
| 290 | 282 | alert("Digite a Senha para Login no Servidor de Updates pelo Módulo Gerente"); |
| 291 | 283 | document.form.frm_te_senha_login_serv_updates_gerente.focus(); |
| 292 | 284 | return false; |
| 293 | - } | |
| 294 | - | |
| 295 | - VerificaRedeMascara(frmForm); | |
| 296 | - | |
| 285 | + } | |
| 297 | 286 | return true; |
| 298 | 287 | } |
| 299 | 288 | </script> |
| ... | ... | @@ -322,7 +311,7 @@ MM_reloadPage(true); |
| 322 | 311 | são obrigatórios.</td> |
| 323 | 312 | </tr> |
| 324 | 313 | </table> |
| 325 | -<form action="incluir_rede.php" method="post" ENCTYPE="multipart/form-data" name="form"> | |
| 314 | +<form action="incluir_rede.php" method="post" ENCTYPE="multipart/form-data" name="form" id="form"> | |
| 326 | 315 | <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1"> |
| 327 | 316 | <tr> |
| 328 | 317 | <td> </td> |
| ... | ... | @@ -382,7 +371,7 @@ MM_reloadPage(true); |
| 382 | 371 | <td> </td> |
| 383 | 372 | <td><input name="frm_id_ip_rede" id="frm_id_ip_rede" type="text" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" size="16" maxlength="16" > |
| 384 | 373 | <font color="#000099" size="1">Ex.: 10.71.0.0</font></font></td> |
| 385 | - <td><input name="frm_te_mascara_rede" id="frm_te_mascara_rede" type="text" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="return VerificaRedeMascara(this.form);SetaClassNormal(this);" value="255.255.255.0" size="15" maxlength="15" > | |
| 374 | + <td><input name="frm_te_mascara_rede" id="frm_te_mascara_rede" type="text" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="return VerRedeMascara(this.form.name,false,true);SetaClassNormal(this);" value="255.255.255.0" size="15" maxlength="15" > | |
| 386 | 375 | </td> |
| 387 | 376 | <td> </td> |
| 388 | 377 | </tr> |
| ... | ... | @@ -644,8 +633,8 @@ MM_reloadPage(true); |
| 644 | 633 | </tr> |
| 645 | 634 | <tr> |
| 646 | 635 | <td> </td> |
| 647 | - <td> <input name="in_habilita_acoes" type="radio" value="S" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
| 648 | - Sim<br> <input type="radio" name="in_habilita_acoes" value="N" checked class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
| 636 | + <td> <input name="in_habilita_acoes" type="radio" value="S" checked class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
| 637 | + Sim<br> <input type="radio" name="in_habilita_acoes" value="N" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > | |
| 649 | 638 | Não</td> |
| 650 | 639 | <td> </td> |
| 651 | 640 | <td> </td> | ... | ... |
admin/updates_subredes/index.php
| ... | ... | @@ -14,14 +14,6 @@ |
| 14 | 14 | Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | 15 | */ |
| 16 | 16 | session_start(); |
| 17 | -/* | |
| 18 | - * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 19 | - */ | |
| 20 | -if(!isset($_SESSION['id_usuario'])) | |
| 21 | - die('Acesso negado!'); | |
| 22 | -else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 23 | -} | |
| 24 | - | |
| 25 | 17 | require_once('../../include/library.php'); |
| 26 | 18 | |
| 27 | 19 | AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| ... | ... | @@ -33,7 +25,9 @@ if ($_POST['ExecutaUpdates']=='Executar Updates') |
| 33 | 25 | { |
| 34 | 26 | // Enviarei também ao updates_subredes.php uma relação de agentes e versões para inserção na tabela redes_versoes_modulos, no caso da ocorrência de Servidor de Updates verificado anteriormente. |
| 35 | 27 | // Exemplo de estrutura de agentes_versoes: col_soft.exe#22010103*col_undi.exe#22010103 |
| 28 | + // agentes_hashs: col_soft.exe#4228204d66e268ad42d9d738a09800e8*col_undi.exe#2428204d67e268ad42d9d738a09800ff | |
| 36 | 29 | $v_agentes_versoes = ''; |
| 30 | + $v_agentes_hashs = ''; | |
| 37 | 31 | foreach($HTTP_POST_VARS as $i => $v) |
| 38 | 32 | { |
| 39 | 33 | //echo 'v: '.$v.' i: '.$i.'<br>'; |
| ... | ... | @@ -61,16 +55,16 @@ if ($_POST['ExecutaUpdates']=='Executar Updates') |
| 61 | 55 | if ($v_force_modulos == '') $v_force_modulos = '_fm_versoes_agentes.ini_fm_'; |
| 62 | 56 | |
| 63 | 57 | if ($v_force_modulos <> '') |
| 64 | - { | |
| 65 | 58 | $v_force_modulos .= ","; |
| 66 | - } | |
| 59 | + | |
| 67 | 60 | $v_force_modulos .= '_fm_'.$v.'_fm_'; |
| 68 | 61 | } |
| 69 | 62 | |
| 70 | 63 | if ($v && substr($i,0,15)=='agentes_versoes') |
| 71 | - { | |
| 72 | 64 | $v_agentes_versoes = '_-_'.$v; |
| 73 | - } | |
| 65 | + | |
| 66 | + if ($v && substr($i,0,13)=='agentes_hashs') | |
| 67 | + $v_agentes_hashs = '_-_'.$v; | |
| 74 | 68 | } |
| 75 | 69 | |
| 76 | 70 | //echo 'v_updates: '.$v_updates.'<br><br>'; |
| ... | ... | @@ -83,7 +77,7 @@ if ($_POST['ExecutaUpdates']=='Executar Updates') |
| 83 | 77 | // objeto1__objeto2__objetoN_-_rede1__rede2__rede3__redeN |
| 84 | 78 | // Onde: __ = Separador de itens |
| 85 | 79 | // _-_ = Separador de Matrizes |
| 86 | - header ("Location: updates_subredes.php?v_parametros=".$v_updates.'_-_'.$v_redes.'_-_'.$v_force_modulos.$v_agentes_versoes); | |
| 80 | + header ("Location: updates_subredes.php?v_parametros=".$v_updates.'_-_'.$v_redes.'_-_'.$v_force_modulos.$v_agentes_versoes.$v_agentes_hashs); | |
| 87 | 81 | } |
| 88 | 82 | else |
| 89 | 83 | { |
| ... | ... | @@ -134,14 +128,11 @@ function verificar() |
| 134 | 128 | else |
| 135 | 129 | { |
| 136 | 130 | if (!boolModulos) |
| 137 | - { | |
| 138 | 131 | strFraseErro = 'Módulos'; |
| 139 | - } | |
| 140 | 132 | |
| 141 | 133 | if (!boolRedes) |
| 142 | - { | |
| 143 | 134 | strFraseErro = (!boolModulos?' e ':'') + 'SubRedes'; |
| 144 | - } | |
| 135 | + | |
| 145 | 136 | alert('ATENÇÃO: Verifique as seleções de '+strFraseErro); |
| 146 | 137 | // formRedes.elements[min(intInicioModulos,intInicioRedes)].focus(); |
| 147 | 138 | } |
| ... | ... | @@ -213,8 +204,10 @@ function verificar() |
| 213 | 204 | </tr> |
| 214 | 205 | <tr> |
| 215 | 206 | <td class="destaque" align="center" colspan="3" valign="middle"><input name="update_subredes" id="update_subredes" type="checkbox" onClick="MarcaDesmarcaTodos(this.form.update_subredes),MarcaIncondicional(this.form.update_subredes,'update_subredes_versoes_agentes.ini'),MarcaIncondicional(this.form.update_subredes,'force_update_subredes_versoes_agentes.ini');"> |
| 216 | - Marca/Desmarca todos os objetos | |
| 217 | - </td> | |
| 207 | + Marca/Desmarca todos os objetos </td> | |
| 208 | + </tr> | |
| 209 | + <tr> | |
| 210 | + <td nowrap colspan="2"> </td> | |
| 218 | 211 | </tr> |
| 219 | 212 | <tr> |
| 220 | 213 | <td nowrap colspan="2"> </td> |
| ... | ... | @@ -222,13 +215,19 @@ function verificar() |
| 222 | 215 | <tr> |
| 223 | 216 | <td nowrap colspan="2"><table border="1" align="center" cellpadding="2" bordercolor="#999999"> |
| 224 | 217 | <tr bgcolor="#FFFFCC"> |
| 218 | + <td colspan="8" class="cabecalho_tabela" align="center"><b>Agentes para MS-Windows</b></td> | |
| 219 | + </tr> | |
| 220 | + | |
| 221 | + <tr bgcolor="#FFFFCC"> | |
| 225 | 222 | <td bgcolor="#EBEBEB" align="center"><img src="../../imgs/checked.gif" border="no"></td> |
| 226 | 223 | <td bgcolor="#EBEBEB" class="cabecalho_tabela">Arquivo</td> |
| 227 | 224 | <td bgcolor="#EBEBEB" class="cabecalho_tabela">Tamanho(KB)</td> |
| 228 | 225 | <td align="center" colspan="3" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Versão</td> |
| 226 | + <td align="center" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Hash</td> | |
| 229 | 227 | <td align="center" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Forçar</td> |
| 230 | 228 | </tr> |
| 231 | 229 | <? |
| 230 | + | |
| 232 | 231 | if ($handle = opendir('../../repositorio')) |
| 233 | 232 | { |
| 234 | 233 | $v_nomes_arquivos = array(); |
| ... | ... | @@ -237,9 +236,10 @@ function verificar() |
| 237 | 236 | { |
| 238 | 237 | $v_arquivo = strtolower($v_arquivo); |
| 239 | 238 | if (substr($v_arquivo,0,1) != "." and |
| 240 | - $v_arquivo != "netlogon" and | |
| 239 | + $v_arquivo != "agentes_linux" and | |
| 240 | + $v_arquivo != "netlogon" and | |
| 241 | 241 | $v_arquivo != "supergerentes" and |
| 242 | - $v_arquivo != "install" and | |
| 242 | + $v_arquivo != "install" and | |
| 243 | 243 | $v_arquivo != "chkcacic.exe" and |
| 244 | 244 | $v_arquivo != "chkcacic.ini" and |
| 245 | 245 | $v_arquivo != "vaca.exe") // Versoes Agentes Creator/Atualizator //and |
| ... | ... | @@ -256,14 +256,18 @@ function verificar() |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | sort($v_nomes_arquivos,SORT_STRING); |
| 259 | - $v_agentes_versoes = ''; // Conterá as versões dos agentes para tratamento em updates_subredes.php | |
| 259 | + $v_agentes_versoes = ''; // Conterá as versões dos agentes para tratamento em updates_subredes.php | |
| 260 | + $v_agentes_hashs = ''; // Conterá os hashies referentes aos agentes | |
| 260 | 261 | for ($cnt_arquivos = 0; $cnt_arquivos < count($v_nomes_arquivos); $cnt_arquivos++) |
| 261 | 262 | { |
| 263 | + $te_hash = hash_file('md5','../../repositorio/'.$v_nomes_arquivos[$cnt_arquivos]); | |
| 262 | 264 | $v_dados_arquivo = lstat('../../repositorio/'.$v_nomes_arquivos[$cnt_arquivos]); |
| 265 | + | |
| 263 | 266 | echo '<tr>'; |
| 264 | 267 | echo '<td><input name="update_subredes_'.$v_nomes_arquivos[$cnt_arquivos].'" id="update_subredes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="'.$v_nomes_arquivos[$cnt_arquivos].'"'; |
| 265 | 268 | if ($v_nomes_arquivos[$cnt_arquivos] == 'versoes_agentes.ini') echo ' checked disabled'; // Implementar o OnChange para impedir o Marca/Desmarca todos para este campo... |
| 266 | - echo ' ></td>'; | |
| 269 | + echo ' >'; | |
| 270 | + echo '</td>'; | |
| 267 | 271 | echo '<td>'.$v_nomes_arquivos[$cnt_arquivos].'</td>'; |
| 268 | 272 | // echo '<td align="right">'.number_format(($v_dados_arquivo[7]/1024), 1, '', '.').'</td>'; |
| 269 | 273 | // Adequação ao resultado no Debian Etch |
| ... | ... | @@ -277,18 +281,76 @@ function verificar() |
| 277 | 281 | $versao_agente = strftime("%d/%m/%Y %H:%Mh", $v_dados_arquivo[9]); |
| 278 | 282 | echo '<td align="center" colspan="3">'.$versao_agente.'</td>'; |
| 279 | 283 | } |
| 280 | - $v_agentes_versoes .= ($v_agentes_versoes<>''?'#':''); | |
| 281 | - $v_agentes_versoes .= $v_nomes_arquivos[$cnt_arquivos].'*'.$versao_agente; | |
| 284 | + | |
| 285 | + $v_agentes_versoes .= ($v_agentes_versoes<>''?'#':''); | |
| 286 | + $v_agentes_versoes .= $v_nomes_arquivos[$cnt_arquivos].'*'.$versao_agente; | |
| 287 | + | |
| 288 | + $v_agentes_hashs .= ($v_agentes_hashs <>''?'#':''); | |
| 289 | + $v_agentes_hashs .= $v_nomes_arquivos[$cnt_arquivos].'*'.$te_hash; | |
| 290 | + | |
| 291 | + echo '<td align="center">'.$te_hash.'</td>'; | |
| 292 | + | |
| 282 | 293 | echo '<td align="center"><input name="force_update_subredes_'.$v_nomes_arquivos[$cnt_arquivos].'" id="force_update_subredes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="'.$v_nomes_arquivos[$cnt_arquivos].'"'; |
| 283 | 294 | if ($v_nomes_arquivos[$cnt_arquivos] == 'versoes_agentes.ini') echo ' checked disabled'; |
| 284 | - echo '></td></tr>'; | |
| 295 | + echo '>'; | |
| 296 | + echo '</td></tr>'; | |
| 297 | + } | |
| 298 | + } | |
| 299 | + | |
| 300 | + if ($handle = opendir('../../repositorio/agentes_linux')) | |
| 301 | + { | |
| 302 | + ?> | |
| 303 | + <tr><td colspan="8"> </td></tr> | |
| 304 | + <tr bgcolor="#FFFFCC"> | |
| 305 | + <td colspan="8" class="cabecalho_tabela" align="center"><b>Agentes para GNU/Linux</b></td> | |
| 306 | + </tr> | |
| 307 | + <tr bgcolor="#FFFFCC"> | |
| 308 | + <td bgcolor="#EBEBEB" align="center"><img src="../../imgs/checked.gif" border="no"></td> | |
| 309 | + <td bgcolor="#EBEBEB" class="cabecalho_tabela">Arquivo</td> | |
| 310 | + <td bgcolor="#EBEBEB" class="cabecalho_tabela">Tamanho(KB)</td> | |
| 311 | + <td align="center" colspan="3" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Versão</td> | |
| 312 | + <td align="center" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Hash</td> | |
| 313 | + <td align="center" nowrap bgcolor="#EBEBEB" class="cabecalho_tabela">Forçar</td> | |
| 314 | + </tr> | |
| 315 | + <? | |
| 316 | + $v_nomes_arquivos = array(); | |
| 317 | + | |
| 318 | + while (false !== ($v_arquivo = readdir($handle))) | |
| 319 | + if (substr($v_arquivo,0,1) != ".") | |
| 320 | + array_push($v_nomes_arquivos, $v_arquivo); // Armazeno o nome do arquivo | |
| 321 | + | |
| 322 | + for ($cnt_arquivos = 0; $cnt_arquivos < count($v_nomes_arquivos); $cnt_arquivos++) | |
| 323 | + { | |
| 324 | + $te_hash = hash_file('md5','../../repositorio/agentes_linux/'.$v_nomes_arquivos[$cnt_arquivos]); | |
| 325 | + $v_dados_arquivo = lstat('../../repositorio/'.$v_nomes_arquivos[$cnt_arquivos]); | |
| 326 | + | |
| 327 | + $arrNomeArquivo = explode('.tgz',$v_nomes_arquivos[$cnt_arquivos]); | |
| 328 | + $arrNomeArquivo = explode('_',$arrNomeArquivo[0]); | |
| 329 | + | |
| 330 | + echo '<tr>'; | |
| 331 | + echo '<td><input name="update_subredes_'.$v_nomes_arquivos[$cnt_arquivos].'" id="update_subredes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="'.$v_nomes_arquivos[$cnt_arquivos].'"></td>'; | |
| 332 | + echo '<td>'.$arrNomeArquivo[0].'</td>'; | |
| 333 | +// echo '<td align="right">'.number_format(($v_dados_arquivo[7]/1024), 1, '', '.').'</td>'; | |
| 334 | + // Adequação ao resultado no Debian Etch | |
| 335 | + echo '<td align="right">'.number_format(($v_dados_arquivo[7]/10240), 1, '', '.').'</td>'; | |
| 336 | + | |
| 337 | + echo '<td align="center" colspan="3">'.$arrNomeArquivo[1].'</td>'; | |
| 338 | + echo '<td align="center">'.$te_hash.'</td>'; | |
| 339 | + | |
| 340 | + echo '<td align="center"><input name="force_update_subredes_'.$v_nomes_arquivos[$cnt_arquivos].'" id="force_update_subredes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="'.$v_nomes_arquivos[$cnt_arquivos].'"></td></tr>'; | |
| 341 | + $v_agentes_versoes .= ($v_agentes_versoes<>''?'#':''); | |
| 342 | + $v_agentes_versoes .= $v_nomes_arquivos[$cnt_arquivos].'*'.$arrNomeArquivo[1]; | |
| 343 | + | |
| 344 | + $v_agentes_hashs .= ($v_agentes_hashs<>''?'#':''); | |
| 345 | + $v_agentes_hashs .= $v_nomes_arquivos[$cnt_arquivos].'*'.$te_hash; | |
| 285 | 346 | } |
| 286 | - echo '<input name="agentes_versoes" id="agentes_versoes" type="hidden" value="'.$v_agentes_versoes.'">'; | |
| 287 | 347 | |
| 288 | 348 | } |
| 289 | - ?> | |
| 349 | + echo '<input name="agentes_versoes" id="agentes_versoes" type="hidden" value="'.$v_agentes_versoes.'">'; | |
| 350 | + echo '<input name="agentes_hashs" id="agentes_hashs" type="hidden" value="'.$v_agentes_hashs.'">'; | |
| 351 | + ?> | |
| 352 | + | |
| 290 | 353 | </table></td> |
| 291 | - | |
| 292 | 354 | </tr> |
| 293 | 355 | </table> |
| 294 | 356 | <br> | ... | ... |
admin/updates_subredes/updates_subredes.php
| ... | ... | @@ -15,13 +15,6 @@ |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | session_start(); |
| 18 | -/* | |
| 19 | - * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 20 | - */ | |
| 21 | -if(!isset($_SESSION['id_usuario'])) | |
| 22 | - die('Acesso negado!'); | |
| 23 | -else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 24 | -} | |
| 25 | 18 | |
| 26 | 19 | require_once('../../include/library.php'); |
| 27 | 20 | |
| ... | ... | @@ -85,8 +78,8 @@ AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| 85 | 78 | $v_array_redes = explode('__',str_replace('_fr_',"'",$v_array_parametros[1])); |
| 86 | 79 | |
| 87 | 80 | |
| 88 | - //echo '_REQUEST[v_parametros] = '.$_REQUEST['v_parametros'].'<br>'; | |
| 89 | - //echo 'v_array_parametros[1] = '.$v_array_parametros[1].'<br>'; | |
| 81 | + echo '_REQUEST[v_parametros] = '.$_REQUEST['v_parametros'].'<br>'; | |
| 82 | + echo 'v_array_parametros[1] = '.$v_array_parametros[1].'<br>'; | |
| 90 | 83 | |
| 91 | 84 | if (count($v_array_redes)>0) |
| 92 | 85 | { | ... | ... |
include/cacic.js
| ... | ... | @@ -25,7 +25,7 @@ function preparaEnvio() |
| 25 | 25 | // Codificação dos campos NOME e SENHA para submissão pelo método POST |
| 26 | 26 | window.document.forms[i].elements[j].value = encode64(window.document.forms[i].elements[j].value); |
| 27 | 27 | } |
| 28 | - | |
| 28 | + | |
| 29 | 29 | function SetaCampo(p_campo) |
| 30 | 30 | { |
| 31 | 31 | for (i=0;i<window.document.forms.length;i++) |
| ... | ... | @@ -116,9 +116,10 @@ function Trim(Dado) |
| 116 | 116 | } |
| 117 | 117 | return Result; |
| 118 | 118 | } |
| 119 | - | |
| 120 | -function VerificaRedeMascara(frmForm) | |
| 119 | +function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma) | |
| 121 | 120 | { |
| 121 | + alert('1'); | |
| 122 | + var frmForm = document.getElementById(strFormName); | |
| 122 | 123 | var arrIdIpRede = (frmForm.frm_id_ip_rede.value).split('.'); |
| 123 | 124 | var arrTeMascaraRede = (frmForm.frm_te_mascara_rede.value).split('.'); |
| 124 | 125 | |
| ... | ... | @@ -153,15 +154,35 @@ function VerificaRedeMascara(frmForm) |
| 153 | 154 | var strOctetoMascara3 = arrIdIpRede[2] | (arrTeMascaraRede[2] ^ 255); |
| 154 | 155 | var strOctetoMascara4 = (arrIdIpRede[3] | (arrTeMascaraRede[3] ^ 255))-1; |
| 155 | 156 | |
| 156 | - if (Confirma('ATENÇÃO:\n\nCom esta máscara, esta subrede atenderá à faixa "'+strOctetoRede1+'.'+strOctetoRede2+'.'+strOctetoRede3+'.'+strOctetoRede4+'" a "'+strOctetoMascara1+'.'+strOctetoMascara2+'.'+strOctetoMascara3+'.'+strOctetoMascara4+'"\n\n\nConfirma?')) | |
| 157 | + var strIPInicio = strOctetoRede1 + '.' + strOctetoRede2 + '.' + strOctetoRede3 + '.' + strOctetoRede4; | |
| 158 | + var strIPFim = strOctetoMascara1 + '.' + strOctetoMascara2 + '.' + strOctetoMascara3 + '.' + strOctetoMascara4; | |
| 159 | + | |
| 160 | + if (boolPreencheIPs) | |
| 161 | + PreencheIPs(strFormName,strIPInicio,strIPFim); | |
| 162 | + | |
| 163 | + if (boolConfirma && Confirma('ATENÇÃO:\n\nCom esta máscara, esta subrede atenderá à faixa "'+ strIPInicio+'" a "'+strIPFim+'"\n\n\nConfirma?')) | |
| 164 | + { | |
| 165 | + PreencheIPs(strFormName,strIPInicio,strIPFim); | |
| 157 | 166 | return true; |
| 167 | + } | |
| 158 | 168 | else |
| 159 | 169 | { |
| 160 | - frmForm.frm_te_mascara_rede.select(); | |
| 161 | - frmForm.frm_te_mascara_rede.focus(); | |
| 170 | + if (!boolPreencheIPs) | |
| 171 | + { | |
| 172 | + frmForm.frm_te_mascara_rede.select(); | |
| 173 | + frmForm.frm_te_mascara_rede.focus(); | |
| 174 | + } | |
| 162 | 175 | return false; |
| 163 | 176 | } |
| 164 | 177 | } |
| 178 | + | |
| 179 | +function PreencheIPs(strFormName,strIPInicio,strIPFim) | |
| 180 | + { | |
| 181 | + alert('Recebí "'+strFormName+'"'); | |
| 182 | + var frmForm = document.getElementById(strFormName); | |
| 183 | + frmForm.frm_id_ip_inicio.value = strIPInicio; | |
| 184 | + frmForm.frm_id_ip_fim.value = strIPFim; | |
| 185 | + } | |
| 165 | 186 | |
| 166 | 187 | function TestaIP(IP1, IP2, IP3, IP4) |
| 167 | 188 | { |
| ... | ... | @@ -241,4 +262,5 @@ function TestaMascara(IP1, IP2, IP3, IP4) |
| 241 | 262 | return 8; |
| 242 | 263 | } |
| 243 | 264 | return 0; |
| 244 | - } | |
| 245 | 265 | \ No newline at end of file |
| 266 | + } | |
| 267 | + | ... | ... |
include/library.php
| ... | ... | @@ -13,22 +13,8 @@ |
| 13 | 13 | Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software |
| 14 | 14 | Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | 15 | */ |
| 16 | -@session_start(); | |
| 17 | -@define('CACIC',1); | |
| 18 | - | |
| 19 | -@include_once('config.php'); | |
| 20 | -require_once('define.php'); | |
| 21 | - | |
| 22 | -if(!include_once( TRANSLATOR_PATH.'/Translator.php')) | |
| 23 | - die ("<h1>There is a trouble with phpTranslator package. It isn't found.</h1>"); | |
| 24 | - | |
| 25 | -/* | |
| 26 | - * componente (objeto) para realizar traducao | |
| 27 | - */ | |
| 28 | -$oTranslator = new Translator( CACIC_LANGUAGE, CACIC_PATH.CACIC_LANGUAGE_PATH, CACIC_LANGUAGE_STANDARD ); | |
| 29 | -$oTranslator->setURLPath(TRANSLATOR_PATH_URL); | |
| 30 | -$oTranslator->setLangFilesInSubDirs(true); | |
| 31 | -$oTranslator->initStdLanguages(); | |
| 16 | +session_start(); | |
| 17 | +require_once 'config.php'; | |
| 32 | 18 | //Debug($_SERVER['SCRIPT_FILENAME']); |
| 33 | 19 | |
| 34 | 20 | // -------------------------------------------------------------------------- |
| ... | ... | @@ -178,8 +164,8 @@ function returnMacAddress1() |
| 178 | 164 | |
| 179 | 165 | $remoteIp = rtrim($_SERVER['REMOTE_ADDR']); |
| 180 | 166 | $location = rtrim(`arp -a $remoteIp`); |
| 181 | - for ($i=0;$i < count($location);$i++) | |
| 182 | - GravaTESTES('location['.$i.']:'.$location[$i]); | |
| 167 | + //for ($i=0;$i < count($location);$i++) | |
| 168 | + // GravaTESTES('location['.$i.']:'.$location[$i]); | |
| 183 | 169 | //print_r($remoteIp.$location);//display |
| 184 | 170 | |
| 185 | 171 | //reduce no of white spaces then |
| ... | ... | @@ -225,27 +211,6 @@ function Debug($p_ScriptFileName) |
| 225 | 211 | } |
| 226 | 212 | } |
| 227 | 213 | } |
| 228 | - | |
| 229 | -/** | |
| 230 | - * Menu a ser apresentado ao usuario conforme o idioma selecionado | |
| 231 | - * | |
| 232 | - * @param string $_menu_name Nome do menu a ser pesquisado | |
| 233 | - * @return string Caminho do menu | |
| 234 | - */ | |
| 235 | -function getMenu($_menu_name) { | |
| 236 | - $_file_lang = 'language'.DIRECTORY_SEPARATOR.CACIC_LANGUAGE.DIRECTORY_SEPARATOR.$_menu_name; | |
| 237 | - if(is_file($_file_lang) and is_readable($_file_lang)) { | |
| 238 | - return $_file_lang; | |
| 239 | - } | |
| 240 | - else { | |
| 241 | - $_file_lang = 'language'.DIRECTORY_SEPARATOR.CACIC_LANGUAGE_STANDARD.DIRECTORY_SEPARATOR.$_menu_name; | |
| 242 | - if(is_file($_file_lang) and is_readable($_file_lang)) { | |
| 243 | - return $_file_lang; | |
| 244 | - } | |
| 245 | - else return "Erro no menu (Menu error)!".$_file_lang; | |
| 246 | - } | |
| 247 | -} | |
| 248 | - | |
| 249 | 214 | // __________________________________________________________________ |
| 250 | 215 | // Apenas uma alternativa mais completa à função "stripos" do PHP5... |
| 251 | 216 | // __________________________________________________________________ |
| ... | ... | @@ -274,10 +239,11 @@ function DeCrypt($p_CipherKey, $p_IV, $p_CriptedData, $p_cs_Cipher, $p_cs_UnComp |
| 274 | 239 | { |
| 275 | 240 | $p_CipherKey .= $p_PaddingKey; |
| 276 | 241 | |
| 277 | - GravaTESTES('Em DeCrypt: p_CipherKey = "'.$p_CipherKey.'"'); | |
| 278 | - GravaTESTES('Em DeCrypt: p_IV = "'.$p_IV.'"'); | |
| 279 | - GravaTESTES('Em DeCrypt: p_CriptedData = "'.$p_CriptedData.'"'); | |
| 280 | - GravaTESTES('Em DeCrypt: p_cs_Cipher = "'.$p_cs_Cipher.'"'); | |
| 242 | + /*GravaTESTES('Em DeCrypt: p_CipherKey = "'.$p_CipherKey.'"'); | |
| 243 | + GravaTESTES('Em DeCrypt: p_IV = "'.$p_IV.'"'); | |
| 244 | + GravaTESTES('Em DeCrypt: p_CriptedData = "'.$p_CriptedData.'"'); | |
| 245 | + GravaTESTES('Em DeCrypt: p_cs_Cipher = "'.$p_cs_Cipher.'"'); | |
| 246 | + */ | |
| 281 | 247 | // Bloco de Substituições para antes da Decriptação |
| 282 | 248 | // ------------------------------------------------ |
| 283 | 249 | // Razão: Dependendo da configuração do servidor, os valores |
| ... | ... | @@ -314,7 +280,8 @@ function DeCrypt($p_CipherKey, $p_IV, $p_CriptedData, $p_cs_Cipher, $p_cs_UnComp |
| 314 | 280 | if ($p_cs_UnCompress == '1') |
| 315 | 281 | $v_result = gzinflate($v_result); |
| 316 | 282 | |
| 317 | - GravaTESTES('Em DeCrypt: p_PaddingKey = "'.$p_PaddingKey.'"'); | |
| 283 | + //GravaTESTES('Em DeCrypt: p_PaddingKey = "'.$p_PaddingKey.'"'); | |
| 284 | + | |
| 318 | 285 | // Aqui retiro do resultado a ocorrência do preenchimento, caso exista. (o agente Python faz esse preenchimento) |
| 319 | 286 | if ($p_PaddingKey <> '') |
| 320 | 287 | { |
| ... | ... | @@ -322,7 +289,8 @@ function DeCrypt($p_CipherKey, $p_IV, $p_CriptedData, $p_cs_Cipher, $p_cs_UnComp |
| 322 | 289 | $re = "/".$char."*$/"; |
| 323 | 290 | $v_result = preg_replace($re, "", $v_result); |
| 324 | 291 | } |
| 325 | - GravaTESTES('Em DeCrypt: v_result = "'.$v_result.'"'); | |
| 292 | + //GravaTESTES('Em DeCrypt: v_result = "'.$v_result.'"'); | |
| 293 | + | |
| 326 | 294 | return trim($v_result); |
| 327 | 295 | } |
| 328 | 296 | |
| ... | ... | @@ -687,7 +655,7 @@ function dectobin($dectobin) |
| 687 | 655 | |
| 688 | 656 | function autentica_agente($p_CipherKey, $p_IV, $p_cs_cipher, $p_cs_compress, $p_PaddingKey='') |
| 689 | 657 | { |
| 690 | - | |
| 658 | + /* | |
| 691 | 659 | GravaTESTES('###########################################'); |
| 692 | 660 | GravaTESTES('Script Chamador: '.$_SERVER['REQUEST_URI']); |
| 693 | 661 | GravaTESTES('1: '.$_SERVER['HTTP_USER_AGENT']); |
| ... | ... | @@ -697,6 +665,7 @@ function autentica_agente($p_CipherKey, $p_IV, $p_cs_cipher, $p_cs_compress, $p_ |
| 697 | 665 | GravaTESTES('3: '.$_SERVER['PHP_AUTH_PW']); |
| 698 | 666 | GravaTESTES('33: '.strtoupper(DeCrypt($p_CipherKey,$p_IV,$_SERVER['PHP_AUTH_PW'],$p_cs_cipher, $p_cs_compress,$p_PaddingKey))); |
| 699 | 667 | GravaTESTES('###########################################'); |
| 668 | + */ | |
| 700 | 669 | if ((strtoupper(DeCrypt($p_CipherKey,$p_IV,$_SERVER['HTTP_USER_AGENT'],$p_cs_cipher, $p_cs_compress,$p_PaddingKey)) != 'AGENTE_CACIC') || |
| 701 | 670 | (strtoupper(DeCrypt($p_CipherKey,$p_IV,$_SERVER['PHP_AUTH_USER'],$p_cs_cipher, $p_cs_compress,$p_PaddingKey)) != 'USER_CACIC') || |
| 702 | 671 | (strtoupper(DeCrypt($p_CipherKey,$p_IV,$_SERVER['PHP_AUTH_PW'],$p_cs_cipher, $p_cs_compress,$p_PaddingKey)) != 'PW_CACIC')) |
| ... | ... | @@ -756,6 +725,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 756 | 725 | if (substr_count($v_te_ip,'zf')>0 || trim($v_te_ip)=='') |
| 757 | 726 | $v_te_ip = $_SERVER['REMOTE_ADDR']; |
| 758 | 727 | |
| 728 | + /* | |
| 759 | 729 | GravaTESTES('Script Chamador: '.$_SERVER['REQUEST_URI']); |
| 760 | 730 | GravaTESTES('v_te_ip: '.$v_te_ip); |
| 761 | 731 | |
| ... | ... | @@ -770,7 +740,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 770 | 740 | GravaTESTES('v_te_ip: '.$v_te_ip); |
| 771 | 741 | GravaTESTES('te_nome_computador: '.$te_nome_computador); |
| 772 | 742 | GravaTESTES('te_workgroup: '.$te_workgroup); |
| 773 | - | |
| 743 | + */ | |
| 774 | 744 | |
| 775 | 745 | $id_so = get_valor_campo('so', 'id_so', 'id_so = '.$id_so_new); |
| 776 | 746 | $te_so = get_valor_campo('so', 'te_so', 'te_so = "'.$te_so_new.'"'); |
| ... | ... | @@ -784,7 +754,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 784 | 754 | $query = 'UPDATE so |
| 785 | 755 | SET te_so = "'.$te_so_new.'" |
| 786 | 756 | WHERE id_so = '.$id_so; |
| 787 | - GravaTESTES('query 1: '.$query); | |
| 757 | + //GravaTESTES('query 1: '.$query); | |
| 788 | 758 | $result = mysql_query($query); |
| 789 | 759 | } |
| 790 | 760 | elseif ($te_so <> '' && ($id_so == '' || $id_so == 0)) // Encontrei somente o Identificador Interno (TE_SO) |
| ... | ... | @@ -793,7 +763,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 793 | 763 | $query = 'SELECT id_so |
| 794 | 764 | FROM so |
| 795 | 765 | WHERE te_so = "'.$te_so.'"'; |
| 796 | - GravaTESTES('query 2: '.$query); | |
| 766 | + //GravaTESTES('query 2: '.$query); | |
| 797 | 767 | $result = mysql_query($query); |
| 798 | 768 | $row = mysql_fetch_array($result); |
| 799 | 769 | $id_so = $row['id_so']; |
| ... | ... | @@ -820,7 +790,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 820 | 790 | $queryINS = 'INSERT |
| 821 | 791 | INTO so(id_so,te_desc_so,sg_so,te_so) |
| 822 | 792 | VALUES ('.$id_so.',"S.O. a Cadastrar","Sigla a Cadastrar","'.$te_so_new.'")'; |
| 823 | - GravaTESTES('queryINS: '.$queryINS); | |
| 793 | + //GravaTESTES('queryINS: '.$queryINS); | |
| 824 | 794 | $resultINS = mysql_query($queryINS); |
| 825 | 795 | |
| 826 | 796 | // Carrego os dados referente à rede da estação |
| ... | ... | @@ -831,7 +801,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 831 | 801 | FROM acoes_so |
| 832 | 802 | WHERE id_local = '.$v_dados_rede['id_local'].' |
| 833 | 803 | GROUP BY id_acao'; |
| 834 | - GravaTESTES('querySEL: '.$querySEL); | |
| 804 | + //GravaTESTES('querySEL: '.$querySEL); | |
| 835 | 805 | $resultSEL = mysql_query($querySEL); |
| 836 | 806 | |
| 837 | 807 | // Caso existam ações configuradas para o local, incluo o S.O. para que também execute-as... |
| ... | ... | @@ -874,7 +844,7 @@ function inclui_computador_caso_nao_exista( $te_node_address, |
| 874 | 844 | WHERE te_node_address = "'.$te_node_address.'" |
| 875 | 845 | AND id_so = "'.$id_so.'"'; |
| 876 | 846 | } |
| 877 | -GravaTESTES('QUERY : '.$query); | |
| 847 | +//GravaTESTES('QUERY : '.$query); | |
| 878 | 848 | $result = mysql_query($query); |
| 879 | 849 | $arrRetorno = array('id_so'=>$id_so,'te_so'=>$te_so); |
| 880 | 850 | // OK! O computador foi INCLUIDO/ATUALIZADO. |
| ... | ... | @@ -979,9 +949,10 @@ function quebra_linha($string, $tamanho_desejado) { |
| 979 | 949 | // -------------------------------------------------------------------------------------- |
| 980 | 950 | // Função usada para fazer updates das versões dos módulos nas subredes... |
| 981 | 951 | // -------------------------------------------------------------------------------------- |
| 982 | -function atualiza_red_ver_mod($pp_id_ip_rede, $p_nm_modulo, $p_te_versao_modulo, $p_id_local) | |
| 952 | +function atualiza_red_ver_mod($pp_id_ip_rede, $p_nm_modulo, $p_te_versao_modulo, $p_id_local, $p_cs_tipo_so) | |
| 983 | 953 | { |
| 984 | 954 | $MainFolder = GetMainFolder(); |
| 955 | + $arrCsTipoSO = explode('#',$p_cs_tipo_so); | |
| 985 | 956 | conecta_bd_cacic(); |
| 986 | 957 | $query_UPD = ' UPDATE redes |
| 987 | 958 | set dt_verifica_updates = NOW() |
| ... | ... | @@ -993,7 +964,8 @@ function atualiza_red_ver_mod($pp_id_ip_rede, $p_nm_modulo, $p_te_versao_modulo, |
| 993 | 964 | FROM redes_versoes_modulos |
| 994 | 965 | WHERE TRIM(id_ip_rede) = "'.trim($pp_id_ip_rede).'" AND |
| 995 | 966 | TRIM(nm_modulo)="'.trim($p_nm_modulo).'" AND |
| 996 | - id_local = '.$p_id_local; | |
| 967 | + id_local = '.$p_id_local.' AND | |
| 968 | + cs_tipo_so = "'.$arrCsTipoSO[1].'"'; | |
| 997 | 969 | $result_DEL = mysql_query($query_DEL); |
| 998 | 970 | |
| 999 | 971 | $v_te_versao_modulo = $p_te_versao_modulo; |
| ... | ... | @@ -1007,12 +979,14 @@ function atualiza_red_ver_mod($pp_id_ip_rede, $p_nm_modulo, $p_te_versao_modulo, |
| 1007 | 979 | nm_modulo, |
| 1008 | 980 | te_versao_modulo, |
| 1009 | 981 | id_local, |
| 1010 | - dt_atualizacao) | |
| 982 | + dt_atualizacao, | |
| 983 | + cs_tipo_so) | |
| 1011 | 984 | values ("'.$pp_id_ip_rede.'", |
| 1012 | 985 | "'.$p_nm_modulo.'", |
| 1013 | 986 | "'.$v_te_versao_modulo.'","'. |
| 1014 | 987 | $p_id_local.'", |
| 1015 | - now())'; | |
| 988 | + now(), | |
| 989 | + "'.$arrCsTipoSO[1].'")'; | |
| 1016 | 990 | |
| 1017 | 991 | $result_INS = mysql_query($query_INS); |
| 1018 | 992 | } |
| ... | ... | @@ -1020,9 +994,10 @@ function atualiza_red_ver_mod($pp_id_ip_rede, $p_nm_modulo, $p_te_versao_modulo, |
| 1020 | 994 | // -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1021 | 995 | // Função usada para fazer updates das versões dos módulos nos servidores de updates quando a chamada tem origem na página, via opção Update de Subredes... |
| 1022 | 996 | // -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1023 | -function atualiza_red_ver_mod_pagina($pp_te_serv_updates, $p_nm_modulo, $p_te_versao_modulo) | |
| 997 | +function atualiza_red_ver_mod_pagina($pp_te_serv_updates, $p_nm_modulo, $p_te_versao_modulo, $p_cs_tipo_so) | |
| 1024 | 998 | { |
| 1025 | 999 | $MainFolder = GetMainFolder(); |
| 1000 | + $arrCsTipoSO = explode('#',$p_cs_tipo_so); | |
| 1026 | 1001 | conecta_bd_cacic(); |
| 1027 | 1002 | $query_SEL = ' SELECT id_ip_rede, |
| 1028 | 1003 | id_local |
| ... | ... | @@ -1049,7 +1024,8 @@ function atualiza_red_ver_mod_pagina($pp_te_serv_updates, $p_nm_modulo, $p_te_ve |
| 1049 | 1024 | $query_DEL = 'DELETE |
| 1050 | 1025 | FROM redes_versoes_modulos |
| 1051 | 1026 | WHERE TRIM(id_ip_rede) IN ('.$redes.') AND |
| 1052 | - nm_modulo = "'.$p_nm_modulo.'"'; | |
| 1027 | + nm_modulo = "'.$p_nm_modulo.'" AND | |
| 1028 | + cs_tipo_so = "'.$arrCsTipoSO[1].'"'; | |
| 1053 | 1029 | // AND id_local = '.$p_id_local; |
| 1054 | 1030 | //GravaTESTES('query_DEL: '.$query_DEL); |
| 1055 | 1031 | $result_DEL = mysql_query($query_DEL); |
| ... | ... | @@ -1065,7 +1041,8 @@ function atualiza_red_ver_mod_pagina($pp_te_serv_updates, $p_nm_modulo, $p_te_ve |
| 1065 | 1041 | nm_modulo, |
| 1066 | 1042 | te_versao_modulo, |
| 1067 | 1043 | id_local, |
| 1068 | - dt_atualizacao) values '; | |
| 1044 | + dt_atualizacao, | |
| 1045 | + cs_tipo_so) values '; | |
| 1069 | 1046 | $query_INS = 'INSERT |
| 1070 | 1047 | INTO redes_versoes_modulos values '; |
| 1071 | 1048 | |
| ... | ... | @@ -1077,7 +1054,8 @@ function atualiza_red_ver_mod_pagina($pp_te_serv_updates, $p_nm_modulo, $p_te_ve |
| 1077 | 1054 | "'.$row['id_ip_rede'].'", |
| 1078 | 1055 | "'.$p_nm_modulo.'", |
| 1079 | 1056 | "'.$p_te_versao_modulo.'",'. |
| 1080 | - 'now())'; | |
| 1057 | + 'now(), | |
| 1058 | + "'.$arrCsTipoSO[1].'")'; | |
| 1081 | 1059 | $virgula = ','; |
| 1082 | 1060 | } |
| 1083 | 1061 | //GravaTESTES('query_INS: '.$query_INS); |
| ... | ... | @@ -1308,8 +1286,9 @@ if ($handle = opendir($MainFolder . '/repositorio')) |
| 1308 | 1286 | ' ORDER BY nm_modulo'; |
| 1309 | 1287 | conecta_bd_cacic(); |
| 1310 | 1288 | |
| 1311 | - $v_nomes_arquivos_FTP = array(); | |
| 1289 | + $v_nomes_arquivos_FTP = array(); | |
| 1312 | 1290 | $v_versoes_arquivos_FTP = array(); |
| 1291 | + $v_tipos_so_FTP = array(); | |
| 1313 | 1292 | |
| 1314 | 1293 | $Result_SEL_REDES = mysql_query($query_SEL_REDES); |
| 1315 | 1294 | $v_achei = 0; |
| ... | ... | @@ -1317,6 +1296,7 @@ if ($handle = opendir($MainFolder . '/repositorio')) |
| 1317 | 1296 | { |
| 1318 | 1297 | array_push($v_nomes_arquivos_FTP, trim($row['nm_modulo'])); |
| 1319 | 1298 | array_push($v_versoes_arquivos_FTP, trim($row['nm_modulo']).'#'.trim($row['te_versao_modulo'])); |
| 1299 | + array_push($v_tipos_so_FTP, trim($row['nm_modulo']).'#'.trim($row['cs_tipo_so'])); | |
| 1320 | 1300 | for ($cnt_arquivos_REP = 0; $cnt_arquivos_REP < count($v_nomes_arquivos_REP); $cnt_arquivos_REP++) |
| 1321 | 1301 | { |
| 1322 | 1302 | if (trim($v_nomes_arquivos_REP[$cnt_arquivos_REP]) == trim($row['nm_modulo']) && |
| ... | ... | @@ -1391,6 +1371,7 @@ if ($handle = opendir($MainFolder . '/repositorio')) |
| 1391 | 1371 | sort($v_nomes_arquivos_REP,SORT_STRING); |
| 1392 | 1372 | sort($v_versoes_arquivos_REP,SORT_STRING); |
| 1393 | 1373 | sort($v_nomes_arquivos_FTP,SORT_STRING); |
| 1374 | + sort($v_tipos_so_FTP,SORT_STRING); | |
| 1394 | 1375 | sort($v_versoes_arquivos_FTP,SORT_STRING); |
| 1395 | 1376 | $v_efetua_conexao_ftp = 1; |
| 1396 | 1377 | |
| ... | ... | @@ -1416,9 +1397,9 @@ if ($handle = opendir($MainFolder . '/repositorio')) |
| 1416 | 1397 | array_push($v_array_objetos_atualizados, $v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP]); |
| 1417 | 1398 | $arr_versao_arquivo = explode('#',$v_versoes_arquivos_REP[$cnt_nomes_arquivos_REP]); |
| 1418 | 1399 | if ($p_origem == 'Pagina') |
| 1419 | - atualiza_red_ver_mod_pagina($row['te_serv_updates'], $v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP],$arr_versao_arquivo[1]); | |
| 1400 | + atualiza_red_ver_mod_pagina($row['te_serv_updates'], $v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP],$arr_versao_arquivo[1],$v_tipos_so_FTP[$cnt_nomes_arquivos_REP]); | |
| 1420 | 1401 | else |
| 1421 | - atualiza_red_ver_mod($row['id_ip_rede'],$v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP],$arr_versao_arquivo[1],$row['id_local']); | |
| 1402 | + atualiza_red_ver_mod($row['id_ip_rede'],$v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP],$arr_versao_arquivo[1],$row['id_local'],$v_tipos_so_FTP[$cnt_nomes_arquivos_REP]); | |
| 1422 | 1403 | echo '<font size="1px" color="orange">Atualizado...: <font color="black">'.$v_nomes_arquivos_REP[$cnt_nomes_arquivos_REP].'</font></font><br>'; |
| 1423 | 1404 | $v_conta_objetos_atualizados ++; |
| 1424 | 1405 | flush(); | ... | ... |
relatorios/antivirus/index.php
| ... | ... | @@ -141,9 +141,9 @@ |
| 141 | 141 | do Engine</option> |
| 142 | 142 | <option value=", nu_versao_pattern as "Versão Pattern"">Versão |
| 143 | 143 | do Pattern</option> |
| 144 | - <option value=", DATE_FORMAT(dt_hr_instalacao,'%d/%m/%Y às %H:%ih') as "Data/Hora Instalação"">Data/Hora | |
| 144 | + <option value=", DATE_FORMAT(dt_hr_instalacao,'%d/%m/%Y às %H:%ih') as "Data/Hora Instalação",DATE_FORMAT(dt_hr_instalacao,'%Y%m%d%H%i') as "DHI"">Data/Hora | |
| 145 | 145 | Instalação</option> |
| 146 | - <option value=", DATE_FORMAT(dt_hr_coleta,'%d/%m/%Y às %H:%ih') as "Data/Hora Última Coleta"">Data/Hora | |
| 146 | + <option value=", DATE_FORMAT(dt_hr_coleta,'%d/%m/%Y às %H:%ih') as "Data/Hora Última Coleta",DATE_FORMAT(dt_hr_coleta,'%Y%m%d%H%i') as "DHUC"">Data/Hora | |
| 147 | 147 | Última Coleta</option> |
| 148 | 148 | <option value=", te_servidor as "Servidor"">Endereço |
| 149 | 149 | Servidor</option> |
| ... | ... | @@ -177,9 +177,7 @@ |
| 177 | 177 | </tr> |
| 178 | 178 | </table></td> |
| 179 | 179 | </tr> |
| 180 | - <tr> | |
| 181 | - <td valign="top"> </td> | |
| 182 | - </tr> | |
| 180 | + | |
| 183 | 181 | <? |
| 184 | 182 | /* |
| 185 | 183 | <tr> |
| ... | ... | @@ -235,22 +233,66 @@ |
| 235 | 233 | <td valign="top"> </td> |
| 236 | 234 | </tr> |
| 237 | 235 | */ |
| 236 | + $date_input1 = date('d/m/Y'); | |
| 237 | + $date_input2 = $date_input1; | |
| 238 | + | |
| 238 | 239 | ?> |
| 239 | 240 | |
| 241 | + <tr> | |
| 242 | + <td valign="top"> </td> | |
| 243 | + </tr> | |
| 244 | + <tr> | |
| 245 | + <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" align="center"> | |
| 246 | + <tr> | |
| 247 | + <td class="label" colspan="2">Informe o período (data de instalação) em que deverá | |
| 248 | + ser realizada a consulta: (ou deixe em branco) </td> | |
| 249 | + </tr> | |
| 250 | + <tr> | |
| 251 | + <td height="1" bgcolor="#333333" colspan="2"></td> | |
| 252 | + </tr> | |
| 253 | + <tr valign="middle"> | |
| 254 | + <td width="33%" height="1" nowrap valign="middle"> | |
| 255 | +<input name="date_input1" type="text" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $date_input1;?>"> | |
| 256 | + | |
| 257 | +<font size="2" face="Verdana, Arial, Helvetica, sans-serif">a</font> | |
| 258 | + <input name="date_input2" type="text" size="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $date_input2;?>"> | |
| 259 | +</td> | |
| 260 | + <td align="left" class="descricao"> (formato: dd/mm/aaaa)</td> | |
| 261 | + </tr> | |
| 262 | + </table></td> | |
| 263 | + </tr> | |
| 264 | + <tr> | |
| 265 | + <td valign="top"> </td> | |
| 266 | + </tr> | |
| 267 | + <tr> | |
| 268 | + <td valign="top"> | |
| 269 | + <table width="100%" border="0" cellpadding="0" cellspacing="1" align="center"> | |
| 270 | + | |
| 271 | + <tr> | |
| 272 | + <td height="1" bgcolor="#333333"></td> | |
| 273 | + </tr> | |
| 274 | + <tr valign="middle"> | |
| 275 | + <td width="33%" height="1" nowrap valign="middle" class="label"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> | |
| 276 | + <input type="checkbox" name="frmCsExibeInfoPatrimonial" value="S" id="frmCsExibeInfoPatrimonial" />Exibir Informações de Patrimônio</font></td> | |
| 277 | + </tr> | |
| 278 | + </table></td> | |
| 279 | + </tr> | |
| 280 | + | |
| 281 | + <tr> | |
| 282 | + <td valign="top"> </td> | |
| 283 | + </tr> | |
| 240 | 284 | <tr> |
| 241 | 285 | <td valign="top"> |
| 242 | 286 | <? $v_require = '../../include/' .($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'selecao_redes_inc.php':'selecao_locais_inc.php'); |
| 243 | 287 | require_once($v_require); |
| 244 | - ?> | |
| 245 | - </td> | |
| 288 | + ?> </td> | |
| 246 | 289 | </tr> |
| 247 | 290 | <tr> |
| 248 | 291 | <td valign="top"> </td> |
| 249 | 292 | </tr> |
| 250 | 293 | <tr> |
| 251 | 294 | <td valign="top"> |
| 252 | - <? require_once('../../include/selecao_so_inc.php'); ?> | |
| 253 | - </td> | |
| 295 | + <? require_once('../../include/selecao_so_inc.php'); ?> </td> | |
| 254 | 296 | </tr> |
| 255 | 297 | <tr> |
| 256 | 298 | <td valign="top"> </td> | ... | ... |
relatorios/antivirus/rel_antivirus.php
| 1 | 1 | <? session_start(); |
| 2 | -/* | |
| 3 | - * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
| 4 | - */ | |
| 5 | -if(!isset($_SESSION['id_usuario'])) | |
| 6 | - die('Acesso negado!'); | |
| 7 | -else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
| 8 | -} | |
| 9 | 2 | |
| 3 | +if($_POST['submit']) | |
| 4 | + { | |
| 5 | + $_SESSION["list2"] = $_POST['list2']; | |
| 6 | + $_SESSION["list4"] = $_POST['list4']; | |
| 7 | + $_SESSION["list6"] = $_POST['list6']; | |
| 8 | + $_SESSION["list8"] = $_POST['list8']; | |
| 9 | + $_SESSION["list10"] = $_POST['list10']; | |
| 10 | + $_SESSION["list12"] = $_POST['list12']; | |
| 11 | + $_SESSION["cs_situacao"] = $_POST["cs_situacao"]; | |
| 12 | + $_SESSION["cs_exibe_info_patrimonial"] = $_POST["frmCsExibeInfoPatrimonial"]; | |
| 10 | 13 | |
| 11 | -if($_POST['submit']) { | |
| 12 | - $_SESSION["list2"] = $_POST['list2']; | |
| 13 | - $_SESSION["list4"] = $_POST['list4']; | |
| 14 | - $_SESSION["list6"] = $_POST['list6']; | |
| 15 | - $_SESSION["list8"] = $_POST['list8']; | |
| 16 | - $_SESSION["list10"] = $_POST['list10']; | |
| 17 | - $_SESSION["list12"] = $_POST['list12']; | |
| 18 | - $_SESSION["cs_situacao"] = $_POST["cs_situacao"]; | |
| 19 | -} | |
| 14 | + $_SESSION['where_date'] = ''; | |
| 15 | + | |
| 16 | + if ($_POST['date_input1'] <> '') | |
| 17 | + { | |
| 18 | + $arrDateInput = explode('/',$_POST['date_input1']); | |
| 19 | + $_SESSION['where_date'] .= ' AND officescan.dt_hr_instalacao >= "'.$arrDateInput[2].'-'.$arrDateInput[1].'-'.$arrDateInput[0].' 00:00:00"'; | |
| 20 | + } | |
| 21 | + | |
| 22 | + if ($_POST['date_input2'] <> '') | |
| 23 | + { | |
| 24 | + $arrDateInput = explode('/',$_POST['date_input2']); | |
| 25 | + $_SESSION['where_date'] .= ' AND officescan.dt_hr_instalacao <= "'.$arrDateInput[2].'-'.$arrDateInput[1].'-'.$arrDateInput[0].' 23:59:59"'; | |
| 26 | + } | |
| 27 | + | |
| 28 | + if ($_SESSION['where_date']) | |
| 29 | + $_SESSION['where_date'] = ' AND trim(officescan.dt_hr_instalacao) <> "" '.$_SESSION['where_date']; | |
| 30 | + | |
| 31 | + } | |
| 20 | 32 | ?> |
| 21 | 33 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 22 | 34 | <html> |
| ... | ... | @@ -57,71 +69,74 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0 |
| 57 | 69 | <br> |
| 58 | 70 | <? |
| 59 | 71 | require_once('../../include/library.php'); |
| 60 | -// Comentado temporariamente - AntiSpy(); | |
| 72 | +AntiSpy(); | |
| 61 | 73 | conecta_bd_cacic(); |
| 62 | 74 | |
| 63 | 75 | $redes_selecionadas = ''; |
| 76 | +$from = ''; | |
| 77 | +$select = ''; | |
| 78 | +$query_redes = ''; | |
| 79 | + | |
| 64 | 80 | if ($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2) |
| 65 | 81 | { |
| 66 | - //if($_SESSION["cs_situacao"] == 'S') | |
| 67 | - // { | |
| 68 | - // Aqui pego todas as redes selecionadas e faço uma query p/ condição de redes | |
| 69 | - $redes_selecionadas = "'" . $_SESSION["list2"][0] . "'"; | |
| 70 | - for( $i = 1; $i < count($_SESSION["list2"] ); $i++ ) | |
| 71 | - { | |
| 72 | - $redes_selecionadas = $redes_selecionadas . ",'" . $_SESSION["list2"][$i] . "'"; | |
| 73 | - } | |
| 74 | - // } | |
| 75 | - $query_redes = 'AND id_ip_rede IN ('. $redes_selecionadas .')'; | |
| 82 | + $redes_selecionadas = "'" . $_SESSION["list2"][0] . "'"; | |
| 83 | + for( $i = 1; $i < count($_SESSION["list2"] ); $i++ ) | |
| 84 | + $redes_selecionadas = $redes_selecionadas . ",'" . $_SESSION["list2"][$i] . "'"; | |
| 85 | + | |
| 86 | + $query_redes = 'AND id_ip_rede IN ('. $redes_selecionadas .')'; | |
| 76 | 87 | } |
| 77 | 88 | else |
| 78 | 89 | { |
| 79 | 90 | // Aqui pego todos os locais selecionados e faço uma query p/ condição de redes/locais |
| 80 | 91 | $locais_selecionados = "'" . $_SESSION["list12"][0] . "'"; |
| 81 | 92 | for( $i = 1; $i < count($_SESSION["list12"] ); $i++ ) |
| 82 | - { | |
| 83 | 93 | $locais_selecionados .= ",'" . $_SESSION["list12"][$i] . "'"; |
| 84 | - } | |
| 94 | + | |
| 85 | 95 | $query_redes = 'AND computadores.id_ip_rede = redes.id_ip_rede AND |
| 86 | 96 | redes.id_local IN ('. $locais_selecionados .') AND |
| 87 | 97 | redes.id_local = locais.id_local '; |
| 88 | - $select = ' ,sg_local as Local '; | |
| 89 | - $from = ' ,redes,locais '; | |
| 98 | + $select = ' ,sg_local as "Local" '; | |
| 99 | + $from = ' ,redes, locais '; | |
| 90 | 100 | } |
| 91 | 101 | |
| 92 | 102 | // Aqui pego todos os SO selecionados |
| 93 | 103 | $so_selecionados = "'" . $_SESSION["list4"][0] . "'"; |
| 94 | -for( $i = 1; $i < count($_SESSION["list4"] ); $i++ ) { | |
| 104 | +for( $i = 1; $i < count($_SESSION["list4"] ); $i++ ) | |
| 95 | 105 | $so_selecionados = $so_selecionados . ",'" . $_SESSION["list4"][$i] . "'"; |
| 96 | -} | |
| 97 | 106 | |
| 98 | 107 | // Aqui pego todas as configurações de hardware que deseja exibir |
| 99 | -for( $i = 0; $i < count($_SESSION["list6"] ); $i++ ) { | |
| 108 | +for( $i = 0; $i < count($_SESSION["list6"] ); $i++ ) | |
| 100 | 109 | $campos_software = $campos_software . $_SESSION["list6"][$i]; |
| 101 | -} | |
| 110 | + | |
| 102 | 111 | // Aqui substitui todas as strings \ por vazio que a variável $campos_hardware retorna |
| 103 | 112 | $campos_software = str_replace('\\', '', $campos_software); |
| 104 | 113 | |
| 105 | -if ($_GET['orderby']) { $orderby = $_GET['orderby']; } | |
| 106 | - | |
| 107 | -else { $orderby = 'te_nome_computador'; } | |
| 114 | +if ($_GET['orderby']) | |
| 115 | + $orderby = $_GET['orderby']; | |
| 116 | +else | |
| 117 | + $orderby = 'computadores.te_nome_computador'; | |
| 108 | 118 | |
| 109 | 119 | $query = 'SELECT distinct computadores.te_node_address, |
| 110 | 120 | so.id_so, |
| 111 | - te_nome_computador as "Nome Comp.", | |
| 112 | - sg_so as "S.O.", | |
| 113 | - te_ip as "IP"' . | |
| 121 | + computadores.te_nome_computador as "Nome Comp.", | |
| 122 | + so.sg_so as "S.O.", | |
| 123 | + computadores.te_ip as "IP"' . | |
| 114 | 124 | $campos_software . |
| 115 | 125 | $select . ' |
| 116 | 126 | FROM so, |
| 117 | - computadores LEFT JOIN officescan ON (computadores.te_node_address = officescan.te_node_address and computadores.id_so = officescan.id_so) '. | |
| 127 | + computadores | |
| 128 | + LEFT JOIN officescan ON computadores.te_node_address = officescan.te_node_address and computadores.id_so = officescan.id_so '. | |
| 118 | 129 | $from. ' |
| 119 | 130 | WHERE TRIM(computadores.te_nome_computador) <> "" AND |
| 120 | 131 | computadores.id_so = so.id_so AND |
| 121 | 132 | computadores.id_so IN ('. $so_selecionados .')'. |
| 133 | + $_SESSION['where_date']. | |
| 122 | 134 | $query_redes .' |
| 123 | 135 | ORDER BY ' . $orderby; |
| 124 | 136 | |
| 137 | +//if ($_SERVER['REMOTE_ADDR']=='10.71.0.58') | |
| 138 | +// echo $query . '<br>'; | |
| 139 | + | |
| 125 | 140 | $result = mysql_query($query) or die('Erro no select ou sua sessão expirou!'); |
| 126 | 141 | |
| 127 | 142 | $cor = 0; |
| ... | ... | @@ -132,29 +147,177 @@ echo '<table cellpadding="2" cellspacing="0" border="1" bordercolor="#999999" bo |
| 132 | 147 | <tr bgcolor="#E1E1E1" > |
| 133 | 148 | <td nowrap align="left"><font size="1" face="Verdana, Arial"> </font></td>'; |
| 134 | 149 | |
| 135 | -for ($i=2; $i < mysql_num_fields($result); $i++) { //Table Header | |
| 136 | - print '<td nowrap align="left"><b><font size="1" face="Verdana, Arial"><a href="?orderby=' . ($i + 1) . '">'. mysql_field_name($result, $i) .'</a></font><b></td>'; | |
| 137 | -} | |
| 150 | +$intColunaDHI = 0; // Coluna apenas para ordenar pela Data/Hora de Instalacao | |
| 151 | + | |
| 152 | +for ($i=2; $i < mysql_num_fields($result); $i++) | |
| 153 | + {//Table Header | |
| 154 | + $iAux = $i; | |
| 155 | + $iAux = ($iAux==6?7:$iAux); | |
| 156 | + $iAux = ($iAux==8?9:$iAux); | |
| 157 | + // Não mostro as colunas datas/horas, usadas para ordenação | |
| 158 | + if (mysql_field_name($result, $i)<>'DHI' && mysql_field_name($result, $i)<>'DHUC') | |
| 159 | + 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>'; | |
| 160 | + } | |
| 161 | + | |
| 162 | +// Caso seja selecionada a exibição de Informações Patrimoniais... | |
| 163 | +if ($_SESSION['cs_exibe_info_patrimonial']<>'') | |
| 164 | + { | |
| 165 | + $strTripaMacSO = ''; | |
| 166 | + | |
| 167 | + // Foi necessário implementar essa P.O.G. devido a erro #1054 do MySQL 5.x!!! | |
| 168 | + while ($row = mysql_fetch_array($result)) | |
| 169 | + { | |
| 170 | + $strTripaMacSO .= ($strTripaMacSO <> ''?',':''); | |
| 171 | + $strTripaMacSO .= '"'.$row['te_node_address'].'_'.$row['id_so'].'"'; | |
| 172 | + } | |
| 173 | + | |
| 174 | + // Restauro o ponteiro da consulta | |
| 175 | + mysql_data_seek($result,0); | |
| 176 | + | |
| 177 | + $query_pat = 'SELECT nm_campo_tab_patrimonio, | |
| 178 | + te_etiqueta | |
| 179 | + FROM patrimonio_config_interface | |
| 180 | + WHERE id_local = '.$_SESSION['id_local']; | |
| 181 | + $result_pat = mysql_query($query_pat); | |
| 182 | + | |
| 183 | + $select_pat = 'pat.te_node_address,pat.id_so'; | |
| 184 | + | |
| 185 | + | |
| 186 | + while ($row_pat = mysql_fetch_array($result_pat)) | |
| 187 | + { | |
| 188 | + $boolMostraColuna = false; | |
| 189 | + if ($row_pat['nm_campo_tab_patrimonio'] =='id_unid_organizacional_nivel1') | |
| 190 | + { | |
| 191 | + $select_pat .= ', uon1.nm_unid_organizacional_nivel1 as "' . $row_pat['te_etiqueta'].'"'; | |
| 192 | + $boolMostraColuna = true; | |
| 193 | + } | |
| 194 | + elseif ($row_pat['nm_campo_tab_patrimonio']=='id_unid_organizacional_nivel1a') | |
| 195 | + { | |
| 196 | + $select_pat .= ', uon1a.nm_unid_organizacional_nivel1a as "' . $row_pat['te_etiqueta'].'"'; | |
| 197 | + $boolMostraColuna = true; | |
| 198 | + } | |
| 199 | + elseif ($row_pat['nm_campo_tab_patrimonio']=='id_unid_organizacional_nivel2') | |
| 200 | + { | |
| 201 | + $select_pat .= ', uon2.nm_unid_organizacional_nivel2 as "' . $row_pat['te_etiqueta'].'"'; | |
| 202 | + $boolMostraColuna = true; | |
| 203 | + } | |
| 204 | + else | |
| 205 | + { | |
| 206 | + $select_pat .= ', ' . $row_pat['nm_campo_tab_patrimonio'] . ' as "' . $row_pat['te_etiqueta'].'"'; | |
| 207 | + $boolMostraColuna = true; | |
| 208 | + } | |
| 209 | + | |
| 210 | + // Mostro apenas as colunas interessantes | |
| 211 | + if ($boolMostraColuna) | |
| 212 | + { | |
| 213 | + $iAux ++; | |
| 214 | + print '<td nowrap align="left"><b><font size="1" face="Verdana, Arial">'. $row_pat['te_etiqueta'] .'</font><b></td>'; | |
| 215 | + } | |
| 216 | + } | |
| 217 | + | |
| 218 | + $from_pat = ' unid_organizacional_nivel1 uon1, | |
| 219 | + unid_organizacional_nivel1a uon1a, | |
| 220 | + unid_organizacional_nivel2 uon2, | |
| 221 | + patrimonio pat, | |
| 222 | + computadores comp'; | |
| 223 | + | |
| 224 | + $where_pat = ' comp.te_node_address = pat.te_node_address AND | |
| 225 | + comp.id_so = pat.id_so AND | |
| 226 | + pat.id_unid_organizacional_nivel1a = uon1a.id_unid_organizacional_nivel1a AND | |
| 227 | + pat.id_unid_organizacional_nivel2 = uon2.id_unid_organizacional_nivel2 AND | |
| 228 | + uon1a.id_unid_organizacional_nivel1a = uon2.id_unid_organizacional_nivel1a AND | |
| 229 | + uon1a.id_unid_organizacional_nivel1 = uon1.id_unid_organizacional_nivel1 '; | |
| 230 | + $query_pat = ' SELECT ' .$select_pat. | |
| 231 | + ' FROM ' .$from_pat. | |
| 232 | + ' WHERE ' .$where_pat. | |
| 233 | + ' AND concat(pat.te_node_address,"_",pat.id_so) in ('.$strTripaMacSO.') '; | |
| 234 | + | |
| 235 | + $result_pat = mysql_query($query_pat); | |
| 236 | + while ($row_pat = mysql_fetch_array($result_pat)) | |
| 237 | + { | |
| 238 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['uon1'] = $row_pat[2]; | |
| 239 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['uon1a'] = $row_pat[3]; | |
| 240 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['uon2'] = $row_pat[4]; | |
| 241 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_localizacao_complementar'] = $row_pat[5]; | |
| 242 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio1'] = $row_pat[6]; | |
| 243 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio2'] = $row_pat[7]; | |
| 244 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio3'] = $row_pat[8]; | |
| 245 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio4'] = $row_pat[9]; | |
| 246 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio5'] = $row_pat[10]; | |
| 247 | + $arrMacSO[$row_pat['te_node_address'].'_'.$row_pat['id_so']]['te_info_patrimonio6'] = $row_pat[11]; | |
| 248 | + } | |
| 249 | + } | |
| 250 | + | |
| 251 | + | |
| 138 | 252 | echo '</tr>'; |
| 139 | 253 | |
| 140 | -while ($row = mysql_fetch_row($result)) { //Table body | |
| 254 | +while ($row = mysql_fetch_row($result)) | |
| 255 | + {//Table body | |
| 141 | 256 | echo '<tr '; |
| 142 | 257 | if ($cor) { echo 'bgcolor="#E1E1E1"'; } |
| 143 | 258 | echo '>'; |
| 144 | 259 | echo '<td nowrap align="right"><font size="1" face="Verdana, Arial">' . $num_registro . '</font></td>'; |
| 145 | 260 | 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>"; |
| 146 | - for ($i=3; $i < $fields; $i++) { | |
| 147 | - echo '<td nowrap align="left"><font size="1" face="Verdana, Arial" '; | |
| 148 | - if ($row[$i] == 'N') | |
| 149 | - {echo 'color="#FF0000"><strong>N</strong>';} | |
| 150 | - else | |
| 151 | - {echo '>'.$row[$i]; } | |
| 152 | - echo ' </td>'; | |
| 153 | - } | |
| 261 | + for ($i=3; $i < $fields; $i++) | |
| 262 | + { | |
| 263 | + if ($i <> 7 && $i <> 9) // Não mostro os valores datas/horas, usados para ordenação | |
| 264 | + { | |
| 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 | + } | |
| 273 | + } | |
| 274 | + if ($_SESSION['cs_exibe_info_patrimonial']<>'') | |
| 275 | + { | |
| 276 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 277 | + echo $arrMacSO[$row[0].'_'.$row[1]]['uon1']; | |
| 278 | + echo ' </td>'; | |
| 279 | + | |
| 280 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 281 | + echo $arrMacSO[$row[0].'_'.$row[1]]['uon1a']; | |
| 282 | + echo ' </td>'; | |
| 283 | + | |
| 284 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 285 | + echo $arrMacSO[$row[0].'_'.$row[1]]['uon2']; | |
| 286 | + echo ' </td>'; | |
| 287 | + | |
| 288 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 289 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_localizacao_complementar']; | |
| 290 | + echo ' </td>'; | |
| 291 | + | |
| 292 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 293 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio1']; | |
| 294 | + echo ' </td>'; | |
| 295 | + | |
| 296 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 297 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio2']; | |
| 298 | + echo ' </td>'; | |
| 299 | + | |
| 300 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 301 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio3']; | |
| 302 | + echo ' </td>'; | |
| 303 | + | |
| 304 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 305 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio4']; | |
| 306 | + echo ' </td>'; | |
| 307 | + | |
| 308 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 309 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio5']; | |
| 310 | + echo ' </td>'; | |
| 311 | + | |
| 312 | + echo '<td nowrap align="left"><font size="1" face="Verdana, Arial">'; | |
| 313 | + echo $arrMacSO[$row[0].'_'.$row[1]]['te_info_patrimonio6']; | |
| 314 | + echo ' </td>'; | |
| 315 | + | |
| 316 | + } | |
| 154 | 317 | $cor=!$cor; |
| 155 | 318 | $num_registro++; |
| 156 | 319 | echo '</tr>'; |
| 157 | -} | |
| 320 | + } | |
| 158 | 321 | echo '</table><br><br>'; |
| 159 | 322 | if (count($_SESSION["list8"])>0) |
| 160 | 323 | { |
| ... | ... | @@ -167,6 +330,6 @@ if (count($_SESSION["list8"])>0) |
| 167 | 330 | gerado pelo <strong>CACIC</strong> - Configurador Automático e Coletor |
| 168 | 331 | de Informações Computacionais</font><br> |
| 169 | 332 | <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Software desenvolvido |
| 170 | - pela Dataprev - Escritório do Espírito Santo</font></p> | |
| 333 | + pela Dataprev - Unidade Regional Espírito Santo</font></p> | |
| 171 | 334 | </body> |
| 172 | 335 | </html> | ... | ... |
relatorios/patrimonio/index.php
| ... | ... | @@ -302,6 +302,31 @@ require_once('../../include/library.php'); |
| 302 | 302 | ORDER BY te_etiqueta"; |
| 303 | 303 | |
| 304 | 304 | $res_fields = mysql_query($query); |
| 305 | + | |
| 306 | + // Caso o usuário não tenha nível administrativo, filtro as UON2 para seleção das UON1a | |
| 307 | + if ($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2) | |
| 308 | + { | |
| 309 | + | |
| 310 | + $selectUON1a = ' SELECT distinct id_unid_organizacional_nivel1a '; | |
| 311 | + $fromUON1a = ' FROM unid_organizacional_nivel2 UON2 '; | |
| 312 | + $whereUON1a = ' WHERE UON2.id_local = '.$_SESSION['id_local']; | |
| 313 | + if ($_SESSION['te_locais_secundarios'] <> '') | |
| 314 | + $whereUON1a .= ' OR UON2.id_local in ('.$_SESSION['te_locais_secundarios'].')'; | |
| 315 | + | |
| 316 | + $strTripaUON1a = ''; | |
| 317 | + $queryUON1a = $selectUON1a . $fromUON1a . $whereUON1a; | |
| 318 | +//if ($_SERVER['REMOTE_ADDR']=='10.71.0.58') | |
| 319 | + //echo $queryUON1a . '<br>'; | |
| 320 | + $resUON1a = mysql_query($queryUON1a); | |
| 321 | + | |
| 322 | + while ($rowUON1a = mysql_fetch_array($resUON1a)) | |
| 323 | + { | |
| 324 | + $strTripaUON1a .= ($strTripaUON1a <> ''?',':''); | |
| 325 | + $strTripaUON1a .= $rowUON1a['id_unid_organizacional_nivel1a']; | |
| 326 | + } | |
| 327 | + | |
| 328 | + } | |
| 329 | + | |
| 305 | 330 | $idUO = ''; |
| 306 | 331 | while ($row_fields = mysql_fetch_array($res_fields)) |
| 307 | 332 | { |
| ... | ... | @@ -318,15 +343,24 @@ require_once('../../include/library.php'); |
| 318 | 343 | </select> |
| 319 | 344 | |
| 320 | 345 | <? |
| 321 | - $select1 = ($idUO=='1'?'id_unid_organizacional_nivel1 as id,nm_unid_organizacional_nivel1 as nm':($idUO=='1a'?'id_unid_organizacional_nivel1a as id,nm_unid_organizacional_nivel1a as nm':'id_unid_organizacional_nivel2 as id,nm_unid_organizacional_nivel2 as nm')); | |
| 322 | - $from1 = ($idUO=='1'?'unid_organizacional_nivel1 UO':($idUO=='1a'?'unid_organizacional_nivel1a UO':'unid_organizacional_nivel2 UO')); | |
| 323 | - $where1 = ($idUO<>'1' && $idUO<>'1a'?' WHERE UO.id_local = '.$_SESSION['id_local']:' '); | |
| 324 | - $orderby1 = ($idUO=='1'?'nm_unid_organizacional_nivel1':($idUO=='1a'?'nm_unid_organizacional_nivel1a':'nm_unid_organizacional_nivel2')); | |
| 346 | + $select1 = ($idUO=='1' ? ' id_unid_organizacional_nivel1 as id,nm_unid_organizacional_nivel1 as nm':($idUO=='1a'?'id_unid_organizacional_nivel1a as id,nm_unid_organizacional_nivel1a as nm':' id_unid_organizacional_nivel2 as id,nm_unid_organizacional_nivel2 as nm')); | |
| 347 | + $from1 = ($idUO=='1' ? ' unid_organizacional_nivel1 UO':($idUO=='1a'?'unid_organizacional_nivel1a UO':'unid_organizacional_nivel2 UO')); | |
| 348 | + $where1 = ''; | |
| 349 | + if ($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2) | |
| 350 | + { | |
| 351 | + $where1 .= ($idUO<>'1' && $idUO<>'1a' ? ' WHERE UO.id_local = '.$_SESSION['id_local']:''); | |
| 352 | + $where1 .= ($idUO<>'1' && $idUO<>'1a' && $_SESSION['te_locais_secundarios']<>''?' OR (UO.id_local in ('.$_SESSION['te_locais_secundarios'].')) ':''); | |
| 353 | + $where1 .= ($idUO<>'1' && $idUO<>'1a' && $_SESSION['te_locais_secundarios']<>''?' OR (UO.id_local in ('.$_SESSION['te_locais_secundarios'].')) ':''); | |
| 354 | + $where1 = ($idUO=='1a'?' WHERE id_unid_organizacional_nivel1a in ('.$strTripaUON1a.') ':$where1); | |
| 355 | + } | |
| 356 | + $orderby1 = ($idUO=='1' ? ' nm_unid_organizacional_nivel1':($idUO=='1a'?'nm_unid_organizacional_nivel1a':'nm_unid_organizacional_nivel2')); | |
| 325 | 357 | |
| 326 | 358 | $query1 = "SELECT $select1 |
| 327 | 359 | FROM $from1 |
| 328 | 360 | $where1 |
| 329 | 361 | ORDER BY $orderby1"; |
| 362 | +//if ($_SERVER['REMOTE_ADDR']=='10.71.0.58') | |
| 363 | +// echo $query1 . '<br>'; | |
| 330 | 364 | ?> |
| 331 | 365 | <td align="left"> |
| 332 | 366 | <select name="frm_UO<? echo $idUO .'_' . $row_fields['id_etiqueta']; ?>" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);montaComboMulti('frm_UO<? echo $idUO .'_' . $row_fields['id_etiqueta'];?>',false);"> | ... | ... |
ws/get_config.php
| ... | ... | @@ -31,8 +31,6 @@ $v_compress_level = 0; // Mantido em 0(zero) para desabilitar a Compressão/Deco |
| 31 | 31 | $retorno_xml_header = '<?xml version="1.0" encoding="iso-8859-1" ?><STATUS>OK</STATUS><CONFIGS>'; |
| 32 | 32 | $retorno_xml_values = ''; |
| 33 | 33 | |
| 34 | -LimpaTESTES(); | |
| 35 | - | |
| 36 | 34 | // Essas variáveis conterão os indicadores de criptografia e compactação |
| 37 | 35 | $v_cs_cipher = (trim($_POST['cs_cipher']) <> ''?trim($_POST['cs_cipher']) : '4'); |
| 38 | 36 | $v_cs_compress = (trim($_POST['cs_compress']) <> ''?trim($_POST['cs_compress']) : '4'); |
| ... | ... | @@ -44,13 +42,10 @@ if ($_POST['padding_key']) |
| 44 | 42 | { |
| 45 | 43 | // Valores específicos para trabalho com o PyCACIC - 04 de abril de 2008 - Rogério Lino - Dataprev/ES |
| 46 | 44 | $strPaddingKey = $_POST['padding_key']; // A versão inicial do agente em Python exige esse complemento na chave... |
| 47 | - $boolPyCACIC = (trim(DeCrypt($key,$iv,$_POST['agente'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)) == 'pycacic'?1:0); | |
| 48 | - | |
| 49 | - if ($_POST['agente'] <> '') | |
| 50 | - foreach($HTTP_POST_VARS as $i => $v) | |
| 51 | - GravaTESTES('i: "'.$i.'" v: "'.$v.'"'); | |
| 52 | 45 | } |
| 53 | - | |
| 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); | |
| 54 | 49 | |
| 55 | 50 | // Obtenho o IP da estação por meio da decriptografia... |
| 56 | 51 | $v_id_ip_estacao = trim(DeCrypt($key,$iv,$_POST['id_ip_estacao'],$v_cs_cipher,$v_cs_compress,$strPaddingKey)); |
| ... | ... | @@ -65,7 +60,7 @@ $v_dados_rede = getDadosRede(); |
| 65 | 60 | if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$strPaddingKey))=='chkcacic' || |
| 66 | 61 | trim(DeCrypt($key,$iv,$_POST['in_teste'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey))=='OK') |
| 67 | 62 | { |
| 68 | - $retorno_xml_values .= '<TE_REDE_OK>' . EnCrypt($key,$iv,($v_dados_rede['id_ip_rede'] <> ''?'S':'N') ,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey). '</TE_REDE_OK>'; | |
| 63 | + $retorno_xml_values .= '<TE_REDE_OK>' . EnCrypt($key,$iv,($v_dados_rede['id_ip_rede'] <> ''?'S':'N'),$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey). '</TE_REDE_OK>'; | |
| 69 | 64 | |
| 70 | 65 | if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$strPaddingKey))=='chkcacic') |
| 71 | 66 | { |
| ... | ... | @@ -75,9 +70,14 @@ if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$str |
| 75 | 70 | if (file_exists($MainFolder . '/repositorio/versoes_agentes.ini')) |
| 76 | 71 | { |
| 77 | 72 | $v_array_versoes_agentes = parse_ini_file($MainFolder . '/repositorio/versoes_agentes.ini'); |
| 78 | - $retorno_xml_values .= '<CACIC2>' . EnCrypt($key,$iv,$v_array_versoes_agentes['cacic2.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CACIC2>'; | |
| 79 | - $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>'; | |
| 80 | - $retorno_xml_values .= '<CHKSIS>' . EnCrypt($key,$iv,$v_array_versoes_agentes['chksis.exe'],$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '<' . '/CHKSIS>'; | |
| 73 | + 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>'; | |
| 75 | + else | |
| 76 | + { | |
| 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>'; | |
| 78 | + $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>'; | |
| 80 | + } | |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| ... | ... | @@ -140,9 +140,6 @@ if (trim(DeCrypt($key,$iv,$_POST['in_chkcacic'],$v_cs_cipher,$v_cs_compress,$str |
| 140 | 140 | } |
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | - GravaTESTES('Chamando autentica_agente: key="'.$key.'"'); | |
| 144 | - GravaTESTES('Chamando autentica_agente: iv="'.$iv.'"'); | |
| 145 | - GravaTESTES('Chamando autentica_agente: v_cs_cipher="'.$v_cs_cipher.'"'); | |
| 146 | 143 | |
| 147 | 144 | // Autenticação dos agentes: |
| 148 | 145 | autentica_agente($key,$iv,$v_cs_cipher,$v_cs_compress,$strPaddingKey); |
| ... | ... | @@ -155,14 +152,16 @@ else |
| 155 | 152 | $v_te_senha_login_serv_updates = $v_dados_rede['te_senha_login_serv_updates']; |
| 156 | 153 | $v_nu_porta_serv_updates = $v_dados_rede['nu_porta_serv_updates']; |
| 157 | 154 | |
| 158 | - $te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 159 | - $id_so_new = DeCrypt($key,$iv,$_POST['id_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 160 | - $te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 161 | - $te_nome_computador = DeCrypt($key,$iv,$_POST['te_nome_computador'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 162 | - $te_workgroup = DeCrypt($key,$iv,$_POST['te_workgroup'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 163 | - $te_versao_cacic = DeCrypt($key,$iv,$_POST['te_versao_cacic'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 164 | - $te_versao_gercols = DeCrypt($key,$iv,$_POST['te_versao_gercols'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 165 | - $te_tripa_perfis = DeCrypt($key,$iv,$_POST['te_tripa_perfis'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); | |
| 155 | + $te_node_address = DeCrypt($key,$iv,$_POST['te_node_address'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Endereço MAC (MAC Address) | |
| 156 | + $id_so_new = DeCrypt($key,$iv,$_POST['id_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Antigo Identificador de S.O. (Old O.S. ID) | |
| 157 | + $te_so = DeCrypt($key,$iv,$_POST['te_so'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Novo Identificador de S.O. (New O.S. Id) | |
| 158 | + $te_nome_computador = DeCrypt($key,$iv,$_POST['te_nome_computador'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Nome do Computador (Computer Name) | |
| 159 | + $te_workgroup = DeCrypt($key,$iv,$_POST['te_workgroup'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Nome do Grupo de Trabalho (WorkGroup Name) | |
| 160 | + $te_versao_cacic = DeCrypt($key,$iv,$_POST['te_versao_cacic'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Versão do Agente Principal Cacic2.exe (Version of Principal Agent) | |
| 161 | + $te_versao_gercols = DeCrypt($key,$iv,$_POST['te_versao_gercols'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Versão do Agente Gerente de Coletas Ger_Cols (Version of PickUp Manager) | |
| 162 | + $te_palavra_chave = DeCrypt($key,$iv,$_POST['te_palavra_chave'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Palavra-Chave para Acesso ao Agente Principal (Keyword to Access to Principal Agent) | |
| 163 | + $te_tripa_perfis = DeCrypt($key,$iv,$_POST['te_tripa_perfis'] ,$v_cs_cipher,$v_cs_compress,$strPaddingKey); // Lista com Resultados de Sistemas Monitorados Pesquisados na Estação (Results of Search of Station´s Monitored Systems) | |
| 164 | + | |
| 166 | 165 | |
| 167 | 166 | /* Todas as vezes em que é feita a recuperação das configurações por um agente, é incluído |
| 168 | 167 | o computador deste agente no BD, caso ainda não esteja inserido. */ |
| ... | ... | @@ -185,7 +184,8 @@ else |
| 185 | 184 | te_so = "'.$arrSO['te_so'].'", |
| 186 | 185 | te_ip = "'.$v_id_ip_estacao.'", |
| 187 | 186 | te_versao_cacic = "' . $te_versao_cacic . '", |
| 188 | - te_versao_gercols= "' . $te_versao_gercols . '" | |
| 187 | + te_versao_gercols= "' . $te_versao_gercols . '", | |
| 188 | + te_palavra_chave="'.$te_palavra_chave.'" | |
| 189 | 189 | WHERE te_node_address = "'.$te_node_address.'" AND |
| 190 | 190 | id_so = "'.$arrSO['id_so'].'"'; |
| 191 | 191 | $result = mysql_query($query); |
| ... | ... | @@ -279,14 +279,10 @@ else |
| 279 | 279 | } |
| 280 | 280 | $retorno_xml_values .= '<' . 'DT_HR_COLETA_FORCADA_' . $campos["te_nome_curto_modulo"] . '>' . EnCrypt($key,$iv,$v_dt_hr_coleta_forcada,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey) . '</' . 'DT_HR_COLETA_FORCADA_' . $campos["te_nome_curto_modulo"] . '>'; |
| 281 | 281 | } |
| 282 | - if (trim($id_acao) == "cs_coleta_monitorado" && mysql_num_rows($result_monitorado)) | |
| 282 | + if (!$boolAgenteLinux && trim($id_acao) == "cs_coleta_monitorado" && mysql_num_rows($result_monitorado)) | |
| 283 | 283 | { |
| 284 | - $v_arr_WNT = array( '6', // NT | |
| 285 | - '7', // 2K | |
| 286 | - '8', // XP | |
| 287 | - '13' // SERVER2003 | |
| 288 | - ); | |
| 289 | 284 | |
| 285 | + // Apenas catalogo as versões anteriores aos NT Like | |
| 290 | 286 | $v_arr_W9x = array( '1', // 95 |
| 291 | 287 | '2', // 95OSR |
| 292 | 288 | '3', // 98 |
| ... | ... | @@ -316,9 +312,9 @@ else |
| 316 | 312 | $v_te_ide_licenca = ''; |
| 317 | 313 | |
| 318 | 314 | $v_retorno_MONITORADOS .= $campo_monitorado['id_aplicativo'] . ','. |
| 319 | - $campo_monitorado['dt_atualizacao'] . ','. | |
| 320 | - $campo_monitorado['cs_ide_licenca'] . ','. | |
| 321 | - $v_te_ide_licenca . ','; | |
| 315 | + $campo_monitorado['dt_atualizacao'] . ','. | |
| 316 | + $campo_monitorado['cs_ide_licenca'] . ','. | |
| 317 | + $v_te_ide_licenca . ','; | |
| 322 | 318 | |
| 323 | 319 | if (in_array($arrSO['id_so'],$v_arr_W9x)) |
| 324 | 320 | { |
| ... | ... | @@ -395,7 +391,14 @@ else |
| 395 | 391 | |
| 396 | 392 | $result_modulos = mysql_query($query_modulos); |
| 397 | 393 | while ($row_modulos = mysql_fetch_array($result_modulos)) |
| 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>'; | |
| 394 | + { | |
| 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>'; | |
| 401 | + } | |
| 399 | 402 | |
| 400 | 403 | if ($v_retorno_MONITORADOS <> '') |
| 401 | 404 | $retorno_xml_values .= '<SISTEMAS_MONITORADOS_PERFIS>'.EnCrypt($key,$iv,$v_retorno_MONITORADOS,$v_cs_cipher,$v_cs_compress,$v_compress_level,$strPaddingKey).'</SISTEMAS_MONITORADOS_PERFIS>'; | ... | ... |
ws/set_hardware.php
| ... | ... | @@ -192,22 +192,23 @@ if ($te_node_address <> '') |
| 192 | 192 | |
| 193 | 193 | // Lembre-se de que o computador já existe. Ele é criado durante a obtenção das configurações, no arquivo get_config.php. |
| 194 | 194 | $query = " UPDATE computadores |
| 195 | - SET te_mem_ram_desc = '" . DeCrypt($key,$iv,$_POST['te_mem_ram_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 196 | - qt_mem_ram = '" . DeCrypt($key,$iv,$_POST['qt_mem_ram'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 197 | - te_bios_desc = '" . DeCrypt($key,$iv,$_POST['te_bios_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 198 | - te_bios_data = '" . DeCrypt($key,$iv,$_POST['te_bios_data'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 199 | - te_bios_fabricante = '" . DeCrypt($key,$iv,$_POST['te_bios_fabricante'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 200 | - te_placa_mae_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_mae_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 201 | - te_placa_mae_fabricante = '" . DeCrypt($key,$iv,$_POST['te_placa_mae_fabricante'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 202 | - qt_placa_video_mem = '" . DeCrypt($key,$iv,$_POST['qt_placa_video_mem'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 203 | - qt_placa_video_cores = '" . DeCrypt($key,$iv,$_POST['qt_placa_video_cores'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 204 | - te_placa_video_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_video_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 205 | - te_placa_video_resolucao = '" . DeCrypt($key,$iv,$_POST['te_placa_video_resolucao'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 206 | - te_placa_som_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_som_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 207 | - te_teclado_desc = '" . DeCrypt($key,$iv,$_POST['te_teclado_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 208 | - te_mouse_desc = '" . DeCrypt($key,$iv,$_POST['te_mouse_desc'] ,$v_cs_cipher,$v_cs_compress) . "', | |
| 209 | - te_modem_desc = '" . DeCrypt($key,$iv,$_POST['te_modem_desc'] ,$v_cs_cipher,$v_cs_compress) . "' | |
| 195 | + SET te_mem_ram_desc = '" . DeCrypt($key,$iv,$_POST['te_mem_ram_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 196 | + qt_mem_ram = '" . DeCrypt($key,$iv,$_POST['qt_mem_ram'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 197 | + te_bios_desc = '" . DeCrypt($key,$iv,$_POST['te_bios_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 198 | + te_bios_data = '" . DeCrypt($key,$iv,$_POST['te_bios_data'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 199 | + te_bios_fabricante = '" . DeCrypt($key,$iv,$_POST['te_bios_fabricante'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 200 | + te_placa_mae_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_mae_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 201 | + te_placa_mae_fabricante = '" . DeCrypt($key,$iv,$_POST['te_placa_mae_fabricante'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 202 | + qt_placa_video_mem = '" . DeCrypt($key,$iv,$_POST['qt_placa_video_mem'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 203 | + qt_placa_video_cores = '" . DeCrypt($key,$iv,$_POST['qt_placa_video_cores'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 204 | + te_placa_video_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_video_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 205 | + te_placa_video_resolucao = '" . DeCrypt($key,$iv,$_POST['te_placa_video_resolucao'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 206 | + te_placa_som_desc = '" . DeCrypt($key,$iv,$_POST['te_placa_som_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 207 | + te_teclado_desc = '" . DeCrypt($key,$iv,$_POST['te_teclado_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 208 | + te_mouse_desc = '" . DeCrypt($key,$iv,$_POST['te_mouse_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "', | |
| 209 | + te_modem_desc = '" . DeCrypt($key,$iv,$_POST['te_modem_desc'] ,$v_cs_cipher,$v_cs_compress, $strPaddingKey) . "' | |
| 210 | 210 | WHERE te_node_address = '" . $te_node_address . "' and id_so = '" . $arrSO['id_so'] . "'"; |
| 211 | +//GravaTESTES('Query: '.$query); | |
| 211 | 212 | $result = mysql_query($query); |
| 212 | 213 | |
| 213 | 214 | echo '<?xml version="1.0" encoding="iso-8859-1" ?><STATUS>OK</STATUS>'; | ... | ... |