Changeset 438
- Timestamp:
- 05/13/08 16:14:15
- Arquivos:
-
- cacic/trunk/gerente/admin/redes/detalhes_rede.php (modified) (6 diffs)
- cacic/trunk/gerente/admin/redes/incluir_rede.php (modified) (6 diffs)
- cacic/trunk/gerente/admin/updates_subredes/index.php (modified) (11 diffs)
- cacic/trunk/gerente/admin/updates_subredes/updates_subredes.php (modified) (2 diffs)
- cacic/trunk/gerente/include/cacic.js (modified) (4 diffs)
- cacic/trunk/gerente/include/library.php (modified) (26 diffs)
- cacic/trunk/gerente/relatorios/antivirus/index.php (modified) (4 diffs)
- cacic/trunk/gerente/relatorios/antivirus/rel_antivirus.php (modified) (6 diffs)
- cacic/trunk/gerente/relatorios/patrimonio/index.php (modified) (3 diffs)
- cacic/trunk/gerente/ws/get_config.php (modified) (10 diffs)
- cacic/trunk/gerente/ws/set_hardware.php (modified) (1 diff)
Legenda:
- Não modificado
- Adicionado
- Removido
- Modificado
- Copiado
- Movido
cacic/trunk/gerente/admin/redes/detalhes_rede.php
r371 r438 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 … … 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> … … 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> … … 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> … … 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> … … 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> cacic/trunk/gerente/admin/redes/incluir_rede.php
r400 r438 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 … … 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 { … … 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 } … … 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> … … 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 Ver ificaRedeMascara(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> … … 645 634 <tr> 646 635 <td> </td> 647 <td> <input name="in_habilita_acoes" type="radio" value="S" c lass="normal" onFocus="SetaClassDigitacao(this);" onBlur="SetaClassNormal(this);" >648 Sim<br> <input type="radio" name="in_habilita_acoes" value="N" c hecked 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> cacic/trunk/gerente/admin/updates_subredes/index.php
r371 r438 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 … … 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 { … … 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 … … 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 … … 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(); … … 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> … … 222 215 <tr> 223 216 <td nowrap colspan="2"><table border="1" align="center" cellpadding="2" bordercolor="#999999"> 217 <tr bgcolor="#FFFFCC"> 218 <td colspan="8" class="cabecalho_tabela" align="center"><b>Agentes para MS-Windows</b></td> 219 </tr> 220 224 221 <tr bgcolor="#FFFFCC"> 225 222 <td bgcolor="#EBEBEB" align="center"><img src="../../imgs/checked.gif" border="no"></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 { … … 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 … … 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>'; … … 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>'; 285 } 286 echo '<input name="agentes_versoes" id="agentes_versoes" type="hidden" value="'.$v_agentes_versoes.'">'; 287 295 echo '>'; 296 echo '</td></tr>'; 297 } 288 298 } 289 ?> 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; 346 } 347 348 } 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> cacic/trunk/gerente/admin/updates_subredes/updates_subredes.php
r371 r438 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'); … … 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) cacic/trunk/gerente/include/cacic.js
r371 r438 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 { … … 117 117 return Result; 118 118 } 119 120 function VerificaRedeMascara(frmForm) 121 { 119 function VerRedeMascara(strFormName,boolPreencheIPs,boolConfirma) 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('.'); … … 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 } 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; 164 185 } 165 186 … … 243 264 return 0; 244 265 } 266 cacic/trunk/gerente/include/library.php
r409 r438 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 … … 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 … … 226 212 } 227 213 } 228 229 /**230 * Menu a ser apresentado ao usuario conforme o idioma selecionado231 *232 * @param string $_menu_name Nome do menu a ser pesquisado233 * @return string Caminho do menu234 */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... … … 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 // ------------------------------------------------ … … 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 <> '') … … 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 } … … 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']); … … 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') || … … 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); … … 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); … … 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 } … … 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); … … 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 … … 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 … … 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); … … 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 … … 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 … … 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); … … 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, … … 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); … … 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 '; … … 1078 1055 "'.$p_nm_modulo.'", 1079 1056 "'.$p_te_versao_modulo.'",'. 1080 'now())'; 1057 'now(), 1058 "'.$arrCsTipoSO[1].'")'; 1081 1059 $virgula = ','; 1082 1060 } … … 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); … …
