|
pfc_default
|
|
Full name
|
pfc_w_logon.pfc_default
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event pfc_default()
|
Name
|
Datatype
|
li_rc
|
integer
|
event pfc_default;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_default
//
// Arguments: none
//
// Returns: none
//
// Description: Peform logon
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Enhanced to support multiple logon attempts.
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_rc
//////////////////////////////////////////////////////////////////////////////
// Check required fields
//////////////////////////////////////////////////////////////////////////////
if Len (sle_userid.text) = 0 then
of_MessageBox ("pfc_logon_enterid", inv_logonattrib.is_appname, &
"Please enter a User ID to logon.", exclamation!, OK!, 1)
sle_userid.SetFocus()
return
end if
if Len (sle_password.text) = 0 then
of_MessageBox ("pfc_logon_enterpassword", inv_logonattrib.is_appname, &
"Please enter a password to logon.", exclamation!, OK!, 1)
sle_password.SetFocus()
return
end if
if Isnull(inv_logonattrib.ipo_source) or Not IsValid (inv_logonattrib.ipo_source) then
this.event pfc_cancel()
return
End If
//////////////////////////////////////////////////////////////////////////////
// Attempt to logon
//////////////////////////////////////////////////////////////////////////////
ii_logonattempts --
li_rc = inv_logonattrib.ipo_source.dynamic event pfc_logon &
(sle_userid.text, sle_password.text)
if IsNull (li_rc) then
this.event pfc_cancel()
return
ElseIf li_rc <= 0 Then
If ii_logonattempts > 0 Then
// There are still have more attempts for a succesful login.
of_MessageBox ("pfc_logon_incorrectpassword", "Login", &
"The password is incorrect.", StopSign!, Ok!, 1)
sle_password.SetFocus()
Return
Else
// Failure return code
inv_logonattrib.ii_rc = -1
CloseWithReturn (this, inv_logonattrib)
End If
Else
// Successful return code
inv_logonattrib.ii_rc = 1
inv_logonattrib.is_userid = sle_userid.text
inv_logonattrib.is_password = sle_password.text
CloseWithReturn (this, inv_logonattrib)
End if
Return
end event
Name
|
Owner
|
dragobject.setfocus |
dragobject
|
systemfunctions.closewithreturn |
systemfunctions
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
pfc_w_master.of_messagebox |
pfc_w_master
|
pfc_w_logon.pfc_cancel |
pfc_w_logon
|