From bb98f1e716eb8bbcf59f0e671167d022d4163f09 Mon Sep 17 00:00:00 2001 From: Eric Menezes Noronha Date: Fri, 28 Mar 2014 17:51:48 -0300 Subject: [PATCH] Adapatação para recepção dos dados de LDAP enviados pelo gerente. --- MapaTesteProj/MapaCACIC.dpr | 2 +- MapaTesteProj/MapaCACIC.dproj | 8 ++++---- MapaTesteProj/MapaCACIC.identcache | Bin 1327 -> 0 bytes MapaTesteProj/MapaCACIC.res | Bin 4188 -> 0 bytes MapaTesteProj/MapaTeste.dcu | Bin 27676 -> 0 bytes MapaTesteProj/MapaTeste.pas | 31 ++++++++++++++----------------- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/MapaTesteProj/MapaCACIC.dpr b/MapaTesteProj/MapaCACIC.dpr index bad46fc..21d2d13 100644 --- a/MapaTesteProj/MapaCACIC.dpr +++ b/MapaTesteProj/MapaCACIC.dpr @@ -1,4 +1,4 @@ -program MapaCACIC; +program mapacacic; uses Forms, diff --git a/MapaTesteProj/MapaCACIC.dproj b/MapaTesteProj/MapaCACIC.dproj index 91dc22c..874805c 100644 --- a/MapaTesteProj/MapaCACIC.dproj +++ b/MapaTesteProj/MapaCACIC.dproj @@ -5,8 +5,8 @@ Debug AnyCPU DCC32 - ..\..\Agentes_Windows_BINARIOS\MapaCACIC.exe - MapaCACIC.dpr + ..\..\Agentes_Windows_BINARIOS\mapacacic.exe + mapacacic.dpr 7.0 @@ -24,11 +24,11 @@ Delphi.Personality -FalseTrueFalseTrueFalse2813TrueFalseFalseFalseFalse10461252Dataprev - Emp. de TI da Prev Social - URES/SESSSistema CACIC - Módulo para Verificação e Instalação de Estrutura Básica do Sistema CACIC2.8.1.33.0Licença: GNU/LGPLMapaCACIC.dpr +FalseTrueFalseTrueFalse2815TrueFalseFalseFalseFalse10461252Dataprev - Emp. de TI da Prev Social - URES/SESSSistema CACIC - Módulo para Verificação e Instalação de Estrutura Básica do Sistema CACIC2.8.1.53.0Licença: GNU/LGPLmapacacic.dpr - + MainSource diff --git a/MapaTesteProj/MapaCACIC.identcache b/MapaTesteProj/MapaCACIC.identcache index 5639644..9131734 100644 Binary files a/MapaTesteProj/MapaCACIC.identcache and b/MapaTesteProj/MapaCACIC.identcache differ diff --git a/MapaTesteProj/MapaCACIC.res b/MapaTesteProj/MapaCACIC.res index 350d6af..0b9149e 100644 Binary files a/MapaTesteProj/MapaCACIC.res and b/MapaTesteProj/MapaCACIC.res differ diff --git a/MapaTesteProj/MapaTeste.dcu b/MapaTesteProj/MapaTeste.dcu index 4b06bad..a34d53a 100644 Binary files a/MapaTesteProj/MapaTeste.dcu and b/MapaTesteProj/MapaTeste.dcu differ diff --git a/MapaTesteProj/MapaTeste.pas b/MapaTesteProj/MapaTeste.pas index aaf911c..da8a37a 100644 --- a/MapaTesteProj/MapaTeste.pas +++ b/MapaTesteProj/MapaTeste.pas @@ -146,6 +146,7 @@ implementation procedure TfrmMapaCacic.Sair; Begin + EstadoBarraTarefa(TRUE); Application.Terminate; End; @@ -300,9 +301,10 @@ Begin if (Result <> '0') then Begin + objCacic.setValueToFile('Configs' ,'Patrimonio_dados_ldap', objCacic.getValueFromTags('dados_ldap' , Result), strGerColsInfFileName); objCacic.setValueToFile('Configs' ,'Patrimonio_Combos' , objCacic.getValueFromTags('Configs_Patrimonio_Combos' , Result), strGerColsInfFileName); objCacic.setValueToFile('Configs' ,'Patrimonio_Interface' , objCacic.getValueFromTags('Configs_Patrimonio_Interface', Result), strGerColsInfFileName); - objCacic.setValueToFile('Collects','Patrimonio_Last' , objCacic.getValueFromTags('Collects_Patrimonio_Last' , Result), strGerColsInfFileName); +// objCacic.setValueToFile('Collects','col_patr_last' , objCacic.getValueFromTags('Collects_Patrimonio_Last' , Result), strGerColsInfFileName); End else begin @@ -321,7 +323,7 @@ begin btCombosUpdate.Enabled := false; strCollectsPatrimonioLast := objCacic.deCrypt( objCacic.GetValueFromFile - ('Collects','Patrimonio_Last', + ('Collects','col_patr_last', strGerColsInfFileName)); if (strCollectsPatrimonioLast <> '') then @@ -390,15 +392,14 @@ if edTeInfoNome.text <> '' then else Begin btGravarInformacoes.Caption := 'Informações enviadas com sucesso...'; - objCacic.setValueToFile('Collects','Patrimonio_Last' , + objCacic.setValueToFile('Collects','col_patr_last' , objCacic.enCrypt(strColetaAtual), strGerColsInfFileName); - objCacic.setValueToFile('Collects','Patrimonio_exe', 's', strGerColsInfFileName); + objCacic.setValueToFile('Collects','col_patr_exe', 's', strGerColsInfFileName); End; objCacic.writeDebugLog(#13#10 + 'AtualizaPatrimonio: Dados Enviados ao Servidor!'); Application.ProcessMessages; - EstadoBarraTarefa(TRUE); Finalizar(true); end else @@ -829,29 +830,25 @@ function TfrmMapaCacic.LDAPName: string; var ldap: TLDAPsend; l: TStringList; - host, username, psswd, base, strDadosLDAP : string; + host, username, psswd, base, strDadosLDAP, identificador : string; begin result := ''; ldap := TLDAPsend.Create; l := TStringList.Create; // PEGANDO OS DADOS DO POR MEIO DO GET/CONFIGS, ONDE SERÁ GRAVADO NO GERCOLS.INF -// strDadosLDAP := objCacic.deCrypt(objCacic.getValueFromFile('Configs','dados_ldap',strGerColsInfFileName)); - host := '10.72.160.21'; -// host := objCacic.getValueFromTags('ip', strDadosLDAP); - username := 'uid=ssopgfn,ou=aplic,ou=corp,ou=pgfn,dc=mf,dc=gov,dc=br'; -// username := objCacic.getValueFromTags('usuario', strDadosLDAP); - psswd := 'pgfn_2013'; -// psswd := objCacic.getValueFromTags('psswd', strDadosLDAP); - base := 'ou=pgfn,dc=mf,dc=gov,dc=br'; -// base := objCacic.getValueFromTags('base', strDadosLDAP); - + strDadosLDAP := objCacic.deCrypt(objCacic.getValueFromFile('Configs','Patrimonio_dados_ldap',strGerColsInfFileName)); + host := objCacic.getValueFromTags('ip', strDadosLDAP); + username := objCacic.getValueFromTags('usuario', strDadosLDAP); + psswd := objCacic.getValueFromTags('senha', strDadosLDAP); + base := objCacic.getValueFromTags('base', strDadosLDAP); + identificador:= objCacic.getValueFromTags('identificador', strDadosLDAP); try ldap.TargetHost := host; ldap.UserName := username; ldap.Password := psswd; ldap.Login; //Loga no LDAP. ldap.BindSasl; //Autentica no LDAP com Usuário e senha repassado. (BindSasl é mais seguro que Bind) - l.Add('cn'); //Estamos pesquisando apenas o nome, então apenas 'cn' será enviado. + l.Add(identificador); //Estamos pesquisando apenas o nome, então apenas 'cn' será enviado. ldap.Search(base, False, 'uid=' + getUserLogon, l); //Faz a pesquisa, com o CPF repassado. result := getLastValue(LDAPResultdump(ldap.SearchResult), #$D#$A); ldap.Logout; -- libgit2 0.21.2