unit abUserPasswordDlg;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  Buttons, ActnList;

type
  TdlgUserPassword = class(TForm)
    Label1: TLabel;
    edtCurrentPassword: TEdit;
    OKBtn: TButton;
    CancelBtn: TButton;
    Label2: TLabel;
    edtNewPassword: TEdit;
    Label3: TLabel;
    edtNewPasswordRetype: TEdit;
    ActionList1: TActionList;
    actOK: TAction;
    actCancel: TAction;
    procedure actOKExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    fsCurrentPassword: string[40];
  end;

var
  dlgUserPassword: TdlgUserPassword;

implementation

{$R *.DFM}

uses Dialogs, abCript;


procedure TdlgUserPassword.actOKExecute(Sender: TObject);
begin
  if (fsCurrentPassword <> TCripter.Cript(edtCurrentPassword.Text)) or
     (edtNewPassword.Text <> edtNewPasswordRetype.Text) then
  begin
    ShowMessage('Invalid current or new password. Please retype.');
    edtCurrentPassword.SetFocus;
    ModalResult := mrNone;
  end;
end;

end.

