C PROGRAM TO PERFORM RUDAMENTARY LOGIN OPERATION.
C FILED--4-OCT-84, G. BEVER.
C EDITED TO TIGHTEN SECURITY--14-JAN-85, G. BEVER.
C EDITED TO CORRECT BREACH--24-JAN-85, G. BEVER.
C
C	.LINK LOGIN,ICNSOL,ISWTCH
C
	BYTE ICHARS(8)
	COMPLEX NAME,CODE,PASSWD(2),PASCOD(2)
	EQUIVALENCE (CODE,ICHARS(1))
	DATA PASSWD/'BEVER   ','BOGUE   '/
	DATA PASCOD/'32627145','54172623'/
	IER=ICNSOL("176500,"300)	! SWITCH CONSOLES.
	IF(IER.LT.0) STOP 'UNABLE TO SWITCH CONSOLES'
	CALL SCCA(IFLG)	! DISABLE CTRL C.
	CALL ASSIGN(5,'TT:')
1	CALL IPOKE("44,IAND(IPEEK("44),"167677))! CLEAR SPECIAL MODE TT:.
	TYPE 100
100	FORMAT(' ENTER PASSWORD:')
	READ(5,101,END=1) NAME
101	FORMAT(2A4)
	CALL IPOKE("44,IOR(IPEEK("44),"010100))	! SET SPECIAL MODE TT:.
	TYPE 102			! CODE NOT ECHOED TO USER.
102	FORMAT(' ENTER CODE:')
	DO 4 J=1,8
3	I=ITTINR()			! GET CHARACTER FROM KEYBOARD.
	IF(I.LT.0) GO TO 3		! IF NO CHARACTER, TRY AGAIN.
	IF(IAND(I,"177).EQ."12) GO TO 3	! IF <LINEFEED> HIT, IGNORE.
	IF(IAND(I,"177).EQ."15) GO TO 6	! IF <RETURN> HIT, GO TO 6.
4	ICHARS(J)=I			! CONSTRUCT ENTERED PASSWORD.	
	J=7				! NUMBER OF CHARS ENTERED - 1.
8	J=J+1				! INCREMENT # CHARACTERS ENTERED.
7	I=ITTINR()			! CHECK FOR KEYSTROKE.
	IF(I.LT.0) GO TO 7		! LOOP TILL CHARACTER HIT.
	IF(IAND(I,"177).NE."15) GO TO 8	! IF NOT <RETURN>, TRY AGAIN.
C CHECK NAME AND ITS CORRESPONDING PASSWORD.
	IF(J.GT.8) GO TO 1		! TOO MANY CHARACTERS, TRY AGAIN.
6	DO 5 I=1,2
	IF(NAME.EQ.PASSWD(I).AND.CODE.EQ.PASCOD(I)) GO TO 10
5	CONTINUE
	GO TO 1				! TRY AGAIN.
10	STOP 'OK, YOU ARE IN!'
	END
