*DECK NVFTVAA
USETEXT TEXTNVF
USETEXT TXTANVF
USETEXT TXSMNVF
PROC NVFTVAA((PT));
# TITLE NVFTVAA - VALIDATE USER'S RIGHT TO ACCESS APPL #
BEGIN # NVFTVAA #
#
** NVFTVAA - VALIDATE USER'S RIGHT TO ACCESS APPLICATION.
*
* E. THAVIKULWAT 81/10/28
* C. BRION 83/05/10
*
* THIS PROCEDURE'S MAIN FUNCTION IS TO DETERMINE IF APPLICATION
* NAME IS VALID (EXIST IN *AST* TABLE), AND IF SO, IS USER VALIDATED
* TO ACCESS THE APPLICATION. IT IS CALLED INTO EXECUTION BY THE
* FOLLOWING PROCEDURES:
* *NVFTETI* *NVFTVVD*
*
* PROC NVFTVAA((PT))
*
* ENTRY:
* PT = POINTER TO PTAC ENTRY
*
* EXIT:
* APPROPRIATE MESSAGE ISSUED IF ANY ERRORS. OTHERWISE, PTAC ENTRY
* UPDATED WITH THE APPLICATION NAME TO SWITCH TO.
*
* NOTES:
* 1) USER VOLUNTEERED APPLICATION NAME OF "HELLO", "LOGIN", "BYE",
* OR "LOGOUT" OVERRIDES ANY MANDATORY/IMPLIED MANDATORY/PRIMARY
* APPLICATION NAME.
* 2) IF THE MANDATORY/PRIMARY APPLICATION NAME FROM THE *LCF* IS
* USED AND IF THE NAME IS ONE OF THE RESERVED APPLICATION NAME
* OF "HELLO", "LOGIN", "BYE", OR "LOGOUT", THEN THE NAME WILL
* NOT BE IN THE *AST* TABLE AND WILL RESULT IN ILLEGAL
* APPLICATION.
*
* METHOD:
* IF USER VOLUNTEERED APPLICATION NAME EXIST, CALL PROCEDURE
* *NVFTCRN* TO DETERMINE IF IT IS ONE OF THE RESERVED APPLICATION
* NAME OF "HELLO", "LOGIN", "BYE", OR "LOGOUT". IF IT IS, JUST
* EXIT AS *NVFTCRN* WOULD HAVE TAKEN APPROPRIATE ACTION DEPENDING
* ON THE RESERVED NAME. IF IT IS NOT, CALL INTERNAL PROCEDURE
* *DAPNAME* TO DETERMINE THE SWITCH APPLICATION NAME. SEARCH
* *AST* TABLE FOR A MATCH ON THE APPLICATION NAME. IF MATCH AND
* THE ACCESS WORD BIT POSITION OF THE USER'S ACCESS WORD IS SET,
* THEN USER IS VALIDATED TO ACCESS THE REQUESTED APPLICATION.
* OTHERWISE, USER IS NOT VALIDATED TO ACCESS THE REQUESTED
* APPLICATION.
#
#
**** PROC NVFTVAA - XREF LIST.
#
XREF
BEGIN
PROC NVFTCRN; # CHECK FOR RESERVED APPLICATION NAME #
PROC NVFTILP; # ISSUE LOGIN PROMPT #
PROC NVFTPSV; # PROCESS SUCCESSFUL VALIDATION #
PROC NVFTPUV; # PROCESS UNSUCCESSFUL VALIDATION #
PROC NVFUMQE; # TRANSFER TEXT TO QUEUE #
PROC NVFTRLC; # REFUSE LOANED CONNECTION #
END
$BEGIN
XREF
BEGIN
PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
END
$END
#
****
#
*CALL TMSGNVF
ITEM ADDR I; # ADDRESSING INFORMATION FOR ABH #
ITEM BPOS I; # BIT POSITION (SYMPL NOTATION) #
ITEM ERRFLAG B; # ERROR INDICATOR FLAG #
ITEM I I; # LOOP VARIABLE #
ITEM MATCH B; # EXIT LOOP VARIABLE #
ITEM NENTRY I; # NUMBER OF ENTRIES IN TABLE #
ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
ITEM RNAME I; # RESERVED NAME INDICATOR #
ITEM SMOUT B; # SM TYPE OUT FOR NVFTRLC #
CONTROL EJECT;
#
* IF USER VOLUNTEERED APPLICATION NAME AND NAME IS NOT INVALID,
* CALL *NVFTCRN* TO DETERMINE IF NAME IS ONE OF THE RESERVED
* APPLICATION NAME.
#
IF (PTA$VAF[PT]) AND (NOT PTA$INVAF[PT])
THEN # VOLUNTEERED AND VALID #
BEGIN
NVFTCRN(PT,RNAME);
IF (RNAME NQ NORESNAM$)
THEN
BEGIN
IF RNAME EQ LOGIN$
THEN
BEGIN
#
* RESERVED APPLICATION NAME OF "HELLO" OR "LOGIN".
* IF NOT LOAN REQUEST TYPE, ISSUE PROMPT.
#
IF PTA$LRC[PT] LS RCRC"LSA"
THEN
BEGIN
NVFTILP(PT);
END
IF PTA$LRC[PT] GQ RCRC"LSA"
THEN
BEGIN
#
* RESERVED APPLICATION NAME AND LOAN REQUEST CONNECTION.
* NOT ALLOWED, RETURN CONNECTION TO PRIMARY.
#
IF PTA$LRC[PT] EQ RCRC"LSA"
THEN
SMOUT = TRUE;
ELSE
SMOUT = FALSE;
PTA$LRC[PT] = RCRC"SNA";
NVFTRLC(PT,SMOUT,PTA$LRC[PT]);
END
END
#
* IF ANY RESERVED NAME WAS FOUND, JUST RETURN. IF THE RESERVED
* NAME WAS "BYE" OR "LOGOUT", NVF WILL HAVE ALREADY TERMINATED
* THE CONNECTION.
#
RETURN;
END
END
#
* CALL INTERNAL PROCEDURE *DAPNAME* TO DETERMINE SWITCH APPLICATION
* NAME.
#
DAPNAME;
#
* *DAPNAME* WILL RETURN AN ERROR IF BOTH MANDATORY AND IMPLIED
* MANDATORY APPLICATION NAME IS SPECIFIED AND THE NAMES ARE NOT
* THE SAME.
#
IF (NOT ERRFLAG) AND (NOT PTA$INVAF[PT])
THEN # NO ERROR #
BEGIN
#
* SEARCH *AST* TABLE FOR THE REQUESTED APPLICATION NAME. IF
* MATCH AND USER HAS PERMISSION TO ACCESS APPLICATION, THEN CALL
* *NVFTPSV* TO CONTINUE PROCESSING. OTHERWISE, CALL *NVFTPUV* TO
* ISSUE APPROPRIATE ERROR MESSAGE.
#
ERRFLAG = TRUE;
MATCH = FALSE;
NENTRY = ASTLNGTH / ASTSIZ$;
FOR I = 0 STEP 1 WHILE (NOT MATCH AND I LS NENTRY)
DO
BEGIN
IF (AST$ANAM[I] EQ PTA$SWTAPP[PT])
THEN # FOUND REQUESTED APPLICATION #
BEGIN
IF AST$AWBP[I] NQ NSAWBP$
THEN
BEGIN # APPLICATION NOT "NS" #
BPOS = 59 - AST$AWBP[I]; # BIT POSITION (SYMPL NOTATION) #
IF (B<BPOS,1>PTA$AAVW[PT] EQ 1)
THEN # USER VALIDATED TO ACCESS APPL #
BEGIN
ERRFLAG = FALSE; # INDICATE APPLICATION FOUND #
END
END
MATCH = TRUE; # EXIT LOOP #
END
END
END
IF NOT MATCH AND (PTA$LRC[PT] EQ RCRC"LSA")
THEN # SECONDARY APPLICATION DOES NOT EXIT #
BEGIN
SMOUT = TRUE;
PTA$LRC[PT] = RCRC"SAI";
NVFTRLC (PT,SMOUT,PTA$LRC[PT]); # SEND CR/RCN/A WITH RC=23B #
RETURN;
END
IF (PTA$INVAF[PT]) OR (ERRFLAG)
THEN # INVALID APPL OR USER OF APPL #
BEGIN
NVFTPUV(PT); # UNSUCCESSFUL APPL VALIDATION #
END
ELSE # VALID APPL AND USER #
BEGIN
PTA$PROMPT[PT] = AWTAPP$;
NVFTPSV(PT); # SUCCESSFUL APPL VALIDATION #
END
RETURN;
CONTROL EJECT;
PROC DAPNAME;
# TITLE DAPNAME - DETERMINE SWITCH APPLICATION NAME #
BEGIN # DAPNAME #
#
** DAPNAME - DETERMINE SWITCH APPLICATION NAME.
*
* E. THAVIKULWAT 81/10/28
*
* THIS PROCEDURE IS INTERNAL TO PROCEDURE *NVFTVAA* AND IS CALLED
* ONLY BY *NVFTVAA*. IT'S MAIN FUNCTION IS TO DETERMINE THE
* APPROPRIATE APPLICATION TO SWITCH THE USER TO.
*
* PROC DAPNAME
*
* ENTRY:
* PT = POINTER TO PTAC ENTRY.
*
* EXIT:
* SWITCH APPLICATION NAME ENTERED IN PTAC ENTRY.
*
* NOTES:
* FOR AUTOLOGIN DATA, THE FOLLOWING ORDER OF PRECEDENCE IS USED
* TO DETERMINE SWITCH APPLICATION NAME:
* 1) MANDATORY OR IMPLIED MANDATORY APPLICATION NAME,
* WHICHEVER IS SPECIFIED.
* 2) PRIMARY APPLICATION NAME IF PRIMARY INDICATED AND USER
* VOLUNTEERED VALUE IS "NULL" OR BLANK.
* 3) USER VOLUNTEERED APPLICATION NAME IS USED OTHERWISE.
*
* IF MANDATORY AND IMPLIED MANDATORY APPLICATION NAME ARE BOTH
* SPECIFIED, THE NAMES MUST BE THE SAME. OTHERWISE, AN ERROR IS
* ISSUED AND THE CONNECTION TERMINATED.
*
* METHOD:
* IF MANDATORY OR IMPLIED MANDATORY APPLICATION NAME SPECIFIED
* AND USER STILL VOLUNTEERED AN APPLICATION NAME (CAN ONLY BE
* VIA ABBREVIATED FORMAT), CLEAR APPLICATION INVALID FLAG FIELD
* IN PTAC ENTRY AS THE VOLUNTEERED NAME WILL NOT BE USED AND
* ISSUE MESSAGE THAT VOLUNTEERED NAME IS IGNORED. SET SWITCH
* APPLICATION NAME TO MANDATORY OR IMPLIED MANDATORY, WHICHEVER
* ONE IS SPECIFIED. IF DEFAULT (ACTUALLY PRIMARY BUT IS CHANGED
* TO DEFAULT BY *NVFTILP* SO THAT SUBSEQUENT LOGIN WILL SOLICIT
* APPLICATION PROMPT) SPECIFIED INSTEAD AND VOLUNTEERED
* APPLICATION NAME IS "NULL" OR BLANK, SET SWITCH APPLICATION NAME
* TO THE DEFAULT(PRIMARY) VALUE. OTHERWISE, SET SWITCH APPLICATION
* NAME TO THE USER VOLUNTEERED APPLICATION NAME.
#
ERRFLAG = FALSE;
IF (PTA$APPIND[PT] EQ MNDATRY$) OR (PTA$VDSF[PT])
THEN # MANDATORY AND/OR IMPLIED MANDATORY #
BEGIN
PTA$SWTAPP[PT] = PTA$ALIAPP[PT]; # PRESET TO MANDATORY #
IF (PTA$VAF[PT])
THEN # HAVE USER VOLUNTEERED APPL #
BEGIN # SEND APPLICATION IGNORED MSG #
PTA$INVAF[PT] = FALSE; # CLEAR INVALID APPL FLAG #
UPA$TYPE[0] = "APPLICATION";
ADDR = PTA$ACN[PT];
NVFUMQE(P<CTQ>,UPABUF[0],APPTTX$,ADDR,LMSG40$);
END
#
* IF MANDATORY AND IMPLIED MANDATORY ARE BOTH SPECIFIED, THE
* NAMES MUST BE THE SAME.
#
IF (PTA$APPIND[PT] EQ MNDATRY$) AND (PTA$VDSF[PT])
THEN # MANDATRY AND IMPLIED MANDATRY #
BEGIN
IF (PTA$ALIAPP[PT] NQ PTA$VDSAPP[PT])
THEN # NAMES NOT THE SAME #
BEGIN
ERRFLAG = TRUE;
END
END
ELSE # MANDATORY OR IMPLIED MANDATRY #
BEGIN
IF (PTA$VDSF[PT])
THEN # IMPLIED MANDATORY #
BEGIN
PTA$SWTAPP[PT] = PTA$VDSAPP[PT]; # SET TO IMPLIED MNDATRY #
END
END
END
ELSE # NON-MANDATORY #
BEGIN
PTA$SWTAPP[PT] = PTA$VLTAPP[PT]; # PRESET TO VOLUNTEERED APPL #
#
* IF VOLUNTEERED APPLICATION NAME IS "NULL" OR BLANK, AND DEFAULT
* (ACTUALLY PRIMARY) SPECIFIED, USE THE DEFAULT NAME. OTHERWISE,
* USE THE VOLUNTEERED NAME.
#
IF (PTA$APPIND[PT] EQ DEFAULT$)
AND ((PTA$VLTAPP[PT] EQ NULL$) OR (PTA$VLTAPP[PT] EQ " "))
THEN # DEFAULT AND NULL (OR BLANK) #
BEGIN
PTA$SWTAPP[PT] = PTA$ALIAPP[PT]; # USE DEFAULT NAME #
END
END
END # END DAPNAME #
END # END NVFTVAA #
TERM