Commit 61f0e50c351b56256f8ef671d148856d92d3fde4
1 parent
873da8f1
Exists in
master
Melhorias em MapaCacic e Vacon.
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@103 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
13 changed files
with
392 additions
and
190 deletions
Show diff stats
mapa/acesso.dcu
No preview for this file type
mapa/acesso.dfm
1 | object frmAcesso: TfrmAcesso | 1 | object frmAcesso: TfrmAcesso |
2 | - Left = 355 | 2 | + Left = 301 |
3 | Top = 147 | 3 | Top = 147 |
4 | BorderIcons = [] | 4 | BorderIcons = [] |
5 | BorderStyle = bsSingle | 5 | BorderStyle = bsSingle |
6 | Caption = | 6 | Caption = |
7 | 'MapaCacic - M'#243'dulo Avulso para Coleta de Informa'#231#245'es Patrimoniai' + | 7 | 'MapaCacic - M'#243'dulo Avulso para Coleta de Informa'#231#245'es Patrimoniai' + |
8 | 's' | 8 | 's' |
9 | - ClientHeight = 158 | ||
10 | - ClientWidth = 516 | 9 | + ClientHeight = 284 |
10 | + ClientWidth = 605 | ||
11 | Color = clBtnFace | 11 | Color = clBtnFace |
12 | Font.Charset = DEFAULT_CHARSET | 12 | Font.Charset = DEFAULT_CHARSET |
13 | Font.Color = clWindowText | 13 | Font.Color = clWindowText |
@@ -145,50 +145,53 @@ object frmAcesso: TfrmAcesso | @@ -145,50 +145,53 @@ object frmAcesso: TfrmAcesso | ||
145 | 0000000FC000FC000000000FC000FDAD8035B5BFC000} | 145 | 0000000FC000FC000000000FC000FDAD8035B5BFC000} |
146 | OldCreateOrder = False | 146 | OldCreateOrder = False |
147 | Position = poDesktopCenter | 147 | Position = poDesktopCenter |
148 | + OnActivate = FormActivate | ||
148 | OnCreate = FormCreate | 149 | OnCreate = FormCreate |
149 | OnShow = FormShow | 150 | OnShow = FormShow |
150 | PixelsPerInch = 96 | 151 | PixelsPerInch = 96 |
151 | TextHeight = 13 | 152 | TextHeight = 13 |
152 | object btAcesso: TButton | 153 | object btAcesso: TButton |
153 | - Left = 132 | ||
154 | - Top = 120 | 154 | + Left = 174 |
155 | + Top = 241 | ||
155 | Width = 100 | 156 | Width = 100 |
156 | - Height = 25 | 157 | + Height = 30 |
157 | Caption = 'Acessar' | 158 | Caption = 'Acessar' |
158 | Enabled = False | 159 | Enabled = False |
159 | Font.Charset = DEFAULT_CHARSET | 160 | Font.Charset = DEFAULT_CHARSET |
160 | Font.Color = clWindowText | 161 | Font.Color = clWindowText |
161 | Font.Height = -13 | 162 | Font.Height = -13 |
162 | - Font.Name = 'MS Sans Serif' | 163 | + Font.Name = 'Arial' |
163 | Font.Style = [fsBold] | 164 | Font.Style = [fsBold] |
164 | ParentFont = False | 165 | ParentFont = False |
165 | TabOrder = 0 | 166 | TabOrder = 0 |
166 | OnClick = btAcessoClick | 167 | OnClick = btAcessoClick |
167 | end | 168 | end |
168 | object btCancela: TButton | 169 | object btCancela: TButton |
169 | - Left = 282 | ||
170 | - Top = 120 | 170 | + Left = 324 |
171 | + Top = 241 | ||
171 | Width = 100 | 172 | Width = 100 |
172 | - Height = 25 | 173 | + Height = 30 |
173 | Caption = 'Cancelar' | 174 | Caption = 'Cancelar' |
174 | Font.Charset = DEFAULT_CHARSET | 175 | Font.Charset = DEFAULT_CHARSET |
175 | Font.Color = clWindowText | 176 | Font.Color = clWindowText |
176 | Font.Height = -13 | 177 | Font.Height = -13 |
177 | - Font.Name = 'MS Sans Serif' | 178 | + Font.Name = 'Arial' |
178 | Font.Style = [fsBold] | 179 | Font.Style = [fsBold] |
179 | ParentFont = False | 180 | ParentFont = False |
180 | TabOrder = 1 | 181 | TabOrder = 1 |
181 | OnClick = btCancelaClick | 182 | OnClick = btCancelaClick |
182 | end | 183 | end |
183 | object pnAcesso: TPanel | 184 | object pnAcesso: TPanel |
184 | - Left = 15 | ||
185 | - Top = 13 | ||
186 | - Width = 485 | ||
187 | - Height = 72 | 185 | + Left = 5 |
186 | + Top = 10 | ||
187 | + Width = 596 | ||
188 | + Height = 196 | ||
189 | + BevelInner = bvRaised | ||
190 | + BevelOuter = bvLowered | ||
188 | TabOrder = 2 | 191 | TabOrder = 2 |
189 | object lbNomeUsuarioAcesso: TLabel | 192 | object lbNomeUsuarioAcesso: TLabel |
190 | - Left = 27 | ||
191 | - Top = 9 | 193 | + Left = 56 |
194 | + Top = 39 | ||
192 | Width = 109 | 195 | Width = 109 |
193 | Height = 16 | 196 | Height = 16 |
194 | Caption = 'Nome de Usu'#225'rio:' | 197 | Caption = 'Nome de Usu'#225'rio:' |
@@ -200,8 +203,8 @@ object frmAcesso: TfrmAcesso | @@ -200,8 +203,8 @@ object frmAcesso: TfrmAcesso | ||
200 | ParentFont = False | 203 | ParentFont = False |
201 | end | 204 | end |
202 | object lbSenhaAcesso: TLabel | 205 | object lbSenhaAcesso: TLabel |
203 | - Left = 306 | ||
204 | - Top = 9 | 206 | + Left = 389 |
207 | + Top = 39 | ||
205 | Width = 110 | 208 | Width = 110 |
206 | Height = 16 | 209 | Height = 16 |
207 | Caption = 'Senha de Acesso:' | 210 | Caption = 'Senha de Acesso:' |
@@ -214,14 +217,14 @@ object frmAcesso: TfrmAcesso | @@ -214,14 +217,14 @@ object frmAcesso: TfrmAcesso | ||
214 | end | 217 | end |
215 | object lbAviso: TLabel | 218 | object lbAviso: TLabel |
216 | Left = 4 | 219 | Left = 4 |
217 | - Top = 53 | ||
218 | - Width = 477 | 220 | + Top = 121 |
221 | + Width = 587 | ||
219 | Height = 13 | 222 | Height = 13 |
220 | Alignment = taCenter | 223 | Alignment = taCenter |
221 | AutoSize = False | 224 | AutoSize = False |
222 | Caption = | 225 | Caption = |
223 | - 'ATEN'#199#195'O: O usu'#225'rio deve estar cadastrado no Gerente WEB CACIC co' + | ||
224 | - 'm n'#237'vel "T'#233'cnico"' | 226 | + 'ATEN'#199#195'O: O usu'#225'rio deve estar cadastrado no Gerente WEB com n'#237've' + |
227 | + 'l "T'#233'cnico"' | ||
225 | Font.Charset = DEFAULT_CHARSET | 228 | Font.Charset = DEFAULT_CHARSET |
226 | Font.Color = clNavy | 229 | Font.Color = clNavy |
227 | Font.Height = -11 | 230 | Font.Height = -11 |
@@ -230,8 +233,8 @@ object frmAcesso: TfrmAcesso | @@ -230,8 +233,8 @@ object frmAcesso: TfrmAcesso | ||
230 | ParentFont = False | 233 | ParentFont = False |
231 | end | 234 | end |
232 | object edNomeUsuarioAcesso: TEdit | 235 | object edNomeUsuarioAcesso: TEdit |
233 | - Left = 27 | ||
234 | - Top = 25 | 236 | + Left = 56 |
237 | + Top = 55 | ||
235 | Width = 150 | 238 | Width = 150 |
236 | Height = 21 | 239 | Height = 21 |
237 | MaxLength = 20 | 240 | MaxLength = 20 |
@@ -239,8 +242,8 @@ object frmAcesso: TfrmAcesso | @@ -239,8 +242,8 @@ object frmAcesso: TfrmAcesso | ||
239 | OnKeyUp = edNomeUsuarioAcessoKeyUp | 242 | OnKeyUp = edNomeUsuarioAcessoKeyUp |
240 | end | 243 | end |
241 | object edSenhaAcesso: TEdit | 244 | object edSenhaAcesso: TEdit |
242 | - Left = 306 | ||
243 | - Top = 25 | 245 | + Left = 389 |
246 | + Top = 55 | ||
244 | Width = 150 | 247 | Width = 150 |
245 | Height = 21 | 248 | Height = 21 |
246 | PasswordChar = #1 | 249 | PasswordChar = #1 |
@@ -249,32 +252,35 @@ object frmAcesso: TfrmAcesso | @@ -249,32 +252,35 @@ object frmAcesso: TfrmAcesso | ||
249 | end | 252 | end |
250 | end | 253 | end |
251 | object pnMensagens: TPanel | 254 | object pnMensagens: TPanel |
252 | - Left = 15 | ||
253 | - Top = 85 | ||
254 | - Width = 485 | ||
255 | - Height = 23 | 255 | + Left = 4 |
256 | + Top = 205 | ||
257 | + Width = 596 | ||
258 | + Height = 24 | ||
259 | + BevelInner = bvLowered | ||
256 | TabOrder = 3 | 260 | TabOrder = 3 |
257 | object lbMsg_Erro_Senha: TLabel | 261 | object lbMsg_Erro_Senha: TLabel |
258 | Left = 3 | 262 | Left = 3 |
259 | Top = 4 | 263 | Top = 4 |
260 | - Width = 479 | ||
261 | - Height = 15 | 264 | + Width = 589 |
265 | + Height = 17 | ||
262 | Alignment = taCenter | 266 | Alignment = taCenter |
263 | AutoSize = False | 267 | AutoSize = False |
264 | end | 268 | end |
265 | end | 269 | end |
266 | object pnVersao: TPanel | 270 | object pnVersao: TPanel |
267 | - Left = 458 | ||
268 | - Top = 142 | ||
269 | - Width = 56 | 271 | + Left = 513 |
272 | + Top = 267 | ||
273 | + Width = 90 | ||
270 | Height = 14 | 274 | Height = 14 |
271 | BevelOuter = bvLowered | 275 | BevelOuter = bvLowered |
272 | TabOrder = 4 | 276 | TabOrder = 4 |
273 | object lbVersao: TLabel | 277 | object lbVersao: TLabel |
274 | - Left = 7 | 278 | + Left = 4 |
275 | Top = 1 | 279 | Top = 1 |
276 | - Width = 41 | 280 | + Width = 85 |
277 | Height = 12 | 281 | Height = 12 |
282 | + Alignment = taCenter | ||
283 | + AutoSize = False | ||
278 | Caption = 'v: X.X.X.X' | 284 | Caption = 'v: X.X.X.X' |
279 | Font.Charset = DEFAULT_CHARSET | 285 | Font.Charset = DEFAULT_CHARSET |
280 | Font.Color = clWindowText | 286 | Font.Color = clWindowText |
@@ -284,11 +290,33 @@ object frmAcesso: TfrmAcesso | @@ -284,11 +290,33 @@ object frmAcesso: TfrmAcesso | ||
284 | ParentFont = False | 290 | ParentFont = False |
285 | end | 291 | end |
286 | end | 292 | end |
293 | + object pnNomeServidorWEB: TPanel | ||
294 | + Left = 1 | ||
295 | + Top = 267 | ||
296 | + Width = 90 | ||
297 | + Height = 14 | ||
298 | + BevelOuter = bvLowered | ||
299 | + TabOrder = 5 | ||
300 | + object lbNomeServidorWEB: TLabel | ||
301 | + Left = 3 | ||
302 | + Top = 1 | ||
303 | + Width = 83 | ||
304 | + Height = 12 | ||
305 | + Alignment = taCenter | ||
306 | + AutoSize = False | ||
307 | + Font.Charset = DEFAULT_CHARSET | ||
308 | + Font.Color = clWindowText | ||
309 | + Font.Height = -9 | ||
310 | + Font.Name = 'Arial' | ||
311 | + Font.Style = [fsBold] | ||
312 | + ParentFont = False | ||
313 | + end | ||
314 | + end | ||
287 | object tm_Mensagem: TTimer | 315 | object tm_Mensagem: TTimer |
288 | Enabled = False | 316 | Enabled = False |
289 | Interval = 5000 | 317 | Interval = 5000 |
290 | OnTimer = tm_MensagemTimer | 318 | OnTimer = tm_MensagemTimer |
291 | - Left = 240 | ||
292 | - Top = 120 | 319 | + Left = 282 |
320 | + Top = 241 | ||
293 | end | 321 | end |
294 | end | 322 | end |
mapa/acesso.pas
1 | +(** | ||
2 | +--------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
3 | +Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil | ||
4 | + | ||
5 | +Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais | ||
6 | + | ||
7 | +O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | ||
8 | +publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão. | ||
9 | + | ||
10 | +Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer | ||
11 | +MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | ||
12 | + | ||
13 | +Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software | ||
14 | +Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
15 | +--------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
16 | +*) | ||
17 | + | ||
1 | unit acesso; | 18 | unit acesso; |
2 | 19 | ||
3 | interface | 20 | interface |
@@ -21,6 +38,8 @@ type | @@ -21,6 +38,8 @@ type | ||
21 | pnVersao: TPanel; | 38 | pnVersao: TPanel; |
22 | lbVersao: TLabel; | 39 | lbVersao: TLabel; |
23 | tm_Mensagem: TTimer; | 40 | tm_Mensagem: TTimer; |
41 | + pnNomeServidorWEB: TPanel; | ||
42 | + lbNomeServidorWEB: TLabel; | ||
24 | procedure btAcessoClick(Sender: TObject); | 43 | procedure btAcessoClick(Sender: TObject); |
25 | procedure btCancelaClick(Sender: TObject); | 44 | procedure btCancelaClick(Sender: TObject); |
26 | procedure FormCreate(Sender: TObject); | 45 | procedure FormCreate(Sender: TObject); |
@@ -30,6 +49,7 @@ type | @@ -30,6 +49,7 @@ type | ||
30 | procedure edSenhaAcessoKeyUp(Sender: TObject; var Key: Word; | 49 | procedure edSenhaAcessoKeyUp(Sender: TObject; var Key: Word; |
31 | Shift: TShiftState); | 50 | Shift: TShiftState); |
32 | procedure tm_MensagemTimer(Sender: TObject); | 51 | procedure tm_MensagemTimer(Sender: TObject); |
52 | + procedure FormActivate(Sender: TObject); | ||
33 | private | 53 | private |
34 | { Private declarations } | 54 | { Private declarations } |
35 | public | 55 | public |
@@ -120,7 +140,17 @@ procedure TfrmAcesso.FormCreate(Sender: TObject); | @@ -120,7 +140,17 @@ procedure TfrmAcesso.FormCreate(Sender: TObject); | ||
120 | begin | 140 | begin |
121 | frmAcesso.lbVersao.Caption := 'v: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); | 141 | frmAcesso.lbVersao.Caption := 'v: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); |
122 | frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.strDatFileName); | 142 | frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.strDatFileName); |
143 | + frmMapaCacic.lbNomeServidorWEB.Caption := frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); | ||
123 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; | 144 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; |
145 | + if (frmMapaCacic.GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , frmMapaCacic.tStringsCipherOpened)='') then | ||
146 | + Begin | ||
147 | + frmMapaCacic.boolAcessoOK := false; | ||
148 | + MessageDLG(#13#10+'Atenção! É necessário executar as coletas do Sistema Cacic.' + #13#10 + #13#10 + | ||
149 | + 'Caso o Sistema Cacic já esteja instalado, clique com botão direito' + #13#10 + | ||
150 | + 'sobre o ícone da bandeja, escolha a opção "Executar Agora" e aguarde' + #13#10 + | ||
151 | + 'o fim do processo.',mtError,[mbOK],0); | ||
152 | + frmMapaCacic.Finalizar(false); | ||
153 | + End; | ||
124 | end; | 154 | end; |
125 | 155 | ||
126 | procedure TfrmAcesso.edNomeUsuarioAcessoKeyUp(Sender: TObject; | 156 | procedure TfrmAcesso.edNomeUsuarioAcessoKeyUp(Sender: TObject; |
@@ -155,4 +185,19 @@ begin | @@ -155,4 +185,19 @@ begin | ||
155 | lbMsg_Erro_Senha.Font.Color := clBlack; | 185 | lbMsg_Erro_Senha.Font.Color := clBlack; |
156 | end; | 186 | end; |
157 | 187 | ||
188 | +procedure TfrmAcesso.FormActivate(Sender: TObject); | ||
189 | +var strAux : String; | ||
190 | +begin | ||
191 | + strAux := frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); | ||
192 | + if not (strAux = '') then | ||
193 | + Begin | ||
194 | + frmAcesso.lbNomeServidorWEB.Caption := strAux; | ||
195 | + End | ||
196 | + else | ||
197 | + Begin | ||
198 | + frmMapaCacic.Mensagem('Favor verificar a instalação do Cacic.' +#13#10 + 'Não Existe Servidor de Aplicação configurado!',true); | ||
199 | + frmMapaCacic.Finalizar(true); | ||
200 | + End; | ||
201 | +end; | ||
202 | + | ||
158 | end. | 203 | end. |
mapa/main_mapa.dcu
No preview for this file type
mapa/main_mapa.dfm
@@ -477,15 +477,15 @@ object frmMapaCacic: TfrmMapaCacic | @@ -477,15 +477,15 @@ object frmMapaCacic: TfrmMapaCacic | ||
477 | end | 477 | end |
478 | end | 478 | end |
479 | object btGravarInformacoes: TButton | 479 | object btGravarInformacoes: TButton |
480 | - Left = 166 | 480 | + Left = 164 |
481 | Top = 240 | 481 | Top = 240 |
482 | Width = 275 | 482 | Width = 275 |
483 | Height = 30 | 483 | Height = 30 |
484 | Caption = 'Grava e Envia Informa'#231#245'es Patrimoniais' | 484 | Caption = 'Grava e Envia Informa'#231#245'es Patrimoniais' |
485 | Font.Charset = DEFAULT_CHARSET | 485 | Font.Charset = DEFAULT_CHARSET |
486 | Font.Color = clWindowText | 486 | Font.Color = clWindowText |
487 | - Font.Height = -11 | ||
488 | - Font.Name = 'MS Sans Serif' | 487 | + Font.Height = -13 |
488 | + Font.Name = 'Arial' | ||
489 | Font.Style = [fsBold] | 489 | Font.Style = [fsBold] |
490 | ParentFont = False | 490 | ParentFont = False |
491 | TabOrder = 2 | 491 | TabOrder = 2 |
@@ -493,17 +493,19 @@ object frmMapaCacic: TfrmMapaCacic | @@ -493,17 +493,19 @@ object frmMapaCacic: TfrmMapaCacic | ||
493 | OnClick = AtualizaPatrimonio | 493 | OnClick = AtualizaPatrimonio |
494 | end | 494 | end |
495 | object pnVersao: TPanel | 495 | object pnVersao: TPanel |
496 | - Left = 547 | 496 | + Left = 513 |
497 | Top = 267 | 497 | Top = 267 |
498 | - Width = 56 | 498 | + Width = 90 |
499 | Height = 14 | 499 | Height = 14 |
500 | BevelOuter = bvLowered | 500 | BevelOuter = bvLowered |
501 | TabOrder = 3 | 501 | TabOrder = 3 |
502 | object lbVersao: TLabel | 502 | object lbVersao: TLabel |
503 | - Left = 7 | 503 | + Left = 4 |
504 | Top = 1 | 504 | Top = 1 |
505 | - Width = 41 | 505 | + Width = 82 |
506 | Height = 12 | 506 | Height = 12 |
507 | + Alignment = taCenter | ||
508 | + AutoSize = False | ||
507 | Caption = 'v: X.X.X.X' | 509 | Caption = 'v: X.X.X.X' |
508 | Font.Charset = DEFAULT_CHARSET | 510 | Font.Charset = DEFAULT_CHARSET |
509 | Font.Color = clWindowText | 511 | Font.Color = clWindowText |
@@ -514,16 +516,17 @@ object frmMapaCacic: TfrmMapaCacic | @@ -514,16 +516,17 @@ object frmMapaCacic: TfrmMapaCacic | ||
514 | end | 516 | end |
515 | end | 517 | end |
516 | object pnMensagens: TPanel | 518 | object pnMensagens: TPanel |
517 | - Left = 5 | ||
518 | - Top = 205 | ||
519 | - Width = 595 | 519 | + Left = 4 |
520 | + Top = 204 | ||
521 | + Width = 596 | ||
520 | Height = 22 | 522 | Height = 22 |
523 | + BevelInner = bvLowered | ||
521 | TabOrder = 4 | 524 | TabOrder = 4 |
522 | object lbMensagens: TLabel | 525 | object lbMensagens: TLabel |
523 | - Left = 1 | ||
524 | - Top = 1 | ||
525 | - Width = 593 | ||
526 | - Height = 20 | 526 | + Left = 2 |
527 | + Top = 2 | ||
528 | + Width = 592 | ||
529 | + Height = 18 | ||
527 | Align = alClient | 530 | Align = alClient |
528 | Alignment = taCenter | 531 | Alignment = taCenter |
529 | AutoSize = False | 532 | AutoSize = False |
@@ -535,4 +538,26 @@ object frmMapaCacic: TfrmMapaCacic | @@ -535,4 +538,26 @@ object frmMapaCacic: TfrmMapaCacic | ||
535 | ParentFont = False | 538 | ParentFont = False |
536 | end | 539 | end |
537 | end | 540 | end |
541 | + object pnNomeServidorWEB: TPanel | ||
542 | + Left = 1 | ||
543 | + Top = 267 | ||
544 | + Width = 90 | ||
545 | + Height = 14 | ||
546 | + BevelOuter = bvLowered | ||
547 | + TabOrder = 5 | ||
548 | + object lbNomeServidorWEB: TLabel | ||
549 | + Left = 3 | ||
550 | + Top = 1 | ||
551 | + Width = 83 | ||
552 | + Height = 12 | ||
553 | + Alignment = taCenter | ||
554 | + AutoSize = False | ||
555 | + Font.Charset = DEFAULT_CHARSET | ||
556 | + Font.Color = clWindowText | ||
557 | + Font.Height = -9 | ||
558 | + Font.Name = 'Arial' | ||
559 | + Font.Style = [fsBold] | ||
560 | + ParentFont = False | ||
561 | + end | ||
562 | + end | ||
538 | end | 563 | end |
mapa/main_mapa.pas
@@ -38,18 +38,19 @@ uses IniFiles, | @@ -38,18 +38,19 @@ uses IniFiles, | ||
38 | Classes, | 38 | Classes, |
39 | Forms, | 39 | Forms, |
40 | PJVersionInfo, | 40 | PJVersionInfo, |
41 | - DIALOGS, | ||
42 | DCPcrypt2, | 41 | DCPcrypt2, |
43 | DCPrijndael, | 42 | DCPrijndael, |
44 | DCPbase64, | 43 | DCPbase64, |
45 | ExtCtrls, | 44 | ExtCtrls, |
46 | - Graphics; | 45 | + Graphics, |
46 | + dialogs; | ||
47 | 47 | ||
48 | var strCipherClosed, | 48 | var strCipherClosed, |
49 | strCipherOpened, | 49 | strCipherOpened, |
50 | strPathCacic : string; | 50 | strPathCacic : string; |
51 | 51 | ||
52 | -var boolDebugs : boolean; | 52 | +var boolDebugs, |
53 | + boolUON2 : boolean; | ||
53 | 54 | ||
54 | 55 | ||
55 | // Some constants that are dependant on the cipher being used | 56 | // Some constants that are dependant on the cipher being used |
@@ -95,6 +96,8 @@ type | @@ -95,6 +96,8 @@ type | ||
95 | lbVersao: TLabel; | 96 | lbVersao: TLabel; |
96 | pnMensagens: TPanel; | 97 | pnMensagens: TPanel; |
97 | lbMensagens: TLabel; | 98 | lbMensagens: TLabel; |
99 | + pnNomeServidorWEB: TPanel; | ||
100 | + lbNomeServidorWEB: TLabel; | ||
98 | 101 | ||
99 | procedure mapa; | 102 | procedure mapa; |
100 | procedure Grava_Debugs(strMsg : String); | 103 | procedure Grava_Debugs(strMsg : String); |
@@ -575,7 +578,7 @@ Begin | @@ -575,7 +578,7 @@ Begin | ||
575 | idHTTP1.Free; | 578 | idHTTP1.Free; |
576 | log_DEBUG('Retorno: "'+Response_CS.DataString+'"'); | 579 | log_DEBUG('Retorno: "'+Response_CS.DataString+'"'); |
577 | Except | 580 | Except |
578 | - Mensagem('ERRO! Comunicação impossível com o endereço ' + strEndereco + Response_CS.DataString,true); | 581 | + Mensagem('ERRO! Comunicação impossível com o endereço ' + strEndereco + ': '+Response_CS.DataString,true); |
579 | result := '0'; | 582 | result := '0'; |
580 | Exit; | 583 | Exit; |
581 | end; | 584 | end; |
@@ -687,29 +690,29 @@ var | @@ -687,29 +690,29 @@ var | ||
687 | l_Data, l_Key, l_IV : string; | 690 | l_Data, l_Key, l_IV : string; |
688 | begin | 691 | begin |
689 | Try | 692 | Try |
690 | - // Pad Key, IV and Data with zeros as appropriate | ||
691 | - l_Key := PadWithZeros(constCipherKey,constKeySize); | ||
692 | - l_IV := PadWithZeros(constIV,constBlockSize); | ||
693 | - l_Data := PadWithZeros(p_Data,constBlockSize); | ||
694 | - | ||
695 | - // Create the cipher and initialise according to the key length | ||
696 | - l_Cipher := TDCP_rijndael.Create(nil); | ||
697 | - if Length(constCipherKey) <= 16 then | ||
698 | - l_Cipher.Init(l_Key[1],128,@l_IV[1]) | ||
699 | - else if Length(constCipherKey) <= 24 then | ||
700 | - l_Cipher.Init(l_Key[1],192,@l_IV[1]) | ||
701 | - else | ||
702 | - l_Cipher.Init(l_Key[1],256,@l_IV[1]); | ||
703 | - | ||
704 | - // Encrypt the data | ||
705 | - l_Cipher.EncryptCBC(l_Data[1],l_Data[1],Length(l_Data)); | ||
706 | - | ||
707 | - // Free the cipher and clear sensitive information | ||
708 | - l_Cipher.Free; | ||
709 | - FillChar(l_Key[1],Length(l_Key),0); | ||
710 | - | ||
711 | - // Return the Base64 encoded result | ||
712 | - Result := Base64EncodeStr(l_Data); | 693 | + // Pad Key, IV and Data with zeros as appropriate |
694 | + l_Key := PadWithZeros(constCipherKey,constKeySize); | ||
695 | + l_IV := PadWithZeros(constIV,constBlockSize); | ||
696 | + l_Data := PadWithZeros(p_Data,constBlockSize); | ||
697 | + | ||
698 | + // Create the cipher and initialise according to the key length | ||
699 | + l_Cipher := TDCP_rijndael.Create(nil); | ||
700 | + if Length(constCipherKey) <= 16 then | ||
701 | + l_Cipher.Init(l_Key[1],128,@l_IV[1]) | ||
702 | + else if Length(constCipherKey) <= 24 then | ||
703 | + l_Cipher.Init(l_Key[1],192,@l_IV[1]) | ||
704 | + else | ||
705 | + l_Cipher.Init(l_Key[1],256,@l_IV[1]); | ||
706 | + | ||
707 | + // Encrypt the data | ||
708 | + l_Cipher.EncryptCBC(l_Data[1],l_Data[1],Length(l_Data)); | ||
709 | + | ||
710 | + // Free the cipher and clear sensitive information | ||
711 | + l_Cipher.Free; | ||
712 | + FillChar(l_Key[1],Length(l_Key),0); | ||
713 | + | ||
714 | + // Return the Base64 encoded result | ||
715 | + Result := Base64EncodeStr(l_Data); | ||
713 | Except | 716 | Except |
714 | log_diario('Erro no Processo de Criptografia'); | 717 | log_diario('Erro no Processo de Criptografia'); |
715 | End; | 718 | End; |
@@ -721,31 +724,31 @@ var | @@ -721,31 +724,31 @@ var | ||
721 | l_Data, l_Key, l_IV : string; | 724 | l_Data, l_Key, l_IV : string; |
722 | begin | 725 | begin |
723 | Try | 726 | Try |
724 | - // Pad Key and IV with zeros as appropriate | ||
725 | - l_Key := PadWithZeros(constCipherKey,constKeySize); | ||
726 | - l_IV := PadWithZeros(constIV,constBlockSize); | ||
727 | - | ||
728 | - // Decode the Base64 encoded string | ||
729 | - l_Data := Base64DecodeStr(p_Data); | ||
730 | - | ||
731 | - // Create the cipher and initialise according to the key length | ||
732 | - l_Cipher := TDCP_rijndael.Create(nil); | ||
733 | - if Length(constCipherKey) <= 16 then | ||
734 | - l_Cipher.Init(l_Key[1],128,@l_IV[1]) | ||
735 | - else if Length(constCipherKey) <= 24 then | ||
736 | - l_Cipher.Init(l_Key[1],192,@l_IV[1]) | ||
737 | - else | ||
738 | - l_Cipher.Init(l_Key[1],256,@l_IV[1]); | ||
739 | - | ||
740 | - // Decrypt the data | ||
741 | - l_Cipher.DecryptCBC(l_Data[1],l_Data[1],Length(l_Data)); | ||
742 | - | ||
743 | - // Free the cipher and clear sensitive information | ||
744 | - l_Cipher.Free; | ||
745 | - FillChar(l_Key[1],Length(l_Key),0); | ||
746 | - log_DEBUG('DeCriptografia(ATIVADA) de "'+p_Data+'" => "'+l_Data+'"'); | ||
747 | - // Return the result | ||
748 | - Result := trim(l_Data); | 727 | + // Pad Key and IV with zeros as appropriate |
728 | + l_Key := PadWithZeros(constCipherKey,constKeySize); | ||
729 | + l_IV := PadWithZeros(constIV,constBlockSize); | ||
730 | + | ||
731 | + // Decode the Base64 encoded string | ||
732 | + l_Data := Base64DecodeStr(p_Data); | ||
733 | + | ||
734 | + // Create the cipher and initialise according to the key length | ||
735 | + l_Cipher := TDCP_rijndael.Create(nil); | ||
736 | + if Length(constCipherKey) <= 16 then | ||
737 | + l_Cipher.Init(l_Key[1],128,@l_IV[1]) | ||
738 | + else if Length(constCipherKey) <= 24 then | ||
739 | + l_Cipher.Init(l_Key[1],192,@l_IV[1]) | ||
740 | + else | ||
741 | + l_Cipher.Init(l_Key[1],256,@l_IV[1]); | ||
742 | + | ||
743 | + // Decrypt the data | ||
744 | + l_Cipher.DecryptCBC(l_Data[1],l_Data[1],Length(l_Data)); | ||
745 | + | ||
746 | + // Free the cipher and clear sensitive information | ||
747 | + l_Cipher.Free; | ||
748 | + FillChar(l_Key[1],Length(l_Key),0); | ||
749 | + log_DEBUG('DeCriptografia(ATIVADA) de "'+p_Data+'" => "'+l_Data+'"'); | ||
750 | + // Return the result | ||
751 | + Result := trim(l_Data); | ||
749 | Except | 752 | Except |
750 | log_diario('Erro no Processo de Decriptografia'); | 753 | log_diario('Erro no Processo de Decriptografia'); |
751 | End; | 754 | End; |
@@ -755,45 +758,45 @@ function TfrmMapaCacic.HomeDrive : string; | @@ -755,45 +758,45 @@ function TfrmMapaCacic.HomeDrive : string; | ||
755 | var | 758 | var |
756 | WinDir : array [0..144] of char; | 759 | WinDir : array [0..144] of char; |
757 | begin | 760 | begin |
758 | -GetWindowsDirectory (WinDir, 144); | ||
759 | -Result := StrPas (WinDir); | 761 | + GetWindowsDirectory (WinDir, 144); |
762 | + Result := StrPas (WinDir); | ||
760 | end; | 763 | end; |
761 | 764 | ||
762 | Function TfrmMapaCacic.Implode(p_Array : TStrings ; p_Separador : String) : String; | 765 | Function TfrmMapaCacic.Implode(p_Array : TStrings ; p_Separador : String) : String; |
763 | var intAux : integer; | 766 | var intAux : integer; |
764 | strAux : string; | 767 | strAux : string; |
765 | Begin | 768 | Begin |
766 | - strAux := ''; | ||
767 | - For intAux := 0 To p_Array.Count -1 do | ||
768 | - Begin | ||
769 | - if (strAux<>'') then strAux := strAux + p_Separador; | ||
770 | - strAux := strAux + p_Array[intAux]; | ||
771 | - End; | ||
772 | - Implode := strAux; | 769 | + strAux := ''; |
770 | + For intAux := 0 To p_Array.Count -1 do | ||
771 | + Begin | ||
772 | + if (strAux<>'') then strAux := strAux + p_Separador; | ||
773 | + strAux := strAux + p_Array[intAux]; | ||
774 | + End; | ||
775 | + Implode := strAux; | ||
773 | end; | 776 | end; |
774 | 777 | ||
775 | Function TfrmMapaCacic.CipherClose(p_DatFileName : string; p_tstrCipherOpened : TStrings) : String; | 778 | Function TfrmMapaCacic.CipherClose(p_DatFileName : string; p_tstrCipherOpened : TStrings) : String; |
776 | var strCipherOpenImploded : string; | 779 | var strCipherOpenImploded : string; |
777 | txtFileDatFile : TextFile; | 780 | txtFileDatFile : TextFile; |
778 | begin | 781 | begin |
779 | - try | ||
780 | - FileSetAttr (p_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000 | ||
781 | - AssignFile(txtFileDatFile,p_DatFileName); {Associa o arquivo a uma variável do tipo TextFile} | 782 | + try |
783 | + FileSetAttr (p_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000 | ||
784 | + AssignFile(txtFileDatFile,p_DatFileName); {Associa o arquivo a uma variável do tipo TextFile} | ||
782 | 785 | ||
783 | - // Criação do arquivo .DAT | ||
784 | - Rewrite (txtFileDatFile); | ||
785 | - Append(txtFileDatFile); | 786 | + // Criação do arquivo .DAT |
787 | + Rewrite (txtFileDatFile); | ||
788 | + Append(txtFileDatFile); | ||
786 | 789 | ||
787 | - strCipherOpenImploded := Implode(p_tstrCipherOpened,'=CacicIsFree='); | ||
788 | - log_DEBUG('Rotina de Fechamento do cacic2.dat ATIVANDO criptografia.'); | ||
789 | - strCipherClosed := EnCrypt(strCipherOpenImploded); | ||
790 | - log_DEBUG('Rotina de Fechamento do cacic2.dat RESTAURANDO estado da criptografia.'); | 790 | + strCipherOpenImploded := Implode(p_tstrCipherOpened,'=CacicIsFree='); |
791 | + log_DEBUG('Rotina de Fechamento do cacic2.dat ATIVANDO criptografia.'); | ||
792 | + strCipherClosed := EnCrypt(strCipherOpenImploded); | ||
793 | + log_DEBUG('Rotina de Fechamento do cacic2.dat RESTAURANDO estado da criptografia.'); | ||
791 | 794 | ||
792 | - Writeln(txtFileDatFile,strCipherClosed); {Grava a string Texto no arquivo texto} | 795 | + Writeln(txtFileDatFile,strCipherClosed); {Grava a string Texto no arquivo texto} |
793 | 796 | ||
794 | - CloseFile(txtFileDatFile); | ||
795 | - except | ||
796 | - end; | 797 | + CloseFile(txtFileDatFile); |
798 | + except | ||
799 | + end; | ||
797 | end; | 800 | end; |
798 | function TfrmMapaCacic.GetWinVer: Integer; | 801 | function TfrmMapaCacic.GetWinVer: Integer; |
799 | const | 802 | const |
@@ -1067,7 +1070,6 @@ begin | @@ -1067,7 +1070,6 @@ begin | ||
1067 | 1070 | ||
1068 | // Código para montar o combo 2 | 1071 | // Código para montar o combo 2 |
1069 | Parser.StartScan; | 1072 | Parser.StartScan; |
1070 | - | ||
1071 | v_Tag := false; | 1073 | v_Tag := false; |
1072 | i := -1; | 1074 | i := -1; |
1073 | While Parser.Scan DO | 1075 | While Parser.Scan DO |
@@ -1079,9 +1081,15 @@ begin | @@ -1079,9 +1081,15 @@ begin | ||
1079 | SetLength(VetorUON2, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos. | 1081 | SetLength(VetorUON2, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos. |
1080 | end | 1082 | end |
1081 | else if (Parser.CurPartType in [ptContent, ptCData]) and v_Tag Then | 1083 | else if (Parser.CurPartType in [ptContent, ptCData]) and v_Tag Then |
1082 | - if (UpperCase(Parser.CurName) = 'ID1') then VetorUON2[i].id1 := DeCrypt(Parser.CurContent) | ||
1083 | - else if (UpperCase(Parser.CurName) = 'ID2') then VetorUON2[i].id2 := DeCrypt(Parser.CurContent) | ||
1084 | - else if (UpperCase(Parser.CurName) = 'NM2') then VetorUON2[i].nm2 := DeCrypt(Parser.CurContent); | 1084 | + Begin |
1085 | + boolUON2 := true; | ||
1086 | + if (UpperCase(Parser.CurName) = 'ID1') then | ||
1087 | + VetorUON2[i].id1 := DeCrypt(Parser.CurContent) | ||
1088 | + else if (UpperCase(Parser.CurName) = 'ID2') then | ||
1089 | + VetorUON2[i].id2 := DeCrypt(Parser.CurContent) | ||
1090 | + else if (UpperCase(Parser.CurName) = 'NM2') then | ||
1091 | + VetorUON2[i].nm2 := DeCrypt(Parser.CurContent); | ||
1092 | + End; | ||
1085 | end; | 1093 | end; |
1086 | Parser.Free; | 1094 | Parser.Free; |
1087 | // Como os itens do combo1 nunca mudam durante a execução do programa (ao contrario do combo2), posso colocar o seu preenchimento aqui mesmo. | 1095 | // Como os itens do combo1 nunca mudam durante a execução do programa (ao contrario do combo2), posso colocar o seu preenchimento aqui mesmo. |
@@ -1095,21 +1103,29 @@ procedure TfrmMapaCacic.cb_id_unid_organizacional_nivel1Change(Sender: TObject); | @@ -1095,21 +1103,29 @@ procedure TfrmMapaCacic.cb_id_unid_organizacional_nivel1Change(Sender: TObject); | ||
1095 | var i, j: Word; | 1103 | var i, j: Word; |
1096 | strAux : String; | 1104 | strAux : String; |
1097 | begin | 1105 | begin |
1098 | - // Filtro os itens do combo2, de acordo com o item selecionado no combo1 | ||
1099 | - strAux := VetorUON1[cb_id_unid_organizacional_nivel1.ItemIndex].id1; | 1106 | + if boolUON2 then |
1107 | + Begin | ||
1108 | + // Filtro os itens do combo2, de acordo com o item selecionado no combo1 | ||
1109 | + strAux := VetorUON1[cb_id_unid_organizacional_nivel1.ItemIndex].id1; | ||
1110 | + cb_id_unid_organizacional_nivel2.Items.Clear; | ||
1111 | + SetLength(VetorUON2Filtrado, 0); | ||
1100 | 1112 | ||
1101 | - cb_id_unid_organizacional_nivel2.Items.Clear; | ||
1102 | - SetLength(VetorUON2Filtrado, 0); | ||
1103 | - For i := 0 to Length(VetorUON2) - 1 Do | ||
1104 | - Begin | ||
1105 | - if VetorUON2[i].id1 = strAux then | ||
1106 | - Begin | ||
1107 | - cb_id_unid_organizacional_nivel2.Items.Add(VetorUON2[i].nm2); | ||
1108 | - j := Length(VetorUON2Filtrado); | ||
1109 | - SetLength(VetorUON2Filtrado, j + 1); | ||
1110 | - VetorUON2Filtrado[j] := VetorUON2[i].id2; | ||
1111 | - end; | ||
1112 | - end; | 1113 | + For i := 0 to Length(VetorUON2) - 1 Do |
1114 | + Begin | ||
1115 | + Try | ||
1116 | + if VetorUON2[i].id1 = strAux then | ||
1117 | + Begin | ||
1118 | + cb_id_unid_organizacional_nivel2.Items.Add(VetorUON2[i].nm2); | ||
1119 | + j := Length(VetorUON2Filtrado); | ||
1120 | + SetLength(VetorUON2Filtrado, j + 1); | ||
1121 | + VetorUON2Filtrado[j] := VetorUON2[i].id2; | ||
1122 | + end; | ||
1123 | + Except | ||
1124 | + End; | ||
1125 | + end; | ||
1126 | + End | ||
1127 | + else | ||
1128 | + Mensagem('ATENÇÃO! Não Existe '+frmMapaCacic.lbEtiqueta2.Caption+' Associado a '+VetorUON1[cb_id_unid_organizacional_nivel1.ItemIndex].nm1+'. Procure um supervisor do sistema.',true); | ||
1113 | end; | 1129 | end; |
1114 | 1130 | ||
1115 | 1131 | ||
@@ -1263,7 +1279,7 @@ end; | @@ -1263,7 +1279,7 @@ end; | ||
1263 | 1279 | ||
1264 | procedure TfrmMapaCacic.FormClose(Sender: TObject; var Action: TCloseAction); | 1280 | procedure TfrmMapaCacic.FormClose(Sender: TObject; var Action: TCloseAction); |
1265 | begin | 1281 | begin |
1266 | -Sair; | 1282 | + Finalizar(true); |
1267 | end; | 1283 | end; |
1268 | // Função adaptada de http://www.latiumsoftware.com/en/delphi/00004.php | 1284 | // Função adaptada de http://www.latiumsoftware.com/en/delphi/00004.php |
1269 | //Para buscar do RegEdit... | 1285 | //Para buscar do RegEdit... |
@@ -1450,6 +1466,7 @@ begin | @@ -1450,6 +1466,7 @@ begin | ||
1450 | strConfigs := GetValorDatMemoria('Patrimonio.Configs', frmMapaCacic.tStringsCipherOpened); | 1466 | strConfigs := GetValorDatMemoria('Patrimonio.Configs', frmMapaCacic.tStringsCipherOpened); |
1451 | gbLeiaComAtencao.Visible := true; | 1467 | gbLeiaComAtencao.Visible := true; |
1452 | gbInformacoesSobreComputador.Visible := true; | 1468 | gbInformacoesSobreComputador.Visible := true; |
1469 | + boolUON2 := false; // Inicializo com false e torno true quando da montagem da combo de UON2... | ||
1453 | MontaCombos(strConfigs); | 1470 | MontaCombos(strConfigs); |
1454 | RecuperaValoresAnteriores(strConfigs); | 1471 | RecuperaValoresAnteriores(strConfigs); |
1455 | MontaInterface(strConfigs); | 1472 | MontaInterface(strConfigs); |
@@ -1464,7 +1481,7 @@ var intAux : integer; | @@ -1464,7 +1481,7 @@ var intAux : integer; | ||
1464 | strRetorno : String; | 1481 | strRetorno : String; |
1465 | Request_mapa : TStringList; | 1482 | Request_mapa : TStringList; |
1466 | begin | 1483 | begin |
1467 | - frmMapaCacic.lbVersao.Caption := 'v: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); | 1484 | + frmMapaCacic.lbVersao.Caption := 'v: ' + frmMapaCacic.GetVersionInfo(ParamStr(0)); |
1468 | if (GetWinVer > 5) and not IsAdmin then | 1485 | if (GetWinVer > 5) and not IsAdmin then |
1469 | Begin | 1486 | Begin |
1470 | MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); | 1487 | MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); |
@@ -1477,7 +1494,7 @@ begin | @@ -1477,7 +1494,7 @@ begin | ||
1477 | strPathCacic := ''; | 1494 | strPathCacic := ''; |
1478 | for intAux := 1 to length(strLetrasDrives) do | 1495 | for intAux := 1 to length(strLetrasDrives) do |
1479 | Begin | 1496 | Begin |
1480 | - lbMensagens.Caption := 'Procurando Estrutura CACIC em "'+strLetrasDrives[intAux] + ':\"'; | 1497 | + lbMensagens.Caption := 'Procurando Estrutura do Sistema CACIC em "'+strLetrasDrives[intAux] + ':\"'; |
1481 | 1498 | ||
1482 | Log_Debug('Testando "'+strLetrasDrives[intAux] + ':\Cacic\cacic2.dat'+'"'); | 1499 | Log_Debug('Testando "'+strLetrasDrives[intAux] + ':\Cacic\cacic2.dat'+'"'); |
1483 | if (strPathCacic='') and (SearchFile(strLetrasDrives[intAux] + ':','\Cacic\cacic2.dat')) then | 1500 | if (strPathCacic='') and (SearchFile(strLetrasDrives[intAux] + ':','\Cacic\cacic2.dat')) then |
@@ -1514,7 +1531,7 @@ begin | @@ -1514,7 +1531,7 @@ begin | ||
1514 | else | 1531 | else |
1515 | Begin | 1532 | Begin |
1516 | pnMensagens.Visible := true; | 1533 | pnMensagens.Visible := true; |
1517 | - Mensagem('Efetuando Comunicação com o Módulo Gerente WEB...',false); | 1534 | + Mensagem('Efetuando Comunicação com o Módulo Gerente WEB em "'+GetValorDatMemoria('Configs.EnderecoServidor', tStringsCipherOpened)+'"...',false); |
1518 | frmAcesso.Free; | 1535 | frmAcesso.Free; |
1519 | 1536 | ||
1520 | // Povoamento com dados de configurações da interface patrimonial | 1537 | // Povoamento com dados de configurações da interface patrimonial |
@@ -1528,9 +1545,10 @@ begin | @@ -1528,9 +1545,10 @@ begin | ||
1528 | Request_mapa.Values['te_workgroup'] := frmMapaCacic.EnCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); | 1545 | Request_mapa.Values['te_workgroup'] := frmMapaCacic.EnCrypt(frmMapaCacic.GetValorDatMemoria('TcpIp.TE_WORKGROUP' , frmMapaCacic.tStringsCipherOpened)); |
1529 | 1546 | ||
1530 | strRetorno := frmMapaCacic.ComunicaServidor('mapa_get_patrimonio.php', Request_mapa, '.'); | 1547 | strRetorno := frmMapaCacic.ComunicaServidor('mapa_get_patrimonio.php', Request_mapa, '.'); |
1548 | + | ||
1531 | if (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then | 1549 | if (frmMapaCacic.XML_RetornaValor('STATUS', strRetorno)='OK') then |
1532 | Begin | 1550 | Begin |
1533 | - Mensagem('Comunicação Efetuada com Sucesso! Salvando Configurações Obtidas...',true); | 1551 | + Mensagem('Comunicação Efetuada com Sucesso! Salvando Configurações Obtidas...',false); |
1534 | frmMapaCacic.SetValorDatMemoria('Patrimonio.Configs', strRetorno, frmMapaCacic.tStringsCipherOpened) | 1552 | frmMapaCacic.SetValorDatMemoria('Patrimonio.Configs', strRetorno, frmMapaCacic.tStringsCipherOpened) |
1535 | End | 1553 | End |
1536 | else | 1554 | else |
@@ -1548,8 +1566,8 @@ begin | @@ -1548,8 +1566,8 @@ begin | ||
1548 | else | 1566 | else |
1549 | Begin | 1567 | Begin |
1550 | lbMensagens.Caption := 'Estrutura CACIC não Encontrada!'; | 1568 | lbMensagens.Caption := 'Estrutura CACIC não Encontrada!'; |
1551 | - application.ProcessMessages; | ||
1552 | - MessageDLG(#13#10+'Não Encontrei a Estrutura do Sistema CACIC!'+#13#10+ | 1569 | + application.ProcessMessages; |
1570 | + MessageDLG(#13#10+'Não Encontrei a Estrutura do Sistema CACIC!'+#13#10#13#10+ | ||
1553 | 'Operação Abortada!',mtError,[mbOK],0); | 1571 | 'Operação Abortada!',mtError,[mbOK],0); |
1554 | Sair; | 1572 | Sair; |
1555 | End; | 1573 | End; |
mapa/mapacacic.dof
@@ -115,7 +115,7 @@ AutoIncBuild=0 | @@ -115,7 +115,7 @@ AutoIncBuild=0 | ||
115 | MajorVer=1 | 115 | MajorVer=1 |
116 | MinorVer=0 | 116 | MinorVer=0 |
117 | Release=0 | 117 | Release=0 |
118 | -Build=1 | 118 | +Build=3 |
119 | Debug=0 | 119 | Debug=0 |
120 | PreRelease=0 | 120 | PreRelease=0 |
121 | Special=0 | 121 | Special=0 |
@@ -126,7 +126,7 @@ CodePage=1252 | @@ -126,7 +126,7 @@ CodePage=1252 | ||
126 | [Version Info Keys] | 126 | [Version Info Keys] |
127 | CompanyName=Dataprev-ES | 127 | CompanyName=Dataprev-ES |
128 | FileDescription=MapaCacic - Módulo Avulso para Coleta de Informações Patrimoniais para o Sistema CACIC | 128 | FileDescription=MapaCacic - Módulo Avulso para Coleta de Informações Patrimoniais para o Sistema CACIC |
129 | -FileVersion=1.0.0.1 | 129 | +FileVersion=1.0.0.3 |
130 | InternalName= | 130 | InternalName= |
131 | LegalCopyright= | 131 | LegalCopyright= |
132 | LegalTrademarks= | 132 | LegalTrademarks= |
mapa/mapacacic.res
No preview for this file type
vacon/main_VACON.dcu
No preview for this file type
vacon/main_VACON.dfm
1 | object FormVACON: TFormVACON | 1 | object FormVACON: TFormVACON |
2 | - Left = 6 | ||
3 | - Top = 5 | ||
4 | - Width = 772 | ||
5 | - Height = 543 | 2 | + Left = 135 |
3 | + Top = 8 | ||
4 | + Width = 767 | ||
5 | + Height = 652 | ||
6 | Caption = 'VACON - Visualizador de Arquivo de Configura'#231#227'o CACIC2.DAT' | 6 | Caption = 'VACON - Visualizador de Arquivo de Configura'#231#227'o CACIC2.DAT' |
7 | Color = clBtnFace | 7 | Color = clBtnFace |
8 | Font.Charset = DEFAULT_CHARSET | 8 | Font.Charset = DEFAULT_CHARSET |
@@ -12,14 +12,14 @@ object FormVACON: TFormVACON | @@ -12,14 +12,14 @@ object FormVACON: TFormVACON | ||
12 | Font.Style = [] | 12 | Font.Style = [] |
13 | FormStyle = fsStayOnTop | 13 | FormStyle = fsStayOnTop |
14 | OldCreateOrder = False | 14 | OldCreateOrder = False |
15 | + Position = poDesktopCenter | ||
15 | Visible = True | 16 | Visible = True |
16 | - WindowState = wsMaximized | ||
17 | OnCreate = FormCreate | 17 | OnCreate = FormCreate |
18 | PixelsPerInch = 96 | 18 | PixelsPerInch = 96 |
19 | TextHeight = 13 | 19 | TextHeight = 13 |
20 | object Label1: TLabel | 20 | object Label1: TLabel |
21 | - Left = 24 | ||
22 | - Top = 57 | 21 | + Left = 19 |
22 | + Top = 48 | ||
23 | Width = 5 | 23 | Width = 5 |
24 | Height = 13 | 24 | Height = 13 |
25 | Font.Charset = DEFAULT_CHARSET | 25 | Font.Charset = DEFAULT_CHARSET |
@@ -30,18 +30,18 @@ object FormVACON: TFormVACON | @@ -30,18 +30,18 @@ object FormVACON: TFormVACON | ||
30 | ParentFont = False | 30 | ParentFont = False |
31 | end | 31 | end |
32 | object Memo1: TMemo | 32 | object Memo1: TMemo |
33 | - Left = 6 | ||
34 | - Top = 72 | 33 | + Left = 0 |
34 | + Top = 46 | ||
35 | Width = 754 | 35 | Width = 754 |
36 | - Height = 437 | 36 | + Height = 549 |
37 | Lines.Strings = ( | 37 | Lines.Strings = ( |
38 | '') | 38 | '') |
39 | ScrollBars = ssBoth | 39 | ScrollBars = ssBoth |
40 | TabOrder = 0 | 40 | TabOrder = 0 |
41 | end | 41 | end |
42 | object Bt_Sair: TButton | 42 | object Bt_Sair: TButton |
43 | - Left = 649 | ||
44 | - Top = 20 | 43 | + Left = 644 |
44 | + Top = 6 | ||
45 | Width = 110 | 45 | Width = 110 |
46 | Height = 35 | 46 | Height = 35 |
47 | Caption = 'Sair' | 47 | Caption = 'Sair' |
@@ -55,9 +55,9 @@ object FormVACON: TFormVACON | @@ -55,9 +55,9 @@ object FormVACON: TFormVACON | ||
55 | OnClick = Bt_SairClick | 55 | OnClick = Bt_SairClick |
56 | end | 56 | end |
57 | object Bt_Abrir_Outro: TButton | 57 | object Bt_Abrir_Outro: TButton |
58 | - Left = 476 | ||
59 | - Top = 20 | ||
60 | - Width = 159 | 58 | + Left = 467 |
59 | + Top = 6 | ||
60 | + Width = 163 | ||
61 | Height = 35 | 61 | Height = 35 |
62 | Caption = 'Abrir Outro Arquivo...' | 62 | Caption = 'Abrir Outro Arquivo...' |
63 | Font.Charset = DEFAULT_CHARSET | 63 | Font.Charset = DEFAULT_CHARSET |
@@ -71,10 +71,10 @@ object FormVACON: TFormVACON | @@ -71,10 +71,10 @@ object FormVACON: TFormVACON | ||
71 | OnClick = Bt_Abrir_OutroClick | 71 | OnClick = Bt_Abrir_OutroClick |
72 | end | 72 | end |
73 | object GB_Chave: TGroupBox | 73 | object GB_Chave: TGroupBox |
74 | - Left = 259 | ||
75 | - Top = 174 | ||
76 | - Width = 265 | ||
77 | - Height = 163 | 74 | + Left = 254 |
75 | + Top = 165 | ||
76 | + Width = 264 | ||
77 | + Height = 220 | ||
78 | Color = clActiveBorder | 78 | Color = clActiveBorder |
79 | ParentColor = False | 79 | ParentColor = False |
80 | TabOrder = 3 | 80 | TabOrder = 3 |
@@ -94,7 +94,7 @@ object FormVACON: TFormVACON | @@ -94,7 +94,7 @@ object FormVACON: TFormVACON | ||
94 | end | 94 | end |
95 | object Lb_Chave_Separadora: TLabel | 95 | object Lb_Chave_Separadora: TLabel |
96 | Left = 8 | 96 | Left = 8 |
97 | - Top = 62 | 97 | + Top = 77 |
98 | Width = 173 | 98 | Width = 173 |
99 | Height = 16 | 99 | Height = 16 |
100 | Caption = 'Informe a Chave Separadora' | 100 | Caption = 'Informe a Chave Separadora' |
@@ -105,6 +105,32 @@ object FormVACON: TFormVACON | @@ -105,6 +105,32 @@ object FormVACON: TFormVACON | ||
105 | Font.Style = [] | 105 | Font.Style = [] |
106 | ParentFont = False | 106 | ParentFont = False |
107 | end | 107 | end |
108 | + object lbDefaultChaveLeArq: TLabel | ||
109 | + Left = 9 | ||
110 | + Top = 51 | ||
111 | + Width = 95 | ||
112 | + Height = 12 | ||
113 | + Caption = '(Default="CacicBrasil")' | ||
114 | + Font.Charset = DEFAULT_CHARSET | ||
115 | + Font.Color = clNavy | ||
116 | + Font.Height = -9 | ||
117 | + Font.Name = 'Arial' | ||
118 | + Font.Style = [] | ||
119 | + ParentFont = False | ||
120 | + end | ||
121 | + object lbChaveSeparadora: TLabel | ||
122 | + Left = 9 | ||
123 | + Top = 118 | ||
124 | + Width = 99 | ||
125 | + Height = 12 | ||
126 | + Caption = '(Default="CacicIsFree")' | ||
127 | + Font.Charset = DEFAULT_CHARSET | ||
128 | + Font.Color = clNavy | ||
129 | + Font.Height = -9 | ||
130 | + Font.Name = 'Arial' | ||
131 | + Font.Style = [] | ||
132 | + ParentFont = False | ||
133 | + end | ||
108 | object Ed_Chave: TEdit | 134 | object Ed_Chave: TEdit |
109 | Left = 8 | 135 | Left = 8 |
110 | Top = 28 | 136 | Top = 28 |
@@ -112,11 +138,12 @@ object FormVACON: TFormVACON | @@ -112,11 +138,12 @@ object FormVACON: TFormVACON | ||
112 | Height = 21 | 138 | Height = 21 |
113 | BevelInner = bvNone | 139 | BevelInner = bvNone |
114 | TabOrder = 0 | 140 | TabOrder = 0 |
141 | + Text = 'CacicBrasil' | ||
115 | OnKeyPress = Ed_ChaveKeyPress | 142 | OnKeyPress = Ed_ChaveKeyPress |
116 | end | 143 | end |
117 | object Bt_OK_Chave: TButton | 144 | object Bt_OK_Chave: TButton |
118 | Left = 95 | 145 | Left = 95 |
119 | - Top = 121 | 146 | + Top = 165 |
120 | Width = 75 | 147 | Width = 75 |
121 | Height = 25 | 148 | Height = 25 |
122 | Caption = 'OK' | 149 | Caption = 'OK' |
@@ -131,19 +158,34 @@ object FormVACON: TFormVACON | @@ -131,19 +158,34 @@ object FormVACON: TFormVACON | ||
131 | end | 158 | end |
132 | object Ed_Chave_Separadora: TEdit | 159 | object Ed_Chave_Separadora: TEdit |
133 | Left = 8 | 160 | Left = 8 |
134 | - Top = 79 | 161 | + Top = 94 |
135 | Width = 249 | 162 | Width = 249 |
136 | Height = 21 | 163 | Height = 21 |
137 | BevelInner = bvNone | 164 | BevelInner = bvNone |
138 | TabOrder = 1 | 165 | TabOrder = 1 |
139 | - OnEnter = Ed_Chave_SeparadoraEnter | 166 | + Text = 'CacicIsFree' |
140 | OnKeyPress = Ed_Chave_SeparadoraKeyPress | 167 | OnKeyPress = Ed_Chave_SeparadoraKeyPress |
141 | end | 168 | end |
169 | + object chkboxExibeChaves: TCheckBox | ||
170 | + Left = 3 | ||
171 | + Top = 201 | ||
172 | + Width = 97 | ||
173 | + Height = 17 | ||
174 | + Caption = 'Exibe Chaves' | ||
175 | + Font.Charset = DEFAULT_CHARSET | ||
176 | + Font.Color = clWindowText | ||
177 | + Font.Height = -9 | ||
178 | + Font.Name = 'Arial' | ||
179 | + Font.Style = [] | ||
180 | + ParentFont = False | ||
181 | + TabOrder = 3 | ||
182 | + OnClick = chkboxExibeChavesClick | ||
183 | + end | ||
142 | end | 184 | end |
143 | object Bt_Trocar_Chave: TButton | 185 | object Bt_Trocar_Chave: TButton |
144 | - Left = 256 | ||
145 | - Top = 20 | ||
146 | - Width = 216 | 186 | + Left = 237 |
187 | + Top = 6 | ||
188 | + Width = 227 | ||
147 | Height = 35 | 189 | Height = 35 |
148 | Caption = 'Trocar Chaves de Criptografia' | 190 | Caption = 'Trocar Chaves de Criptografia' |
149 | Font.Charset = DEFAULT_CHARSET | 191 | Font.Charset = DEFAULT_CHARSET |
@@ -156,8 +198,22 @@ object FormVACON: TFormVACON | @@ -156,8 +198,22 @@ object FormVACON: TFormVACON | ||
156 | Visible = False | 198 | Visible = False |
157 | OnClick = PegaChave | 199 | OnClick = PegaChave |
158 | end | 200 | end |
201 | + object Panel1: TPanel | ||
202 | + Left = 695 | ||
203 | + Top = 597 | ||
204 | + Width = 59 | ||
205 | + Height = 17 | ||
206 | + BevelInner = bvLowered | ||
207 | + BevelOuter = bvLowered | ||
208 | + Caption = 'v:2.0.0.0' | ||
209 | + TabOrder = 5 | ||
210 | + end | ||
159 | object OpenDialog1: TOpenDialog | 211 | object OpenDialog1: TOpenDialog |
160 | Left = 16 | 212 | Left = 16 |
161 | Top = 16 | 213 | Top = 16 |
162 | end | 214 | end |
215 | + object PJVersionInfo1: TPJVersionInfo | ||
216 | + Left = 120 | ||
217 | + Top = 16 | ||
218 | + end | ||
163 | end | 219 | end |
vacon/main_VACON.pas
@@ -10,7 +10,7 @@ uses | @@ -10,7 +10,7 @@ uses | ||
10 | DCPrijndael, | 10 | DCPrijndael, |
11 | DCPbase64, | 11 | DCPbase64, |
12 | StdCtrls, | 12 | StdCtrls, |
13 | - Controls, Classes, Dialogs; | 13 | + Controls, Classes, Dialogs, ExtCtrls, PJVersionInfo; |
14 | 14 | ||
15 | type | 15 | type |
16 | TFormVACON = class(TForm) | 16 | TFormVACON = class(TForm) |
@@ -26,6 +26,11 @@ type | @@ -26,6 +26,11 @@ type | ||
26 | Bt_Trocar_Chave: TButton; | 26 | Bt_Trocar_Chave: TButton; |
27 | Lb_Chave_Separadora: TLabel; | 27 | Lb_Chave_Separadora: TLabel; |
28 | Ed_Chave_Separadora: TEdit; | 28 | Ed_Chave_Separadora: TEdit; |
29 | + lbDefaultChaveLeArq: TLabel; | ||
30 | + lbChaveSeparadora: TLabel; | ||
31 | + chkboxExibeChaves: TCheckBox; | ||
32 | + Panel1: TPanel; | ||
33 | + PJVersionInfo1: TPJVersionInfo; | ||
29 | procedure FormCreate(Sender: TObject); | 34 | procedure FormCreate(Sender: TObject); |
30 | procedure Bt_SairClick(Sender: TObject); | 35 | procedure Bt_SairClick(Sender: TObject); |
31 | function DeCrypt(p_Data : String) : String; | 36 | function DeCrypt(p_Data : String) : String; |
@@ -39,7 +44,9 @@ type | @@ -39,7 +44,9 @@ type | ||
39 | procedure PegaChave(Sender: TObject); | 44 | procedure PegaChave(Sender: TObject); |
40 | procedure Ed_ChaveKeyPress(Sender: TObject; var Key: Char); | 45 | procedure Ed_ChaveKeyPress(Sender: TObject; var Key: Char); |
41 | procedure Ed_Chave_SeparadoraKeyPress(Sender: TObject; var Key: Char); | 46 | procedure Ed_Chave_SeparadoraKeyPress(Sender: TObject; var Key: Char); |
42 | - procedure Ed_Chave_SeparadoraEnter(Sender: TObject); | 47 | + procedure chkboxExibeChavesClick(Sender: TObject); |
48 | + function GetVersionInfo(p_File: string):string; | ||
49 | + function VerFmt(const MS, LS: DWORD): string; | ||
43 | private | 50 | private |
44 | { Private declarations } | 51 | { Private declarations } |
45 | public | 52 | public |
@@ -159,6 +166,7 @@ end; | @@ -159,6 +166,7 @@ end; | ||
159 | procedure TFormVACON.FormCreate(Sender: TObject); | 166 | procedure TFormVACON.FormCreate(Sender: TObject); |
160 | begin | 167 | begin |
161 | FormVACON.Visible := true; | 168 | FormVACON.Visible := true; |
169 | + FormVACON.Panel1.Caption := GetVersionInfo(ParamStr(0)); | ||
162 | Abrir; | 170 | Abrir; |
163 | end; | 171 | end; |
164 | 172 | ||
@@ -180,10 +188,23 @@ procedure TFormVACON.PegaChave(Sender: TObject); | @@ -180,10 +188,23 @@ procedure TFormVACON.PegaChave(Sender: TObject); | ||
180 | begin | 188 | begin |
181 | GB_Chave.Visible := true; | 189 | GB_Chave.Visible := true; |
182 | Ed_Chave.SetFocus; | 190 | Ed_Chave.SetFocus; |
183 | - Ed_Chave.PasswordChar := #42; | ||
184 | - Ed_Chave_Separadora.PasswordChar := #42; | 191 | + chkboxExibeChavesClick(nil); |
192 | +end; | ||
193 | +function TFormVACON.VerFmt(const MS, LS: DWORD): string; | ||
194 | + // Format the version number from the given DWORDs containing the info | ||
195 | +begin | ||
196 | + Result := Format('%d.%d.%d.%d', | ||
197 | + [HiWord(MS), LoWord(MS), HiWord(LS), LoWord(LS)]) | ||
185 | end; | 198 | end; |
186 | 199 | ||
200 | +function TFormVACON.GetVersionInfo(p_File: string):string; | ||
201 | +var PJVersionInfo1: TPJVersionInfo; | ||
202 | +begin | ||
203 | + PJVersionInfo1 := TPJVersionInfo.Create(nil); | ||
204 | + PJVersionInfo1.FileName := PChar(p_File); | ||
205 | + Result := VerFmt(PJVersionInfo1.FixedFileInfo.dwFileVersionMS, PJVersionInfo1.FixedFileInfo.dwFileVersionLS); | ||
206 | + PJVersionInfo1.Free; | ||
207 | +end; | ||
187 | 208 | ||
188 | procedure TFormVACON.Bt_SairClick(Sender: TObject); | 209 | procedure TFormVACON.Bt_SairClick(Sender: TObject); |
189 | begin | 210 | begin |
@@ -250,9 +271,18 @@ begin | @@ -250,9 +271,18 @@ begin | ||
250 | if Key = #13 then Bt_OK_ChaveClick(nil); | 271 | if Key = #13 then Bt_OK_ChaveClick(nil); |
251 | end; | 272 | end; |
252 | 273 | ||
253 | -procedure TFormVACON.Ed_Chave_SeparadoraEnter(Sender: TObject); | 274 | +procedure TFormVACON.chkboxExibeChavesClick(Sender: TObject); |
254 | begin | 275 | begin |
255 | - Ed_Chave_Separadora.Text := Ed_Chave.Text; | 276 | + if chkboxExibeChaves.Checked then |
277 | + Begin | ||
278 | + Ed_Chave.PasswordChar := #0; | ||
279 | + Ed_Chave_Separadora.PasswordChar := #0; | ||
280 | + End | ||
281 | + else | ||
282 | + Begin | ||
283 | + Ed_Chave.PasswordChar := #42; | ||
284 | + Ed_Chave_Separadora.PasswordChar := #42; | ||
285 | + End; | ||
256 | end; | 286 | end; |
257 | 287 | ||
258 | end. | 288 | end. |
vacon/vacon.dof
@@ -115,7 +115,7 @@ AutoIncBuild=0 | @@ -115,7 +115,7 @@ AutoIncBuild=0 | ||
115 | MajorVer=2 | 115 | MajorVer=2 |
116 | MinorVer=2 | 116 | MinorVer=2 |
117 | Release=0 | 117 | Release=0 |
118 | -Build=0 | 118 | +Build=1 |
119 | Debug=0 | 119 | Debug=0 |
120 | PreRelease=0 | 120 | PreRelease=0 |
121 | Special=0 | 121 | Special=0 |
@@ -126,7 +126,7 @@ CodePage=1252 | @@ -126,7 +126,7 @@ CodePage=1252 | ||
126 | [Version Info Keys] | 126 | [Version Info Keys] |
127 | CompanyName= | 127 | CompanyName= |
128 | FileDescription= | 128 | FileDescription= |
129 | -FileVersion=2.2.0.0 | 129 | +FileVersion=2.2.0.1 |
130 | InternalName= | 130 | InternalName= |
131 | LegalCopyright= | 131 | LegalCopyright= |
132 | LegalTrademarks= | 132 | LegalTrademarks= |
vacon/vacon.res
No preview for this file type