Commit 58dcc587e49a698422ff87dc9de4b40d54181067
1 parent
c52c6d6f
Exists in
master
Ajuste na funcao de Decriptografia para aplicacao de TRIM no retorno; Ajuste no …
…menu de contexto, que habilitara a opcao de Suporte Remoto apenas se o modulo estiver disponivel. Correcoes no MapaCACIC. Melhorias no ChkCACIC. Faxina de codigo. git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@778 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
10 changed files
with
182 additions
and
182 deletions
Show diff stats
CACIC_Library.pas
@@ -845,7 +845,7 @@ begin | @@ -845,7 +845,7 @@ begin | ||
845 | FillChar(l_Key[1],Length(l_Key),0); | 845 | FillChar(l_Key[1],Length(l_Key),0); |
846 | 846 | ||
847 | // Return the result (unCrypted) | 847 | // Return the result (unCrypted) |
848 | - Result := l_Data | 848 | + Result := trim(l_Data); |
849 | End | 849 | End |
850 | Else | 850 | Else |
851 | // Return the original value | 851 | // Return the original value |
cacic2.res
No preview for this file type
chkcacic/chkcacic.res
No preview for this file type
chkcacic/main.pas
@@ -1624,6 +1624,7 @@ begin | @@ -1624,6 +1624,7 @@ begin | ||
1624 | LogDebug('Abrindo Arquivo de Configurações do ChkSis'); | 1624 | LogDebug('Abrindo Arquivo de Configurações do ChkSis'); |
1625 | CipherOpen(g_oCacic.getWinDir + 'chksis.dat'); | 1625 | CipherOpen(g_oCacic.getWinDir + 'chksis.dat'); |
1626 | SetValorDatMemoria('Cacic2.ip_serv_cacic', v_ip_serv_cacic); | 1626 | SetValorDatMemoria('Cacic2.ip_serv_cacic', v_ip_serv_cacic); |
1627 | + SetValorDatMemoria('Cacic2.cacic_dir' , g_oCacic.getCacicPath); | ||
1627 | CipherClose(g_oCacic.getWinDir + 'chksis.dat'); | 1628 | CipherClose(g_oCacic.getWinDir + 'chksis.dat'); |
1628 | 1629 | ||
1629 | // Volto a gravar o chksis.ini para o difícil caso de leitura por versões antigas | 1630 | // Volto a gravar o chksis.ini para o difícil caso de leitura por versões antigas |
ger_cols/ger_cols.dpr
@@ -3268,7 +3268,6 @@ begin | @@ -3268,7 +3268,6 @@ begin | ||
3268 | if ParamCount > 0 then | 3268 | if ParamCount > 0 then |
3269 | Begin | 3269 | Begin |
3270 | strAux := ''; | 3270 | strAux := ''; |
3271 | - v_Debugs := true; | ||
3272 | 3271 | ||
3273 | For intAux := 1 to ParamCount do | 3272 | For intAux := 1 to ParamCount do |
3274 | Begin | 3273 | Begin |
@@ -3286,7 +3285,7 @@ begin | @@ -3286,7 +3285,7 @@ begin | ||
3286 | Try | 3285 | Try |
3287 | v_Debugs := false; | 3286 | v_Debugs := false; |
3288 | if DirectoryExists(g_oCacic.getCacicPath + 'Temp\Debugs') then | 3287 | if DirectoryExists(g_oCacic.getCacicPath + 'Temp\Debugs') then |
3289 | - if (FormatDateTime('ddmmyyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then | 3288 | + if (FormatDateTime('ddmmyyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then |
3290 | Begin | 3289 | Begin |
3291 | v_Debugs := true; | 3290 | v_Debugs := true; |
3292 | log_DEBUG('Pasta "' + g_oCacic.getCacicPath + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs'))+' encontrada. DEBUG ativado.'); | 3291 | log_DEBUG('Pasta "' + g_oCacic.getCacicPath + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs'))+' encontrada. DEBUG ativado.'); |
ger_cols/ger_cols.res
No preview for this file type
main.pas
@@ -969,7 +969,9 @@ procedure TFormularioGeral.HabilitaSuporteRemoto; | @@ -969,7 +969,9 @@ procedure TFormularioGeral.HabilitaSuporteRemoto; | ||
969 | Begin | 969 | Begin |
970 | // Desabilita/Habilita a opção de Suporte Remoto | 970 | // Desabilita/Habilita a opção de Suporte Remoto |
971 | Mnu_SuporteRemoto.Enabled := False; | 971 | Mnu_SuporteRemoto.Enabled := False; |
972 | - if (getValorDatMemoria('Configs.CS_SUPORTE_REMOTO',v_tstrCipherOpened) = 'S') then Mnu_SuporteRemoto.Enabled := True; | 972 | + if (getValorDatMemoria('Configs.CS_SUPORTE_REMOTO',v_tstrCipherOpened) = 'S') and |
973 | + (FileExists(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe')) then | ||
974 | + Mnu_SuporteRemoto.Enabled := True; | ||
973 | End; | 975 | End; |
974 | 976 | ||
975 | 977 | ||
@@ -2245,7 +2247,7 @@ begin | @@ -2245,7 +2247,7 @@ begin | ||
2245 | else | 2247 | else |
2246 | Begin | 2248 | Begin |
2247 | Mnu_SuporteRemoto.Caption := 'Ativar Suporte Remoto'; | 2249 | Mnu_SuporteRemoto.Caption := 'Ativar Suporte Remoto'; |
2248 | - Mnu_SuporteRemoto.Enabled := true; | 2250 | + HabilitaSuporteRemoto; |
2249 | End; | 2251 | End; |
2250 | 2252 | ||
2251 | end; | 2253 | end; |
mapa/acesso.pas
@@ -155,18 +155,9 @@ procedure TfrmAcesso.FormCreate(Sender: TObject); | @@ -155,18 +155,9 @@ procedure TfrmAcesso.FormCreate(Sender: TObject); | ||
155 | begin | 155 | begin |
156 | intPausaPadrao := 3000; //(3 mil milisegundos = 3 segundos) | 156 | intPausaPadrao := 3000; //(3 mil milisegundos = 3 segundos) |
157 | frmAcesso.lbVersao.Caption := 'Versão: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); | 157 | frmAcesso.lbVersao.Caption := 'Versão: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); |
158 | - frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getDatFileName); | 158 | +// frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); |
159 | frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); | 159 | frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); |
160 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; | 160 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; |
161 | - if (frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)='') then | ||
162 | - Begin | ||
163 | - frmMapaCacic.boolAcessoOK := false; | ||
164 | - MessageDLG(#13#10+'Atenção! É necessário executar as coletas do Sistema Cacic.' + #13#10 + #13#10 + | ||
165 | - 'Caso o Sistema Cacic já esteja instalado, clique com botão direito' + #13#10 + | ||
166 | - 'sobre o ícone da bandeja, escolha a opção "Executar Agora" e aguarde' + #13#10 + | ||
167 | - 'o fim do processo.',mtError,[mbOK],0); | ||
168 | - frmMapaCacic.Finalizar(false); | ||
169 | - End; | ||
170 | end; | 161 | end; |
171 | 162 | ||
172 | procedure TfrmAcesso.edNomeUsuarioAcessoKeyUp(Sender: TObject; | 163 | procedure TfrmAcesso.edNomeUsuarioAcessoKeyUp(Sender: TObject; |
mapa/main_mapa.pas
@@ -224,6 +224,7 @@ end; | @@ -224,6 +224,7 @@ end; | ||
224 | 224 | ||
225 | procedure TfrmMapaCacic.Mensagem(p_strMsg : String; p_boolAlerta : boolean; p_intPausaSegundos : integer); | 225 | procedure TfrmMapaCacic.Mensagem(p_strMsg : String; p_boolAlerta : boolean; p_intPausaSegundos : integer); |
226 | Begin | 226 | Begin |
227 | + log_DEBUG(p_strMsg); | ||
227 | if p_boolAlerta then | 228 | if p_boolAlerta then |
228 | lbMensagens.Font.Color := clRed | 229 | lbMensagens.Font.Color := clRed |
229 | else | 230 | else |
@@ -408,7 +409,7 @@ procedure TfrmMapaCacic.Finalizar(p_pausa:boolean); | @@ -408,7 +409,7 @@ procedure TfrmMapaCacic.Finalizar(p_pausa:boolean); | ||
408 | Begin | 409 | Begin |
409 | Mensagem('Finalizando MapaCacic...',false,0); | 410 | Mensagem('Finalizando MapaCacic...',false,0); |
410 | 411 | ||
411 | - CipherClose(g_oCacic.getDatFileName, tStringsCipherOpened); | 412 | + CipherClose(g_oCacic.getCacicPath + g_oCacic.getDatFileName, tStringsCipherOpened); |
412 | Apaga_Temps; | 413 | Apaga_Temps; |
413 | if p_pausa then sleep(2000); // Pausa de 2 segundos para conclusão de operações de arquivos. | 414 | if p_pausa then sleep(2000); // Pausa de 2 segundos para conclusão de operações de arquivos. |
414 | Sair; | 415 | Sair; |
@@ -644,9 +645,9 @@ begin | @@ -644,9 +645,9 @@ begin | ||
644 | Append(txtFileDatFile); | 645 | Append(txtFileDatFile); |
645 | 646 | ||
646 | strCipherOpenImploded := g_oCacic.implode(p_tstrCipherOpened,'=CacicIsFree='); | 647 | strCipherOpenImploded := g_oCacic.implode(p_tstrCipherOpened,'=CacicIsFree='); |
647 | - log_DEBUG('Rotina de Fechamento do cacic2.dat ATIVANDO criptografia.'); | 648 | + log_DEBUG('Rotina de Fechamento do arquivo DAT ATIVANDO criptografia.'); |
648 | strCipherClosed := g_oCacic.enCrypt(strCipherOpenImploded); | 649 | strCipherClosed := g_oCacic.enCrypt(strCipherOpenImploded); |
649 | - log_DEBUG('Rotina de Fechamento do cacic2.dat RESTAURANDO estado da criptografia.'); | 650 | + log_DEBUG('Rotina de Fechamento do arquivo DAT RESTAURANDO estado da criptografia.'); |
650 | 651 | ||
651 | Writeln(txtFileDatFile,strCipherClosed); {Grava a string Texto no arquivo texto} | 652 | Writeln(txtFileDatFile,strCipherClosed); {Grava a string Texto no arquivo texto} |
652 | 653 | ||
@@ -708,12 +709,11 @@ begin | @@ -708,12 +709,11 @@ begin | ||
708 | end; | 709 | end; |
709 | Function TfrmMapaCacic.GetValorDatMemoria(p_Chave : String; p_tstrCipherOpened : TStrings) : String; | 710 | Function TfrmMapaCacic.GetValorDatMemoria(p_Chave : String; p_tstrCipherOpened : TStrings) : String; |
710 | begin | 711 | begin |
711 | - | 712 | + log_DEBUG('Resgatando Chave: "'+p_Chave+ '" => "'+Result+'"'); |
712 | if (p_tstrCipherOpened.IndexOf(p_Chave)<>-1) then | 713 | if (p_tstrCipherOpened.IndexOf(p_Chave)<>-1) then |
713 | Result := trim(p_tstrCipherOpened[p_tstrCipherOpened.IndexOf(p_Chave)+1]) | 714 | Result := trim(p_tstrCipherOpened[p_tstrCipherOpened.IndexOf(p_Chave)+1]) |
714 | else | 715 | else |
715 | Result := ''; | 716 | Result := ''; |
716 | - log_DEBUG('Resgatando Chave: "'+p_Chave+ '" => "'+Result+'"'); | ||
717 | end; | 717 | end; |
718 | 718 | ||
719 | function TfrmMapaCacic.SetValorChaveRegEdit(Chave: String; Dado: Variant): Variant; | 719 | function TfrmMapaCacic.SetValorChaveRegEdit(Chave: String; Dado: Variant): Variant; |
@@ -911,6 +911,7 @@ begin | @@ -911,6 +911,7 @@ begin | ||
911 | Parser.StartScan; | 911 | Parser.StartScan; |
912 | strTagName := ''; | 912 | strTagName := ''; |
913 | strAux1 := ''; | 913 | strAux1 := ''; |
914 | + | ||
914 | i := -1; | 915 | i := -1; |
915 | While Parser.Scan DO | 916 | While Parser.Scan DO |
916 | Begin | 917 | Begin |
@@ -958,6 +959,7 @@ begin | @@ -958,6 +959,7 @@ begin | ||
958 | Parser.StartScan; | 959 | Parser.StartScan; |
959 | strTagName := ''; | 960 | strTagName := ''; |
960 | i := -1; | 961 | i := -1; |
962 | + | ||
961 | While Parser.Scan DO | 963 | While Parser.Scan DO |
962 | Begin | 964 | Begin |
963 | strItemName := UpperCase(Parser.CurName); | 965 | strItemName := UpperCase(Parser.CurName); |
@@ -996,6 +998,7 @@ begin | @@ -996,6 +998,7 @@ begin | ||
996 | End; | 998 | End; |
997 | end; | 999 | end; |
998 | Parser.Free; | 1000 | Parser.Free; |
1001 | + | ||
999 | // Como os itens do combo1 nunca mudam durante a execução do programa (ao contrario dos combo2 e 3), posso colocar o seu preenchimento aqui mesmo. | 1002 | // Como os itens do combo1 nunca mudam durante a execução do programa (ao contrario dos combo2 e 3), posso colocar o seu preenchimento aqui mesmo. |
1000 | cb_id_unid_organizacional_nivel1.Items.Clear; | 1003 | cb_id_unid_organizacional_nivel1.Items.Clear; |
1001 | For i := 0 to Length(VetorUON1) - 1 Do | 1004 | For i := 0 to Length(VetorUON1) - 1 Do |
@@ -1085,6 +1088,7 @@ begin | @@ -1085,6 +1088,7 @@ begin | ||
1085 | intAux := cb_id_unid_organizacional_nivel1a.ItemIndex; | 1088 | intAux := cb_id_unid_organizacional_nivel1a.ItemIndex; |
1086 | Log_debug('cb_id_unid_organizacional_nivel1a.ItemIndex = '+intToStr(cb_id_unid_organizacional_nivel1a.ItemIndex)); | 1089 | Log_debug('cb_id_unid_organizacional_nivel1a.ItemIndex = '+intToStr(cb_id_unid_organizacional_nivel1a.ItemIndex)); |
1087 | 1090 | ||
1091 | + Log_debug('VetorUON1aFiltrado['+intToStr(cb_id_unid_organizacional_nivel1a.ItemIndex)+'] => '+VetorUON1aFiltrado[cb_id_unid_organizacional_nivel1a.ItemIndex]); | ||
1088 | tstrAux := TStrings.Create; | 1092 | tstrAux := TStrings.Create; |
1089 | tstrAux := g_oCacic.explode(VetorUON1aFiltrado[cb_id_unid_organizacional_nivel1a.ItemIndex],'#'); | 1093 | tstrAux := g_oCacic.explode(VetorUON1aFiltrado[cb_id_unid_organizacional_nivel1a.ItemIndex],'#'); |
1090 | 1094 | ||
@@ -1140,82 +1144,76 @@ begin | @@ -1140,82 +1144,76 @@ begin | ||
1140 | 'Para o envio das informações, é necessário finalizar o Agente Principal do CACIC.',mtError,[mbOK],0) | 1144 | 'Para o envio das informações, é necessário finalizar o Agente Principal do CACIC.',mtError,[mbOK],0) |
1141 | else | 1145 | else |
1142 | Begin | 1146 | Begin |
1143 | - tstrAux := TStrings.Create; | ||
1144 | - tstrAux := g_oCacic.explode(VetorUON2Filtrado[cb_id_unid_organizacional_nivel2.ItemIndex],'#'); | ||
1145 | - Try | ||
1146 | - strIdUON1 := VetorUON1[cb_id_unid_organizacional_nivel1.ItemIndex].id1; | ||
1147 | - strIdUON2 := tstrAux[0]; | ||
1148 | - strIdLocal := tstrAux[1]; | ||
1149 | - Except | ||
1150 | - end; | ||
1151 | - | ||
1152 | - tstrAux := g_oCacic.explode(VetorUON1aFiltrado[cb_id_unid_organizacional_nivel1a.ItemIndex],'#'); | ||
1153 | - Try | ||
1154 | - strIdUON1a := tstrAux[0]; | ||
1155 | - Except | ||
1156 | - end; | ||
1157 | - | ||
1158 | - tstrAux.Free; | ||
1159 | - | ||
1160 | - Mensagem('Enviando Informações Coletadas ao Banco de Dados...',false,intPausaPadrao div 3); | ||
1161 | - | ||
1162 | - // Envio dos Dados Coletados ao Banco de Dados | ||
1163 | - tstrListAux := TStringList.Create; | ||
1164 | - tstrListAux.Values['te_node_address'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)); | ||
1165 | - tstrListAux.Values['id_so'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('Configs.ID_SO' , frmMapaCacic.tStringsCipherOpened)); | ||
1166 | - tstrListAux.Values['te_so'] := g_oCacic.enCrypt(g_oCacic.getWindowsStrId()); | ||
1167 | - tstrListAux.Values['id_ip_rede'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.ID_IP_REDE' , frmMapaCacic.tStringsCipherOpened)); | ||
1168 | - tstrListAux.Values['te_ip'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_IP' , frmMapaCacic.tStringsCipherOpened)); | ||
1169 | - tstrListAux.Values['te_nome_computador'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR' , frmMapaCacic.tStringsCipherOpened)); | ||
1170 | - tstrListAux.Values['te_workgroup'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); | ||
1171 | - tstrListAux.Values['id_usuario'] := g_oCacic.enCrypt(frmMapaCacic.strId_usuario); | ||
1172 | - | ||
1173 | - tstrListAux.Values['id_unid_organizacional_nivel1'] := g_oCacic.enCrypt(strIdUON1); | ||
1174 | - tstrListAux.Values['id_unid_organizacional_nivel1a']:= g_oCacic.enCrypt(strIdUON1A); | ||
1175 | - tstrListAux.Values['id_unid_organizacional_nivel2'] := g_oCacic.enCrypt(strIdUON2); | ||
1176 | - tstrListAux.Values['te_localizacao_complementar' ] := g_oCacic.enCrypt(ed_te_localizacao_complementar.Text); | ||
1177 | - tstrListAux.Values['te_info_patrimonio1' ] := g_oCacic.enCrypt(ed_te_info_patrimonio1.Text); | ||
1178 | - tstrListAux.Values['te_info_patrimonio2' ] := g_oCacic.enCrypt(ed_te_info_patrimonio2.Text); | ||
1179 | - tstrListAux.Values['te_info_patrimonio3' ] := g_oCacic.enCrypt(ed_te_info_patrimonio3.Text); | ||
1180 | - tstrListAux.Values['te_info_patrimonio4' ] := g_oCacic.enCrypt(ed_te_info_patrimonio4.Text); | ||
1181 | - tstrListAux.Values['te_info_patrimonio5' ] := g_oCacic.enCrypt(ed_te_info_patrimonio5.Text); | ||
1182 | - tstrListAux.Values['te_info_patrimonio6' ] := g_oCacic.enCrypt(ed_te_info_patrimonio6.Text); | ||
1183 | - | ||
1184 | - log_DEBUG('Informações para contato com mapa_set_patrimonio:'); | ||
1185 | - log_DEBUG('te_node_address: '+tstrListAux.Values['te_node_address']); | ||
1186 | - log_DEBUG('id_so: '+tstrListAux.Values['id_so']); | ||
1187 | - log_DEBUG('te_so: '+tstrListAux.Values['te_so']); | ||
1188 | - log_DEBUG('id_ip_rede: '+tstrListAux.Values['id_ip_rede']); | ||
1189 | - log_DEBUG('te_ip: '+tstrListAux.Values['te_ip']); | ||
1190 | - log_DEBUG('te_nome_computador: '+tstrListAux.Values['te_nome_computador']); | ||
1191 | - log_DEBUG('te_workgroup: '+tstrListAux.Values['te_workgroup']); | ||
1192 | - | ||
1193 | - strRetorno := frmMapaCacic.ComunicaServidor('mapa_set_patrimonio.php', tstrListAux, ''); | ||
1194 | - tstrListAux.Free; | ||
1195 | - | ||
1196 | - if not (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then | ||
1197 | - Mensagem('ATENÇÃO: PROBLEMAS NO ENVIO DAS INFORMAÇÕES COLETADAS AO BANCO DE DADOS...',true,intPausaPadrao); | ||
1198 | - // else | ||
1199 | - // Begin | ||
1200 | - Mensagem('Salvando Informações Coletadas em Base Local...',false,intPausaPadrao div 3); | ||
1201 | - SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel1', strIdUON1, tStringsCipherOpened); | ||
1202 | - SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel1a', strIdUON1a, tStringsCipherOpened); | ||
1203 | - SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel2' , strIdUON2, tStringsCipherOpened); | ||
1204 | - SetValorDatMemoria('Patrimonio.id_local' , strIdLocal, tStringsCipherOpened); | ||
1205 | - SetValorDatMemoria('Patrimonio.te_localizacao_complementar' , ed_te_localizacao_complementar.Text, tStringsCipherOpened); | ||
1206 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio1' , ed_te_info_patrimonio1.Text, tStringsCipherOpened); | ||
1207 | - SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SOFTWARE\Dataprev\Patrimonio\te_info_patrimonio1', ed_te_info_patrimonio1.Text); | ||
1208 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio2' , ed_te_info_patrimonio2.Text, tStringsCipherOpened); | ||
1209 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio3' , ed_te_info_patrimonio3.Text, tStringsCipherOpened); | ||
1210 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio4' , ed_te_info_patrimonio4.Text, tStringsCipherOpened); | ||
1211 | - SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SOFTWARE\Dataprev\Patrimonio\te_info_patrimonio4', ed_te_info_patrimonio4.Text); | ||
1212 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio5' , ed_te_info_patrimonio5.Text, tStringsCipherOpened); | ||
1213 | - SetValorDatMemoria('Patrimonio.te_info_patrimonio6' , ed_te_info_patrimonio6.Text, tStringsCipherOpened); | ||
1214 | - SetValorDatMemoria('Patrimonio.ultima_rede_obtida' , GetValorDatMemoria('TcpIp.ID_IP_REDE',frmMapaCacic.tStringsCipherOpened),tStringsCipherOpened); | ||
1215 | - // End; | ||
1216 | - // end | ||
1217 | - // else | ||
1218 | - // Mensagem('NÃO HÁ COLETA ATENÇÃO: PROBLEMAS NO ENVIO DAS INFORMAÇÕES COLETADAS AO BANCO DE DADOS...',true); | 1147 | + tstrAux := TStrings.Create; |
1148 | + tstrAux := g_oCacic.explode(VetorUON2Filtrado[cb_id_unid_organizacional_nivel2.ItemIndex],'#'); | ||
1149 | + Try | ||
1150 | + strIdUON1 := VetorUON1[cb_id_unid_organizacional_nivel1.ItemIndex].id1; | ||
1151 | + strIdUON2 := tstrAux[0]; | ||
1152 | + strIdLocal := tstrAux[1]; | ||
1153 | + Except | ||
1154 | + end; | ||
1155 | + | ||
1156 | + tstrAux := g_oCacic.explode(VetorUON1aFiltrado[cb_id_unid_organizacional_nivel1a.ItemIndex],'#'); | ||
1157 | + Try | ||
1158 | + strIdUON1a := tstrAux[0]; | ||
1159 | + Except | ||
1160 | + end; | ||
1161 | + | ||
1162 | + tstrAux.Free; | ||
1163 | + Mensagem('Enviando Informações Coletadas ao Banco de Dados...',false,intPausaPadrao div 3); | ||
1164 | + // Envio dos Dados Coletados ao Banco de Dados | ||
1165 | + tstrListAux := TStringList.Create; | ||
1166 | + tstrListAux.Values['te_node_address'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)); | ||
1167 | + tstrListAux.Values['id_so'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('Configs.ID_SO' , frmMapaCacic.tStringsCipherOpened)); | ||
1168 | + tstrListAux.Values['te_so'] := g_oCacic.enCrypt(g_oCacic.getWindowsStrId()); | ||
1169 | + tstrListAux.Values['id_ip_rede'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.ID_IP_REDE' , frmMapaCacic.tStringsCipherOpened)); | ||
1170 | + tstrListAux.Values['te_ip'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_IP' , frmMapaCacic.tStringsCipherOpened)); | ||
1171 | + tstrListAux.Values['te_nome_computador'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR' , frmMapaCacic.tStringsCipherOpened)); | ||
1172 | + tstrListAux.Values['te_workgroup'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); | ||
1173 | + tstrListAux.Values['id_usuario'] := g_oCacic.enCrypt(frmMapaCacic.strId_usuario); | ||
1174 | + tstrListAux.Values['id_unid_organizacional_nivel1'] := g_oCacic.enCrypt(strIdUON1); | ||
1175 | + tstrListAux.Values['id_unid_organizacional_nivel1a']:= g_oCacic.enCrypt(strIdUON1A); | ||
1176 | + tstrListAux.Values['id_unid_organizacional_nivel2'] := g_oCacic.enCrypt(strIdUON2); | ||
1177 | + tstrListAux.Values['te_localizacao_complementar' ] := g_oCacic.enCrypt(ed_te_localizacao_complementar.Text); | ||
1178 | + tstrListAux.Values['te_info_patrimonio1' ] := g_oCacic.enCrypt(ed_te_info_patrimonio1.Text); | ||
1179 | + tstrListAux.Values['te_info_patrimonio2' ] := g_oCacic.enCrypt(ed_te_info_patrimonio2.Text); | ||
1180 | + tstrListAux.Values['te_info_patrimonio3' ] := g_oCacic.enCrypt(ed_te_info_patrimonio3.Text); | ||
1181 | + tstrListAux.Values['te_info_patrimonio4' ] := g_oCacic.enCrypt(ed_te_info_patrimonio4.Text); | ||
1182 | + tstrListAux.Values['te_info_patrimonio5' ] := g_oCacic.enCrypt(ed_te_info_patrimonio5.Text); | ||
1183 | + tstrListAux.Values['te_info_patrimonio6' ] := g_oCacic.enCrypt(ed_te_info_patrimonio6.Text); | ||
1184 | + | ||
1185 | + log_DEBUG('Informações para contato com mapa_set_patrimonio:'); | ||
1186 | + log_DEBUG('te_node_address: '+tstrListAux.Values['te_node_address']); | ||
1187 | + log_DEBUG('id_so: '+tstrListAux.Values['id_so']); | ||
1188 | + log_DEBUG('te_so: '+tstrListAux.Values['te_so']); | ||
1189 | + log_DEBUG('id_ip_rede: '+tstrListAux.Values['id_ip_rede']); | ||
1190 | + log_DEBUG('te_ip: '+tstrListAux.Values['te_ip']); | ||
1191 | + log_DEBUG('te_nome_computador: '+tstrListAux.Values['te_nome_computador']); | ||
1192 | + log_DEBUG('te_workgroup: '+tstrListAux.Values['te_workgroup']); | ||
1193 | + | ||
1194 | + strRetorno := frmMapaCacic.ComunicaServidor('mapa_set_patrimonio.php', tstrListAux, ''); | ||
1195 | + tstrListAux.Free; | ||
1196 | + | ||
1197 | + if not (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then | ||
1198 | + Mensagem('ATENÇÃO: PROBLEMAS NO ENVIO DAS INFORMAÇÕES COLETADAS AO BANCO DE DADOS...',true,intPausaPadrao) | ||
1199 | + else | ||
1200 | + Begin | ||
1201 | + Mensagem('Salvando Informações Coletadas em Base Local...',false,intPausaPadrao div 3); | ||
1202 | + SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel1', strIdUON1, tStringsCipherOpened); | ||
1203 | + SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel1a', strIdUON1a, tStringsCipherOpened); | ||
1204 | + SetValorDatMemoria('Patrimonio.id_unid_organizacional_nivel2' , strIdUON2, tStringsCipherOpened); | ||
1205 | + SetValorDatMemoria('Patrimonio.id_local' , strIdLocal, tStringsCipherOpened); | ||
1206 | + SetValorDatMemoria('Patrimonio.te_localizacao_complementar' , ed_te_localizacao_complementar.Text, tStringsCipherOpened); | ||
1207 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio1' , ed_te_info_patrimonio1.Text, tStringsCipherOpened); | ||
1208 | + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SOFTWARE\Dataprev\Patrimonio\te_info_patrimonio1', ed_te_info_patrimonio1.Text); | ||
1209 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio2' , ed_te_info_patrimonio2.Text, tStringsCipherOpened); | ||
1210 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio3' , ed_te_info_patrimonio3.Text, tStringsCipherOpened); | ||
1211 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio4' , ed_te_info_patrimonio4.Text, tStringsCipherOpened); | ||
1212 | + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SOFTWARE\Dataprev\Patrimonio\te_info_patrimonio4', ed_te_info_patrimonio4.Text); | ||
1213 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio5' , ed_te_info_patrimonio5.Text, tStringsCipherOpened); | ||
1214 | + SetValorDatMemoria('Patrimonio.te_info_patrimonio6' , ed_te_info_patrimonio6.Text, tStringsCipherOpened); | ||
1215 | + SetValorDatMemoria('Patrimonio.ultima_rede_obtida' , GetValorDatMemoria('TcpIp.ID_IP_REDE',frmMapaCacic.tStringsCipherOpened),tStringsCipherOpened); | ||
1216 | + End; | ||
1219 | Finalizar(true); | 1217 | Finalizar(true); |
1220 | End; | 1218 | End; |
1221 | end; | 1219 | end; |
@@ -1244,7 +1242,8 @@ Begin | @@ -1244,7 +1242,8 @@ Begin | ||
1244 | ed_te_localizacao_complementar.Text := strTe_localizacao_complementar; | 1242 | ed_te_localizacao_complementar.Text := strTe_localizacao_complementar; |
1245 | ed_te_localizacao_complementar.Visible := true; | 1243 | ed_te_localizacao_complementar.Visible := true; |
1246 | 1244 | ||
1247 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta4', p_strConfigs)) = 'S') then | 1245 | + log_DEBUG('in_exibir_etiqueta4 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta4', p_strConfigs))+'"'); |
1246 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta4', p_strConfigs))) = 'S') then | ||
1248 | begin | 1247 | begin |
1249 | lbEtiqueta4.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta4', p_strConfigs)); | 1248 | lbEtiqueta4.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta4', p_strConfigs)); |
1250 | lbEtiqueta4.Visible := true; | 1249 | lbEtiqueta4.Visible := true; |
@@ -1253,7 +1252,8 @@ Begin | @@ -1253,7 +1252,8 @@ Begin | ||
1253 | ed_te_info_patrimonio1.visible := True; | 1252 | ed_te_info_patrimonio1.visible := True; |
1254 | end; | 1253 | end; |
1255 | 1254 | ||
1256 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta5', p_strConfigs)) = 'S') then | 1255 | + log_DEBUG('in_exibir_etiqueta5 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta5', p_strConfigs))+'"'); |
1256 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta5', p_strConfigs))) = 'S') then | ||
1257 | begin | 1257 | begin |
1258 | lbEtiqueta5.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta5', p_strConfigs)); | 1258 | lbEtiqueta5.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta5', p_strConfigs)); |
1259 | lbEtiqueta5.Visible := true; | 1259 | lbEtiqueta5.Visible := true; |
@@ -1262,7 +1262,8 @@ Begin | @@ -1262,7 +1262,8 @@ Begin | ||
1262 | ed_te_info_patrimonio2.visible := True; | 1262 | ed_te_info_patrimonio2.visible := True; |
1263 | end; | 1263 | end; |
1264 | 1264 | ||
1265 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta6', p_strConfigs)) = 'S') then | 1265 | + log_DEBUG('in_exibir_etiqueta6 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta6', p_strConfigs))+'"'); |
1266 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta6', p_strConfigs))) = 'S') then | ||
1266 | begin | 1267 | begin |
1267 | lbEtiqueta6.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta6', p_strConfigs)); | 1268 | lbEtiqueta6.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta6', p_strConfigs)); |
1268 | lbEtiqueta6.Visible := true; | 1269 | lbEtiqueta6.Visible := true; |
@@ -1271,7 +1272,8 @@ Begin | @@ -1271,7 +1272,8 @@ Begin | ||
1271 | ed_te_info_patrimonio3.visible := True; | 1272 | ed_te_info_patrimonio3.visible := True; |
1272 | end; | 1273 | end; |
1273 | 1274 | ||
1274 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta7', p_strConfigs)) = 'S') then | 1275 | + log_DEBUG('in_exibir_etiqueta7 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta7', p_strConfigs))+'"'); |
1276 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta7', p_strConfigs))) = 'S') then | ||
1275 | begin | 1277 | begin |
1276 | lbEtiqueta7.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta7', p_strConfigs)); | 1278 | lbEtiqueta7.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta7', p_strConfigs)); |
1277 | lbEtiqueta7.Visible := true; | 1279 | lbEtiqueta7.Visible := true; |
@@ -1280,7 +1282,8 @@ Begin | @@ -1280,7 +1282,8 @@ Begin | ||
1280 | ed_te_info_patrimonio4.visible := True; | 1282 | ed_te_info_patrimonio4.visible := True; |
1281 | end; | 1283 | end; |
1282 | 1284 | ||
1283 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta8', p_strConfigs)) = 'S') then | 1285 | + log_DEBUG('in_exibir_etiqueta8 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta8', p_strConfigs))+'"'); |
1286 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta8', p_strConfigs))) = 'S') then | ||
1284 | begin | 1287 | begin |
1285 | lbEtiqueta8.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta8', p_strConfigs)); | 1288 | lbEtiqueta8.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta8', p_strConfigs)); |
1286 | lbEtiqueta8.Visible := true; | 1289 | lbEtiqueta8.Visible := true; |
@@ -1289,14 +1292,17 @@ Begin | @@ -1289,14 +1292,17 @@ Begin | ||
1289 | ed_te_info_patrimonio5.visible := True; | 1292 | ed_te_info_patrimonio5.visible := True; |
1290 | end; | 1293 | end; |
1291 | 1294 | ||
1292 | - if (g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta9', p_strConfigs)) = 'S') then | ||
1293 | - begin | ||
1294 | - lbEtiqueta9.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta9', p_strConfigs)); | ||
1295 | - lbEtiqueta9.Visible := true; | ||
1296 | - ed_te_info_patrimonio6.Hint := g_oCacic.deCrypt(XML.XML_RetornaValor('te_help_etiqueta9', p_strConfigs)); | ||
1297 | - ed_te_info_patrimonio6.Text := strTe_info_patrimonio6; | ||
1298 | - ed_te_info_patrimonio6.visible := True; | ||
1299 | - end; | 1295 | + log_DEBUG('in_exibir_etiqueta9 -> "'+g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta9', p_strConfigs))+'"'); |
1296 | + if (trim(g_oCacic.deCrypt(XML.XML_RetornaValor('in_exibir_etiqueta9', p_strConfigs))) = 'S') then | ||
1297 | + begin | ||
1298 | + lbEtiqueta9.Caption := g_oCacic.deCrypt(XML.XML_RetornaValor('te_etiqueta9', p_strConfigs)); | ||
1299 | + lbEtiqueta9.Visible := true; | ||
1300 | + ed_te_info_patrimonio6.Hint := g_oCacic.deCrypt(XML.XML_RetornaValor('te_help_etiqueta9', p_strConfigs)); | ||
1301 | + ed_te_info_patrimonio6.Text := strTe_info_patrimonio6; | ||
1302 | + ed_te_info_patrimonio6.visible := True; | ||
1303 | + end; | ||
1304 | + | ||
1305 | + Application.ProcessMessages; | ||
1300 | Mensagem('',false,0); | 1306 | Mensagem('',false,0); |
1301 | btGravarInformacoes.Visible := true; | 1307 | btGravarInformacoes.Visible := true; |
1302 | end; | 1308 | end; |
@@ -1471,6 +1477,7 @@ begin | @@ -1471,6 +1477,7 @@ begin | ||
1471 | g_oCacic.setBoolCipher(true); | 1477 | g_oCacic.setBoolCipher(true); |
1472 | frmMapaCacic.lbVersao.Caption := 'Versão: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); | 1478 | frmMapaCacic.lbVersao.Caption := 'Versão: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); |
1473 | log_DEBUG('Versão do MapaCacic: '+frmMapaCacic.lbVersao.Caption); | 1479 | log_DEBUG('Versão do MapaCacic: '+frmMapaCacic.lbVersao.Caption); |
1480 | + | ||
1474 | if (g_oCacic.isWindowsNTPlataform()) and (not g_oCacic.isWindowsAdmin()) then | 1481 | if (g_oCacic.isWindowsNTPlataform()) and (not g_oCacic.isWindowsAdmin()) then |
1475 | Begin | 1482 | Begin |
1476 | MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); | 1483 | MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); |
@@ -1478,98 +1485,98 @@ begin | @@ -1478,98 +1485,98 @@ begin | ||
1478 | End | 1485 | End |
1479 | else | 1486 | else |
1480 | Begin | 1487 | Begin |
1481 | - // Varrer unidades C:\, D:\ e E:\ ... em busca da estrutura Cacic\cacic2.dat | ||
1482 | - strLetrasDrives := LetrasDrives; | 1488 | + frmMapaCacic.tStringsCipherOpened := TStrings.Create; |
1483 | 1489 | ||
1484 | - v_strCacicPath := ''; | ||
1485 | - for intAux := 1 to length(strLetrasDrives) do | ||
1486 | - Begin | ||
1487 | - lbMensagens.Caption := 'Procurando Estrutura do Sistema CACIC em "'+strLetrasDrives[intAux] + ':\"'; | ||
1488 | - | ||
1489 | - Log_Debug('Testando "'+strLetrasDrives[intAux] + ':\Cacic\cacic2.dat'+'"'); | ||
1490 | - if (v_strCacicPath='') and (SearchFile(strLetrasDrives[intAux] + ':','\Cacic\cacic2.dat')) then | ||
1491 | - Begin | ||
1492 | - v_strCacicPath := strLetrasDrives[intAux] + ':\Cacic\'; | ||
1493 | - lbMensagens.Caption := 'Estrutura Encontrada!'; | ||
1494 | - Log_Debug('Validado "'+strLetrasDrives[intAux] + ':\Cacic\cacic2.dat'+'"'); | ||
1495 | - End | ||
1496 | - else | ||
1497 | - Log_Debug('Não Validado em "'+strLetrasDrives[intAux] + ':\Cacic\cacic2.dat'+'"'); | ||
1498 | - application.ProcessMessages; | ||
1499 | - End; | 1490 | + // Buscarei o caminho do Sistema em \WinDIR\chkSIS.DAT |
1491 | + frmMapaCacic.tStringsCipherOpened := CipherOpen(g_oCacic.getWinDir + 'chksis.dat'); | ||
1492 | + v_strCacicPath := GetValorDatMemoria('cacic2.cacic_dir',frmMapaCacic.tStringsCipherOpened); | ||
1500 | 1493 | ||
1501 | if not (v_strCacicPath = '') then | 1494 | if not (v_strCacicPath = '') then |
1502 | Begin | 1495 | Begin |
1503 | g_oCacic.setCacicPath(v_strCacicPath); | 1496 | g_oCacic.setCacicPath(v_strCacicPath); |
1504 | - Matar(g_oCacic.getCacicPath,'aguarde_CACIC.txt'); | ||
1505 | - | ||
1506 | - if FileExists(g_oCacic.getCacicPath + 'aguarde_CACIC.txt') then | 1497 | + frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); |
1498 | + frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); | ||
1499 | + frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; | ||
1500 | + if (frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)='') then | ||
1507 | Begin | 1501 | Begin |
1508 | - MessageDLG(#13#10+'ATENÇÃO! É necessário finalizar o Agente Principal do CACIC.',mtError,[mbOK],0); | ||
1509 | - Sair; | ||
1510 | - End; | ||
1511 | - | ||
1512 | - boolDebugs := false; | ||
1513 | - if DirectoryExists(g_oCacic.getCacicPath + 'Temp\Debugs') then | 1502 | + frmMapaCacic.boolAcessoOK := false; |
1503 | + MessageDLG(#13#10+'Atenção! É necessário executar as coletas do Sistema Cacic.' + #13#10 + #13#10 + | ||
1504 | + 'Caso o Sistema Cacic já esteja instalado, clique com botão direito' + #13#10 + | ||
1505 | + 'sobre o ícone da bandeja, escolha a opção "Executar Agora" e aguarde' + #13#10 + | ||
1506 | + 'o fim do processo.',mtError,[mbOK],0); | ||
1507 | + frmMapaCacic.Finalizar(false); | ||
1508 | + End | ||
1509 | + else | ||
1514 | Begin | 1510 | Begin |
1515 | - if (FormatDateTime('ddmmyyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then | 1511 | + Matar(g_oCacic.getCacicPath,'aguarde_CACIC.txt'); |
1512 | + | ||
1513 | + if FileExists(g_oCacic.getCacicPath + 'aguarde_CACIC.txt') then | ||
1516 | Begin | 1514 | Begin |
1517 | - boolDebugs := true; | ||
1518 | - log_DEBUG('Pasta "' + g_oCacic.getCacicPath + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs'))+' encontrada. DEBUG ativado.'); | 1515 | + MessageDLG(#13#10+'ATENÇÃO! É necessário finalizar o Agente Principal do CACIC.',mtError,[mbOK],0); |
1516 | + Sair; | ||
1519 | End; | 1517 | End; |
1520 | - End; | ||
1521 | 1518 | ||
1522 | - // Acessar... | ||
1523 | - CriaFormSenha(nil); | ||
1524 | - frmAcesso.ShowModal; | ||
1525 | - | ||
1526 | - if not (boolAcessoOK) then | ||
1527 | - Finalizar(true) | ||
1528 | - else | ||
1529 | - Begin | ||
1530 | - pnMensagens.Visible := true; | ||
1531 | - Mensagem('Efetuando Comunicação com o Módulo Gerente WEB em "'+GetValorDatMemoria('Configs.EnderecoServidor', tStringsCipherOpened)+'"...',false,intPausaPadrao div 3); | ||
1532 | - frmAcesso.Free; | ||
1533 | - | ||
1534 | - // Povoamento com dados de configurações da interface patrimonial | ||
1535 | - // Solicita ao servidor as configurações para a Coleta de Informações de Patrimônio | ||
1536 | - Request_mapa := TStringList.Create; | ||
1537 | - Request_mapa.Values['te_node_address'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)); | ||
1538 | - Request_mapa.Values['id_so'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('Configs.ID_SO' , frmMapaCacic.tStringsCipherOpened)); | ||
1539 | - Request_mapa.Values['te_so'] := g_oCacic.enCrypt(g_oCacic.getWindowsStrId()); | ||
1540 | - Request_mapa.Values['id_ip_rede'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.ID_IP_REDE' , frmMapaCacic.tStringsCipherOpened)); | ||
1541 | - Request_mapa.Values['te_ip'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_IP' , frmMapaCacic.tStringsCipherOpened)); | ||
1542 | - Request_mapa.Values['te_nome_computador']:= g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR', frmMapaCacic.tStringsCipherOpened)); | ||
1543 | - Request_mapa.Values['te_workgroup'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); | ||
1544 | - Request_mapa.Values['id_usuario'] := g_oCacic.enCrypt(frmMapaCacic.strId_usuario); | ||
1545 | - | ||
1546 | - strRetorno := frmMapaCacic.ComunicaServidor('mapa_get_patrimonio.php', Request_mapa, '.'); | ||
1547 | - | ||
1548 | - log_DEBUG('Retorno: "'+strRetorno+'"'); | ||
1549 | - | ||
1550 | - if (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then | 1519 | + boolDebugs := false; |
1520 | + if DirectoryExists(g_oCacic.getCacicPath + 'Temp\Debugs') then | ||
1551 | Begin | 1521 | Begin |
1552 | - Mensagem('Comunicação Efetuada com Sucesso! Salvando Configurações Obtidas...',false,intPausaPadrao div 3); | ||
1553 | - frmMapaCacic.SetValorDatMemoria('Patrimonio.Configs', strRetorno, frmMapaCacic.tStringsCipherOpened) | ||
1554 | - End | 1522 | + if (FormatDateTime('ddmmyyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then |
1523 | + Begin | ||
1524 | + boolDebugs := true; | ||
1525 | + log_DEBUG('Pasta "' + g_oCacic.getCacicPath + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(g_oCacic.getCacicPath + 'Temp\Debugs'))+' encontrada. DEBUG ativado.'); | ||
1526 | + End; | ||
1527 | + End; | ||
1528 | + | ||
1529 | + // Acessar... | ||
1530 | + CriaFormSenha(nil); | ||
1531 | + frmAcesso.ShowModal; | ||
1532 | + | ||
1533 | + if not (boolAcessoOK) then | ||
1534 | + Finalizar(true) | ||
1555 | else | 1535 | else |
1556 | Begin | 1536 | Begin |
1557 | - Mensagem('PROBLEMAS NA COMUNICAÇÃO COM O MÓDULO GERENTE WEB...',true,intPausaPadrao); | ||
1558 | - Finalizar(true); | ||
1559 | - End; | 1537 | + pnMensagens.Visible := true; |
1538 | + Mensagem('Efetuando Comunicação com o Módulo Gerente WEB em "'+GetValorDatMemoria('Configs.EnderecoServidor', tStringsCipherOpened)+'"...',false,intPausaPadrao div 3); | ||
1539 | + frmAcesso.Free; | ||
1540 | + | ||
1541 | + // Povoamento com dados de configurações da interface patrimonial | ||
1542 | + // Solicita ao servidor as configurações para a Coleta de Informações de Patrimônio | ||
1543 | + Request_mapa := TStringList.Create; | ||
1544 | + Request_mapa.Values['te_node_address'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)); | ||
1545 | + Request_mapa.Values['id_so'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('Configs.ID_SO' , frmMapaCacic.tStringsCipherOpened)); | ||
1546 | + Request_mapa.Values['te_so'] := g_oCacic.enCrypt(g_oCacic.getWindowsStrId()); | ||
1547 | + Request_mapa.Values['id_ip_rede'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.ID_IP_REDE' , frmMapaCacic.tStringsCipherOpened)); | ||
1548 | + Request_mapa.Values['te_ip'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_IP' , frmMapaCacic.tStringsCipherOpened)); | ||
1549 | + Request_mapa.Values['te_nome_computador']:= g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR', frmMapaCacic.tStringsCipherOpened)); | ||
1550 | + Request_mapa.Values['te_workgroup'] := g_oCacic.enCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); | ||
1551 | + Request_mapa.Values['id_usuario'] := g_oCacic.enCrypt(frmMapaCacic.strId_usuario); | ||
1552 | + | ||
1553 | + strRetorno := frmMapaCacic.ComunicaServidor('mapa_get_patrimonio.php', Request_mapa, '.'); | ||
1554 | + | ||
1555 | + log_DEBUG('Retorno: "'+strRetorno+'"'); | ||
1556 | + | ||
1557 | + if (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then | ||
1558 | + Begin | ||
1559 | + Mensagem('Comunicação Efetuada com Sucesso! Salvando Configurações Obtidas...',false,intPausaPadrao div 3); | ||
1560 | + frmMapaCacic.SetValorDatMemoria('Patrimonio.Configs', strRetorno, frmMapaCacic.tStringsCipherOpened) | ||
1561 | + End | ||
1562 | + else | ||
1563 | + Begin | ||
1564 | + Mensagem('PROBLEMAS NA COMUNICAÇÃO COM O MÓDULO GERENTE WEB...',true,intPausaPadrao); | ||
1565 | + Finalizar(true); | ||
1566 | + End; | ||
1560 | 1567 | ||
1561 | - Request_mapa.Free; | 1568 | + Request_mapa.Free; |
1562 | 1569 | ||
1563 | - mapa; | 1570 | + mapa; |
1571 | + End; | ||
1564 | End; | 1572 | End; |
1565 | End | 1573 | End |
1566 | else | 1574 | else |
1567 | Begin | 1575 | Begin |
1568 | - lbMensagens.Caption := 'Estrutura CACIC não Encontrada!'; | ||
1569 | - application.ProcessMessages; | ||
1570 | - MessageDLG(#13#10+'Não Encontrei a Estrutura do Sistema CACIC!'+#13#10#13#10+ | ||
1571 | - 'Operação Abortada!',mtError,[mbOK],0); | ||
1572 | - Sair; | 1576 | + frmMapaCacic.boolAcessoOK := false; |
1577 | + MessageDLG(#13#10+'Atenção! É necessário reinstalar o CACIC nesta estação.' + #13#10 + #13#10 + | ||
1578 | + 'A estrutura encontra-se corrompida.' + #13#10,mtError,[mbOK],0); | ||
1579 | + frmMapaCacic.Finalizar(false); | ||
1573 | End; | 1580 | End; |
1574 | End; | 1581 | End; |
1575 | 1582 |
mapa/mapacacic.res
No preview for this file type