/* so that errors are thrown back to the main block */
ROUTINE-LEVEL ON ERROR UNDO, THROW. USING Progress.Security.*. /* Internal Procedures */ /* Procedure: AuthenticateUser * Description: Perform the user account authentication action using the * information in the Client-Principal object: * a) Establishes the presence of the user account * b) Validates the password(s) * c) Optionally load user account information into the * Client-Principal object. * Can also perform the user account restriction checking * using the information contained in the Client-Principal object: * a) account enabled * b) account day/time restrictions * c) Client workstation/tty access * d) Requirement for a new password * NOTE: The ABL runtime will seal the Client-Principal object * after the callback procedure returns. * */ PROCEDURE AuthenticateUser: DEFINE INPUT PARAMETER hCP AS HANDLE NO-UNDO. DEFINE INPUT PARAMETER cSystemOptions AS CHARACTER EXTENT NO-UNDO. DEFINE OUTPUT PARAMETER iPAMStatus AS INTEGER INITIAL ? NO-UNDO. DEFINE OUTPUT PARAMETER cErrorMsg AS CHARACTER NO-UNDO. /* Local variables */ DEFINE VARIABLE iActionStatus AS INTEGER NO-UNDO. DEFINE VARIABLE checkStop AS LOGICAL NO-UNDO. DO ON STOP UNDO, LEAVE ON QUIT UNDO, LEAVE : iActionStatus = ?. checkStop = YES. /* Perform validation */ checkStop = NO. CATCH e AS Progress.Lang.Error: /* handle errors - possibly log error or set cErrorMsg */ iActionStatus = PAMStatus:Custom. cErrorMsg = "Failed to process callback:" + e:GetMessage(1). END. END. |
IF checkStop THEN DO:
ASSIGN iActionStatus = PAMStatus:Custom cErrorMsg = "STOP Condition found". END. IF iActionStatus == ? THEN iPAMStatus = PAMStatus:Success. ELSE iPAMStatus = iActionStatus. END. END. /* Procedure: AfterSetIdentity * Description: This is a notification that the AVM has set the credentials * for the session or an OpenEdge database connection. */ PROCEDURE AfterSetIdentity: DEFINE INPUT PARAMETER hCP AS HANDLE NO-UNDO. DEFINE INPUT PARAMETER ss AS CHARACTER EXTENT NO-UNDO. END. |