diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-12 17:28:59 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-12 17:28:59 +0200 |
commit | 7cf47bf89fcb442c279bc5395a6da161cd84aa4d (patch) | |
tree | 26fc99375a431d15d136b273a082d3e5ffe18783 | |
parent | 048e5cac609296e9d955a04860a33e05d1958772 (diff) | |
download | fpGUI-7cf47bf89fcb442c279bc5395a6da161cd84aa4d.tar.xz |
Only call btnOK event handler if we had successful authentication.
This gives the user another chance to log in.
-rw-r--r-- | src/gui/promptuserdialog.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/promptuserdialog.inc b/src/gui/promptuserdialog.inc index a2f14685..45f48000 100644 --- a/src/gui/promptuserdialog.inc +++ b/src/gui/promptuserdialog.inc @@ -11,6 +11,8 @@ edPassword: TfpgEdit; function GetUserID: TfpgString; function GetUserPassword: TfpgString; + protected + procedure btnOKClick(Sender: TObject); override; public constructor Create(AOwner: TComponent); override; // Gof defines this Authenticate method a Hook operation in Template methods pattern. @@ -54,6 +56,12 @@ begin Result := edPassword.Text; end; +procedure TfpgPromptUserDialog.btnOKClick(Sender: TObject); +begin + if Authenticate then + inherited btnOKClick(Sender); +end; + constructor TfpgPromptUserDialog.Create(AOwner: TComponent); begin inherited Create(AOwner); |