-
Notifications
You must be signed in to change notification settings - Fork 2
/
frmsenha.pas
executable file
·90 lines (72 loc) · 3.17 KB
/
frmsenha.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(**
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil
Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais
O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como
publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão.
Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer
MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes.
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
Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
---------------------------------------------------------------------------------------------------------------------------------------------------------------
*)
unit frmSenha;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
StdCtrls, Main, ExtCtrls;
type
TformSenha = class(TForm)
Lb_Texto_Senha: TLabel;
Lb_Senha: TLabel;
EditSenha: TEdit;
Bt_OK_Senha: TButton;
Bt_Cancelar_Senha: TButton;
Lb_Msg_Erro_Senha: TLabel;
Tm_Senha: TTimer;
procedure Bt_Cancelar_SenhaClick(Sender: TObject);
procedure Bt_OK_SenhaClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Tm_SenhaTimer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
formSenha: TformSenha;
implementation
{$R *.dfm}
procedure TformSenha.Bt_Cancelar_SenhaClick(Sender: TObject);
begin
formSenha.Close;
formSenha.Release;
end;
procedure TformSenha.Bt_OK_SenhaClick(Sender: TObject);
begin
objCACIC.writeDebugLog('Bt_OK_SenhaClick: Comparando "'+Trim(editSenha.Text)+'" contra "'+Trim(objCACIC.deCrypt(objCACIC.GetValueFromFile('Configs','TeSenhaAdmAgente',FormularioGeral.strMainProgramInfFileName),false,true))+'"');
if (Trim(editSenha.Text) = Trim(objCACIC.deCrypt(objCACIC.GetValueFromFile('Configs','TeSenhaAdmAgente',FormularioGeral.strMainProgramInfFileName),false,true))) Then
Begin
objCACIC.setValueToFile('Configs','SJI',objCACIC.enCrypt('S'),FormularioGeral.strMainProgramInfFileName);
formSenha.Close;
formSenha.Release;
End
else
Begin
Lb_Msg_Erro_Senha.Caption := 'Senha Inválida!';
Tm_Senha.Enabled := false;
Tm_Senha.Interval := 3000; //3 segundos
Tm_Senha.Enabled := true;
End;
end;
procedure TformSenha.FormClose(Sender: TObject; var Action: TCloseAction);
begin
formSenha.Close;
formSenha.Release;
end;
procedure TformSenha.Tm_SenhaTimer(Sender: TObject);
begin
Tm_Senha.Enabled:= false;
Lb_Msg_Erro_Senha.Caption := '';
end;
end.