Commit 62133d7d8d3e49e7474cb109ed56a8b4fead2eff
1 parent
1fdb6adc
Exists in
master
and in
1 other branch
Correcoes logicas diversas e adequacoes aos blocos de internacionalizacao
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@495 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
7 changed files
with
129 additions
and
52 deletions
Show diff stats
admin/patrimonio/nivel1/index.php
| ... | ... | @@ -76,6 +76,10 @@ $titulo = $oTranslator->_('Cadastro de').' '. $_SESSION['plural_etiqueta1']; |
| 76 | 76 | <tr> |
| 77 | 77 | <td class="descricao"><?=$oTranslator->_('Modulo para cadastramento de Unidades Organizacionais de Nivel 1');?></td> |
| 78 | 78 | </tr> |
| 79 | + <tr> | |
| 80 | + <td class="destaque_laranja"><u>Importante:</u> A inclusão de <? echo $_SESSION['plural_etiqueta1'];?> é restrita ao nível "Administração".</td> | |
| 81 | + </tr> | |
| 82 | + | |
| 79 | 83 | </table> |
| 80 | 84 | <br><table width="292" border="0" align="center" cellpadding="0" cellspacing="1"> |
| 81 | 85 | <tr> | ... | ... |
admin/redes/incluir_rede.php
| ... | ... | @@ -208,7 +208,7 @@ function SetaServidorUpdates() |
| 208 | 208 | |
| 209 | 209 | function valida_form(frmForm) |
| 210 | 210 | { |
| 211 | - //VerRedeMascara(frmForm.name,true,false); | |
| 211 | + VerRedeMascara(frmForm.name,true,false); | |
| 212 | 212 | if ( document.form.frm_nu_limite_ftp.value == "" ) |
| 213 | 213 | { |
| 214 | 214 | document.form.frm_nu_limite_ftp.value = "30"; |
| ... | ... | @@ -220,7 +220,7 @@ function valida_form(frmForm) |
| 220 | 220 | return false; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - | |
| 223 | + /* | |
| 224 | 224 | var ip = document.form.frm_id_ip_rede.value; |
| 225 | 225 | var ipSplit = ip.split(/\./); |
| 226 | 226 | |
| ... | ... | @@ -236,7 +236,7 @@ function valida_form(frmForm) |
| 236 | 236 | document.form.frm_te_mascara_rede.focus(); |
| 237 | 237 | return false; |
| 238 | 238 | } |
| 239 | - | |
| 239 | + */ | |
| 240 | 240 | if ( document.form.frm_nm_rede.value == "" ) |
| 241 | 241 | { |
| 242 | 242 | alert("O nome da rede é obrigatório. Por favor, informe-o."); |
| ... | ... | @@ -261,6 +261,12 @@ function valida_form(frmForm) |
| 261 | 261 | document.form.frm_nu_porta_serv_updates.focus(); |
| 262 | 262 | return false; |
| 263 | 263 | } |
| 264 | + else if ( document.form.frm_te_path_serv_updates.value == "" ) | |
| 265 | + { | |
| 266 | + alert("Digite o Path no Servidor de Updates"); | |
| 267 | + document.form.frm_te_path_serv_updates.focus(); | |
| 268 | + return false; | |
| 269 | + } | |
| 264 | 270 | else if ( document.form.frm_nm_usuario_login_serv_updates.value == "" ) |
| 265 | 271 | { |
| 266 | 272 | alert("Digite o Nome do Usuário para Login no Servidor de Updates pelo Módulo Agente"); |
| ... | ... | @@ -285,12 +291,7 @@ function valida_form(frmForm) |
| 285 | 291 | document.form.frm_te_senha_login_serv_updates_gerente.focus(); |
| 286 | 292 | return false; |
| 287 | 293 | } |
| 288 | - else if ( document.form.frm_te_path_serv_updates.value == "" ) | |
| 289 | - { | |
| 290 | - alert("Digite o Path no Servidor de Updates"); | |
| 291 | - document.form.frm_te_path_serv_updates.focus(); | |
| 292 | - return false; | |
| 293 | - } | |
| 294 | + | |
| 294 | 295 | return true; |
| 295 | 296 | } |
| 296 | 297 | </script> | ... | ... |
admin/sistemas_operacionais/detalhes_sistema_operacional.php
| ... | ... | @@ -121,7 +121,7 @@ function valida_form() |
| 121 | 121 | <tr> |
| 122 | 122 | <td><input name="frm_te_desc_so" type="text" class="normal" id="frm_te_desc_so" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" size="50" maxlength="50" value="<? echo $row['te_desc_so'];?>" > |
| 123 | 123 | </td> |
| 124 | - <td><input name="frm_sg_so" type="text" id="frm_sg_so" size="10" maxlength="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $row['sg_so'];?>" ></td> | |
| 124 | + <td><input name="frm_sg_so" type="text" id="frm_sg_so" size="20" maxlength="20" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" value="<? echo $row['sg_so'];?>" ></td> | |
| 125 | 125 | </tr> |
| 126 | 126 | <tr> |
| 127 | 127 | <td class="label"> </td> | ... | ... |
admin/sistemas_operacionais/incluir_sistema_operacional.php
| ... | ... | @@ -133,7 +133,7 @@ MM_reloadPage(true); |
| 133 | 133 | <tr> |
| 134 | 134 | <td><input name="frm_te_desc_so" type="text" size="50" maxlength="50" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" > |
| 135 | 135 | </td> |
| 136 | - <td><input name="frm_sg_so" type="text" id="frm_sg_so" size="10" maxlength="10" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" ></td> | |
| 136 | + <td><input name="frm_sg_so" type="text" id="frm_sg_so" size="20" maxlength="20" class="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" ></td> | |
| 137 | 137 | </tr> |
| 138 | 138 | <tr> |
| 139 | 139 | <td class="label"> </td> | ... | ... |
admin/updates_subredes/index.php
| ... | ... | @@ -64,7 +64,7 @@ if ($_POST['ExecutaUpdates']=='Executar Updates') |
| 64 | 64 | $v_agentes_versoes = '_-_'.$v; |
| 65 | 65 | |
| 66 | 66 | if ($v && substr($i,0,13)=='agentes_hashs') |
| 67 | - $v_agentes_hashs = '_-_'.$v; | |
| 67 | + $v_agentes_hashs = '_-_'.$v; | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | //echo 'v_updates: '.$v_updates.'<br><br>'; |
| ... | ... | @@ -73,11 +73,13 @@ if ($_POST['ExecutaUpdates']=='Executar Updates') |
| 73 | 73 | |
| 74 | 74 | // O tratamento de v_force_modulos foi transferido para updates_subredes.php |
| 75 | 75 | |
| 76 | + $v_parametros = urlencode($v_updates.'_-_'.$v_redes.'_-_'.$v_force_modulos.$v_agentes_versoes.$v_agentes_hashs); | |
| 77 | + | |
| 76 | 78 | // O script updates_subredes.php espera receber o parâmetro v_parametros contendo uma string com a seguinte formação: |
| 77 | 79 | // objeto1__objeto2__objetoN_-_rede1__rede2__rede3__redeN |
| 78 | 80 | // Onde: __ = Separador de itens |
| 79 | 81 | // _-_ = Separador de Matrizes |
| 80 | - header ("Location: updates_subredes.php?v_parametros=".$v_updates.'_-_'.$v_redes.'_-_'.$v_force_modulos.$v_agentes_versoes.$v_agentes_hashs); | |
| 82 | + header ("Location: updates_subredes.php?v_parametros=".$v_parametros); | |
| 81 | 83 | } |
| 82 | 84 | else |
| 83 | 85 | { |
| ... | ... | @@ -104,23 +106,25 @@ function verificar() |
| 104 | 106 | var boolModulos = false; |
| 105 | 107 | var boolRedes = false; |
| 106 | 108 | var strFraseErro = ''; |
| 107 | - var intInicioModulos = 0; | |
| 108 | - var intInicioRedes = 0; | |
| 109 | 109 | |
| 110 | 110 | for (j=0;j<formRedes.elements.length;j++) |
| 111 | 111 | if (formRedes.elements[j].type == 'checkbox' && (formRedes.elements[j].name).substring(0,16) == 'update_subredes_') |
| 112 | 112 | { |
| 113 | - intInicioModulos = (intInicioModulos == 0?j:intInicioModulos); | |
| 114 | 113 | if (formRedes[j].checked && formRedes.elements[j].value != 'versoes_agentes.ini') |
| 114 | + { | |
| 115 | 115 | boolModulos = true; |
| 116 | + j = formRedes.elements.length; | |
| 117 | + } | |
| 116 | 118 | } |
| 117 | 119 | |
| 118 | 120 | for (j=0;j<formRedes.elements.length;j++) |
| 119 | 121 | if (formRedes.elements[j].type == 'checkbox' && formRedes.elements[j].id == 'redes') |
| 120 | 122 | { |
| 121 | - intInicioRedes = (intInicioRedes == 0?j:intInicioRedes); | |
| 122 | 123 | if (formRedes[j].checked) |
| 124 | + { | |
| 123 | 125 | boolRedes = true; |
| 126 | + j = formRedes.elements.length; | |
| 127 | + } | |
| 124 | 128 | } |
| 125 | 129 | |
| 126 | 130 | if (boolModulos && boolRedes) |
| ... | ... | @@ -184,6 +188,24 @@ function verificar() |
| 184 | 188 | return true; |
| 185 | 189 | } |
| 186 | 190 | |
| 191 | + function MarcaDesmarcaTodaLegenda(strCor) | |
| 192 | + { | |
| 193 | + var Formulario = window.document.forms[0]; | |
| 194 | + var arrRede; | |
| 195 | + for (i = 0; i < Formulario.length; i++) | |
| 196 | + if (Formulario[i].type == 'checkbox' && (Formulario[i].name).substring(0,6) == 'redes_') | |
| 197 | + { | |
| 198 | + arrRede = (Formulario[i].name).split('_'); | |
| 199 | + if (strCor == arrRede[3]) | |
| 200 | + if (Formulario[i].checked) | |
| 201 | + Formulario[i].checked = false; | |
| 202 | + else | |
| 203 | + Formulario[i].checked = true; | |
| 204 | + } | |
| 205 | + | |
| 206 | + return true; | |
| 207 | + } | |
| 208 | + | |
| 187 | 209 | </script> |
| 188 | 210 | |
| 189 | 211 | <div align="center"> |
| ... | ... | @@ -251,9 +273,7 @@ function verificar() |
| 251 | 273 | } |
| 252 | 274 | |
| 253 | 275 | if (file_exists('../../repositorio/versoes_agentes.ini')) |
| 254 | - { | |
| 255 | 276 | $v_array_versoes_agentes = parse_ini_file('../../repositorio/versoes_agentes.ini'); |
| 256 | - } | |
| 257 | 277 | |
| 258 | 278 | sort($v_nomes_arquivos,SORT_STRING); |
| 259 | 279 | $v_agentes_versoes = ''; // Conterá as versões dos agentes para tratamento em updates_subredes.php |
| ... | ... | @@ -382,18 +402,23 @@ function verificar() |
| 382 | 402 | <td height="10" colspan="2" nowrap><div align="center"><strong>Legenda para as SubRedes</strong></div></td> |
| 383 | 403 | </tr> |
| 384 | 404 | <tr> |
| 385 | - <td height="10" nowrap bordercolor="#000000" class="td_amarelo"><div align="center">Amarelo</div></td> | |
| 405 | + <td height="10" nowrap bordercolor="#000000" class="td_amarelo"><a style="cursor: pointer"><div align="center" onClick="MarcaDesmarcaTodaLegenda('amarelo');" title="Clique para Marcar/Desmarcar as Redes Nesta Situação" >Amarelo</div></a></td> | |
| 406 | + | |
| 386 | 407 | <td align="left" valign="middle" nowrap class="dado_peq_sem_fundo">Existência de <b>MÓDULO COM VERSÃO DIFERENTE</b></td> |
| 387 | 408 | </tr> |
| 388 | 409 | <tr> |
| 389 | - <td height="10" nowrap bordercolor="#000000" class="td_laranja"><div align="center">Laranja</div></td> | |
| 410 | + <td height="10" nowrap bordercolor="#000000" class="td_laranja"><a style="cursor: pointer"><div align="center" onClick="MarcaDesmarcaTodaLegenda('laranja');" title="Clique para Marcar/Desmarcar as Redes Nesta Situação">Laranja</td> | |
| 390 | 411 | <td align="left" valign="middle" nowrap class="dado_peq_sem_fundo"><span class="opcao_tabela"><b>INEXISTÊNCIA PARCIAL</b> de Módulos</span></td> |
| 391 | 412 | </tr> |
| 392 | - <tr> | |
| 393 | - <td height="10" nowrap bordercolor="#000000" class="td_vermelho"><div align="center">Vermelho</div></td> | |
| 413 | + <tr> | |
| 414 | + <td height="10" nowrap bordercolor="#000000" class="td_vermelho"><a style="cursor: pointer"><div align="center" onClick="MarcaDesmarcaTodaLegenda('vermelho');" title="Clique para Marcar/Desmarcar as Redes Nesta Situação">Vermelho</td> | |
| 394 | 415 | <td align="left" valign="middle" nowrap class="dado_peq_sem_fundo"><span class="opcao_tabela"><b>INEXISTÊNCIA TOTAL</b> de Módulos</span></td> |
| 395 | 416 | </tr> |
| 396 | - </table></td> | |
| 417 | + </table> | |
| 418 | + <div align="center"> | |
| 419 | + <p>Obs.: Clique nas Cores da Legenda para Marcar/Desmarcar Subredes em Bloco </p> | |
| 420 | + <p> </p> | |
| 421 | + </div></td> | |
| 397 | 422 | </tr> |
| 398 | 423 | |
| 399 | 424 | |
| ... | ... | @@ -438,7 +463,8 @@ function verificar() |
| 438 | 463 | // ******************** |
| 439 | 464 | $queryALERTA = " SELECT re.id_ip_rede, |
| 440 | 465 | rvm.nm_modulo, |
| 441 | - rvm.te_versao_modulo | |
| 466 | + rvm.te_versao_modulo, | |
| 467 | + rvm.cs_tipo_so | |
| 442 | 468 | FROM redes re, |
| 443 | 469 | redes_versoes_modulos rvm, |
| 444 | 470 | locais loc |
| ... | ... | @@ -454,20 +480,35 @@ function verificar() |
| 454 | 480 | $intFrequenciaRede = 0; // Acumulará a frequência de cada rede e deverá ser igual ao tamanho de versoes_agentes! |
| 455 | 481 | $strRedeAtual = ''; |
| 456 | 482 | |
| 483 | + $intTotalAgentes = 0; // Contarei no arquivo versoes_agentes.ini os nomes com a string "_HASH" | |
| 484 | + | |
| 485 | + $lines = file ('../../repositorio/versoes_agentes.ini'); | |
| 486 | + | |
| 487 | + // Percorre o array, mostrando o fonte HTML com numeração de linhas. | |
| 488 | + foreach ($lines as $line_num => $line) | |
| 489 | + { | |
| 490 | + $boolHASH = stripos2($line,'_HASH',false); | |
| 491 | + $intTotalAgentes += ($boolHASH?1:0); | |
| 492 | + } | |
| 493 | + | |
| 457 | 494 | while ($rowALERTA = mysql_fetch_array($resultALERTA)) |
| 458 | 495 | { |
| 459 | - if ($rowALERTA['nm_modulo'] <> 'chkcacic.exe' && | |
| 460 | - $rowALERTA['nm_modulo'] <> 'chkcacic.ini' && | |
| 461 | - $rowALERTA['nm_modulo'] <> 'versoes_agentes.ini' && | |
| 462 | - $rowALERTA['nm_modulo'] <> 'vaca.exe' && | |
| 463 | - $rowALERTA['nm_modulo'] <> 'install' && | |
| 464 | - $rowALERTA['nm_modulo'] <> '' && | |
| 465 | - isset($v_array_versoes_agentes) && $versao_agente = $v_array_versoes_agentes[$rowALERTA['nm_modulo']]) | |
| 496 | + $boolAgenteLinux = stripos2($rowALERTA['nm_modulo'],'PyCACIC',false); | |
| 497 | + $str_nm_modulo = ($boolAgenteLinux?'PyCACIC':$rowALERTA['nm_modulo']); | |
| 498 | + | |
| 499 | + if ($str_nm_modulo <> 'chkcacic.exe' && | |
| 500 | + $str_nm_modulo <> 'chkcacic.ini' && | |
| 501 | + $str_nm_modulo <> 'versoes_agentes.ini' && | |
| 502 | + $str_nm_modulo <> 'vaca.exe' && | |
| 503 | + $str_nm_modulo <> 'install' && | |
| 504 | + $str_nm_modulo <> 'agentes_linux' && | |
| 505 | + $str_nm_modulo <> '' && | |
| 506 | + isset($v_array_versoes_agentes) && $versao_agente = $v_array_versoes_agentes[$str_nm_modulo]) | |
| 466 | 507 | { |
| 467 | 508 | |
| 468 | 509 | if ($strRedeAtual <> '' && $strRedeAtual <> $rowALERTA['id_ip_rede']) |
| 469 | 510 | { |
| 470 | - if ($intFrequenciaRede <> count($v_array_versoes_agentes)) | |
| 511 | + if ($intFrequenciaRede <> $intTotalAgentes) | |
| 471 | 512 | $strTripaLaranja .= $strRedeAtual . '#'; |
| 472 | 513 | |
| 473 | 514 | $intFrequenciaRede = 1; |
| ... | ... | @@ -477,9 +518,14 @@ function verificar() |
| 477 | 518 | |
| 478 | 519 | $strRedeAtual = $rowALERTA['id_ip_rede']; |
| 479 | 520 | |
| 480 | - $versao_agente = str_replace('.','',$versao_agente) . '0103'; | |
| 521 | + if ($rowALERTA['cs_tipo_so'] <> 'GNU/LINUX') | |
| 522 | + $versao_agente = str_replace('.','',$versao_agente) . '0103'; | |
| 523 | + else | |
| 524 | + $versao_agente = str_replace('.','',$versao_agente); | |
| 525 | + | |
| 481 | 526 | if ($versao_agente <> $rowALERTA['te_versao_modulo']) |
| 482 | 527 | { |
| 528 | + | |
| 483 | 529 | $strPesquisaRede = '#'.$strRedeAtual.'#'; |
| 484 | 530 | $intPos = stripos2($strTripaAmarelo,$strPesquisaRede); |
| 485 | 531 | if ($intPos === false) |
| ... | ... | @@ -540,7 +586,7 @@ function verificar() |
| 540 | 586 | ?> |
| 541 | 587 | <tr> |
| 542 | 588 | <td class="<? echo $strClasseTD;?>" align="right"><? echo $intSequencial;?></td> |
| 543 | - <td class="<? echo $strClasseTD;?>"><input name="redes_<? echo $row['id_ip_rede'].'_'.$row['id_local'];?>" id="redes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="<? echo $row['id_ip_rede'];?>" <? echo $strCheck;?>></td> | |
| 589 | + <td class="<? echo $strClasseTD;?>"><input name="redes_<? echo $row['id_ip_rede'].'_'.$row['id_local'].'_'.str_replace('td_','',$strClasseTD);?>" id="redes" type="checkbox" class="normal" onBlur="SetaClassNormal(this);" value="<? echo $row['id_ip_rede'];?>" <? echo $strCheck;?>></td> | |
| 544 | 590 | <td class="<? echo $strClasseTD;?>"><? echo $row['id_ip_rede'];?></td> |
| 545 | 591 | <td class="<? echo $strClasseTD;?>"><? echo $row['nm_rede'];?></td> |
| 546 | 592 | <td class="<? echo $strClasseTD;?>"><? echo $row['te_serv_updates'];?></td> | ... | ... |
admin/updates_subredes/updates_subredes.php
| ... | ... | @@ -73,13 +73,21 @@ AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| 73 | 73 | </tr> |
| 74 | 74 | |
| 75 | 75 | <? |
| 76 | - $v_array_parametros = explode('_-_',$_REQUEST['v_parametros']); | |
| 76 | + $v_array_parametros = explode('_-_',url_decode($_REQUEST['v_parametros'])); | |
| 77 | 77 | |
| 78 | 78 | $v_array_redes = explode('__',str_replace('_fr_',"'",$v_array_parametros[1])); |
| 79 | + $v_array_hashs = explode('#',$v_array_parametros[4]); | |
| 79 | 80 | |
| 80 | - | |
| 81 | - echo '_REQUEST[v_parametros] = '.$_REQUEST['v_parametros'].'<br>'; | |
| 82 | - echo 'v_array_parametros[1] = '.$v_array_parametros[1].'<br>'; | |
| 81 | + $v_tripa_agentes_hashs = ''; | |
| 82 | + for ($i=0;$i<count($v_array_hashs);$i++) | |
| 83 | + { | |
| 84 | + $arrTmp = explode('*',$v_array_hashs[$i]); | |
| 85 | + $v_array_agentes_hashs[$arrTmp[0]] = $arrTmp[1]; | |
| 86 | + } | |
| 87 | + | |
| 88 | + //echo '_REQUEST[v_parametros] = '.url_decode($_REQUEST['v_parametros']).'<br>'; | |
| 89 | + //for ($i = 0;$i < count($v_array_parametros);$i++) | |
| 90 | + // echo 'v_array_parametros['.$i.'] = '.$v_array_parametros[$i].'<br>'; | |
| 83 | 91 | |
| 84 | 92 | if (count($v_array_redes)>0) |
| 85 | 93 | { |
| ... | ... | @@ -98,7 +106,7 @@ AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| 98 | 106 | FROM redes re, |
| 99 | 107 | locais lo |
| 100 | 108 | WHERE re.id_local = lo.id_local AND (" . $v_where . ") |
| 101 | - ORDER BY re.nm_rede"; | |
| 109 | + ORDER BY re.nm_rede"; | |
| 102 | 110 | conecta_bd_cacic(); |
| 103 | 111 | $result_REDES = mysql_query($query_REDES); |
| 104 | 112 | $_SESSION['v_tripa_objetos_enviados'] = ''; // Conterá a lista de agentes e versões enviadas aos servidores. |
| ... | ... | @@ -145,14 +153,32 @@ AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| 145 | 153 | $strTeServUpdatesToCheck = '#'.trim($row['te_serv_updates']).'#'; |
| 146 | 154 | if (@substr_count($_SESSION['v_tripa_servidores_updates'],$strTeServUpdatesToCheck)>0) |
| 147 | 155 | { |
| 148 | - $insert = "INSERT INTO redes_versoes_modulos (id_local,id_ip_rede,nm_modulo,te_versao_modulo,dt_atualizacao) "; | |
| 149 | - $values = ""; | |
| 150 | 156 | $v_arr_agentes_versoes_enviados = explode('#',$_SESSION['v_tripa_objetos_enviados']); |
| 151 | 157 | for ($intAgentesVersoesEnviados = 0;$intAgentesVersoesEnviados < count($v_arr_agentes_versoes_enviados);$intAgentesVersoesEnviados++) |
| 152 | 158 | { |
| 159 | + // Procuro por pacotes Linux previamente gravados na tabela de versões | |
| 160 | + $cs_tipo_so = (stripos2($v_arr_aux[0],'.exe',false)?'MS-Windows':'GNU/LINUX'); | |
| 161 | + $cs_tipo_so = (stripos2($v_arr_aux[0],'.ini',false)?'MS-Windows':$cs_tipo_so); | |
| 162 | + | |
| 163 | + if ($cs_tipo_so == 'GNU/LINUX') | |
| 164 | + $intAgentesVersoesEnviados < count($v_arr_agentes_versoes_enviados); | |
| 165 | + } | |
| 166 | + | |
| 167 | + if ($cs_tipo_so == 'GNU/LINUX') | |
| 168 | + { | |
| 169 | + // Excluo o pacote Linux previamente gravado na tabela | |
| 170 | + $delete = 'DELETE from redes_versoes_modulos WHERE id_local = '.$row['id_local'].' AND id_ip_rede = "'.trim($row['id_ip_rede']).'" AND cs_tipo_so="GNU/LINUX"'; | |
| 171 | + $result_DELETE = mysql_query($delete); | |
| 172 | + } | |
| 173 | + | |
| 174 | + $insert = "INSERT INTO redes_versoes_modulos (id_local,id_ip_rede,nm_modulo,te_versao_modulo,dt_atualizacao,cs_tipo_so,te_hash) "; | |
| 175 | + $values = ""; | |
| 176 | + for ($intAgentesVersoesEnviados = 0;$intAgentesVersoesEnviados < count($v_arr_agentes_versoes_enviados);$intAgentesVersoesEnviados++) | |
| 177 | + { | |
| 178 | + $cs_tipo_so = (stripos2('.exe',$v_arr_aux[0],false)?'MS-Windows':'GNU/LINUX'); | |
| 153 | 179 | $v_arr_aux = explode(',',$v_arr_agentes_versoes_enviados[$intAgentesVersoesEnviados]); |
| 154 | 180 | $values .= ($values?",":"VALUES "); |
| 155 | - $values .= '('.$row['id_local'].',"'.trim($row['id_ip_rede']).'","'.$v_arr_aux[0].'","'.$v_arr_aux[1].'",now())'; | |
| 181 | + $values .= '('.$row['id_local'].',"'.trim($row['id_ip_rede']).'","'.$v_arr_aux[0].'","'.$v_arr_aux[1].'",now(),"'.$cs_tipo_so.'","'.$v_array_agentes_hashs[$v_arr_aux[0]].'")'; | |
| 156 | 182 | } |
| 157 | 183 | |
| 158 | 184 | $result_INSERT = mysql_query($insert . $values); |
| ... | ... | @@ -161,7 +187,7 @@ AntiSpy('1,2,3'); // Permitido somente a estes cs_nivel_administracao... |
| 161 | 187 | } |
| 162 | 188 | else |
| 163 | 189 | { |
| 164 | - update_subredes($row['id_ip_rede'],'Pagina','__'.$v_array_parametros[0],$row['id_local']); | |
| 190 | + update_subredes($row['id_ip_rede'],'Pagina','__'.$v_array_parametros[0],$row['id_local'],$v_array_agentes_hashs); | |
| 165 | 191 | flush(); |
| 166 | 192 | if ($_SESSION['v_efetua_conexao_ftp'] == 1) |
| 167 | 193 | { | ... | ... |
admin/usuarios/detalhes_usuario.php
| ... | ... | @@ -47,14 +47,14 @@ elseif ($_POST['GravaAlteracoes']) |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $query = "UPDATE usuarios |
| 50 | - SET nm_usuario_acesso = '$frm_nm_usuario_acesso', | |
| 51 | - nm_usuario_completo = '$frm_nm_usuario_completo', | |
| 52 | - id_grupo_usuarios = '$frm_id_grupo_usuarios', | |
| 53 | - id_local = $frm_id_local, | |
| 54 | - te_emails_contato = '$frm_te_emails_contato', | |
| 55 | - te_telefones_contato = '$frm_te_telefones_contato', | |
| 56 | - te_locais_secundarios = '$v_te_locais_secundarios' | |
| 57 | - WHERE id_usuario = ". $_POST['frm_id_usuario']; | |
| 50 | + SET nm_usuario_acesso = '".$_POST['frm_nm_usuario_acesso'] ."', | |
| 51 | + nm_usuario_completo = '".$_POST['frm_nm_usuario_completo'] ."', | |
| 52 | + id_grupo_usuarios = '".$_POST['frm_id_grupo_usuarios'] ."', | |
| 53 | + id_local = ".$_POST['frm_id_local'] .", | |
| 54 | + te_emails_contato = '".$_POST['frm_te_emails_contato'] ."', | |
| 55 | + te_telefones_contato = '".$_POST['frm_te_telefones_contato'] ."', | |
| 56 | + te_locais_secundarios = '".$v_te_locais_secundarios ."' | |
| 57 | + WHERE id_usuario = ". $_POST['frm_id_usuario']; | |
| 58 | 58 | |
| 59 | 59 | mysql_query($query) or die($oTranslator->_('Ocorreu um erro durante a atualizacao da tabela %1 ou sua sessao expirou', array('usuarios'))); |
| 60 | 60 | ... | ... |