project BLF > class PAuthentication > method InitInstance
Description
Set the value of "vcDefaultMfgProgram" before the <ANCESTOR-CODE>.
PreCondition
This method is executed when a new instance of the business class is started, or when a draft instance is opened (in that case a new instance is started which is a copy of the draft instance).
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program/pauthentication.p)
/* ======================================================================================= */
/* For the call to "authenticate" in this component (PAuthentication) we need to skip the */
/* InitInstance logic, as this is failing when we do not have a valid session established.*/
/* The methods that need the GlobalSessionId (which is normally read from the session */
/* properties) are responsible for passing in the GlobalSessionId themselves. */
/* These are : logout, getUserRemote */
/* ======================================================================================= */
assign vcDefaultMfgProgram = "mfaspl.p":U
vlSkipInitInstanceAncestorCode = true.
/* These are the errors : */
/* APP-ERROR-RESULT 3 */
/* INVALID-USERID 22 */
/* INVALID-PASSWORD 23 */
/* EXPIRED-PASSWORD 24 */
/* MISMATCH-COLLATION 30 */
/* DEACTIVATED-USERID 31 */
/* FORCE-PASSWD-CHANGE 32 */
/* DISABLED-USERID 39 */
/* INVALID-AS-REQUEST 40 */
/* INVALID-LOGOUT-REQUEST 41 */
/* BLANK-SESSION-ID 50 */
/* These are the errors */
/* APP-ERROR-RESULT */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "3":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-2'Application error.':250(8162)T-2#)
tErrorCode.tcErrorCode = "3":U.
end.
/* INVALID-USERID */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "22":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-3'Invalid user ID.':250(8163)T-3#)
tErrorCode.tcErrorCode = "22":U.
end.
/* INVALID-PASSWORD */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "23":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-5'Invalid password.':250(8165)T-5#)
tErrorCode.tcErrorCode = "23":U.
end.
/* EXPIRED-PASSWORD */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "24":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-7'Expired password.':250(8167)T-7#)
tErrorCode.tcErrorCode = "24":U.
end.
/* MISMATCH-COLLATION */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "30":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-12'Mismatching collations between client and database':250(9389)T-12#)
tErrorCode.tcErrorCode = "30":U.
end.
/* DEACTIVATED-USERID */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "31":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-4'Deactivated user ID.':100(8182)T-4#)
tErrorCode.tcErrorCode = "31":U.
end.
/* FORCE-PASSWD-CHANGE */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "32":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-6'Force password change.':100(8181)T-6#)
tErrorCode.tcErrorCode = "32":U.
end.
/* DISABLED-USERID */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "39":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim( #T-11'Disabled User':255(9374)T-11#)
tErrorCode.tcErrorCode = "39":U.
end.
/* INVALID-AS-REQUEST */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "40":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-1'Invalid Authentication Service request.':100(8183)T-1#)
tErrorCode.tcErrorCode = "40":U.
end.
/* INVALID-LOGOUT-REQUEST */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "41":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-8'Invalid logout request.':100(8184)T-8#)
tErrorCode.tcErrorCode = "41":U.
end.
/* BLANK-SESSION-ID */
if not can-find (tErrorCode where tErrorCode.tcErrorCode = "50":U)
then do:
create tErrorCode.
assign tErrorCode.tcErrorMessage = trim(#T-9'Blank session ID.':100(8188)T-9#)
tErrorCode.tcErrorCode = "50":U.
end.
<ANCESTOR-CODE>