home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBAPG.ARC
/
PASSWORD.PRG
< prev
next >
Wrap
Text File
|
1984-08-12
|
2KB
|
71 lines
* Program..: PASSWORD.PRG
* Author...: Tom Rettig
* Date.....: June 4, 1984
* Notice...: Copyright 1984 by Tom Rettig & Associates. All rights reserved.
* Version..: dBASE II, version 2.4x
* Notes....: Password and entry program into an application system.
*
* Called by...: Main menu before entering the loop of the menu.
*
* Files used..: IN_const.mem -- holds the system constants.
*
* Establish working environment...
ERASE
SET DELETED ON
SET TALK OFF
RESTORE FROM IN_const
*
* Get the password...
SET COLON OFF
STORE T TO t:enter
DO WHILE t:enter
IF pw:tries >= 3
?? CHR(7)
SET COLOR TO sc:brt:blk
@ 18,27 SAY "* * * W A R N I N G * * *"
@ 20,17 SAY "THIS UNAUTHORIZED INTRUSION HAS BEEN RECORDED."
@ 22,17 SAY "NO FURTHER ACCESS TO THE FILES WILL BE ALLOWED."
?? CHR(7)
*
* Once an attempt to enter has failed, the system will remain
* inaccessible until the memvar pw:tries is changed back to
* zero in the constant memory file...
SAVE TO IN_const
?? CHR(7)
QUIT
ENDIF
STORE $(blank,1,12) TO t:password
@ 6,20 SAY "Please enter your password -->"
SET COLOR TO sc:invis
@ 6,50 GET t:password
READ NOUPDATE
CLEAR GETS
SET COLOR TO sc:brt
SET EXACT ON
*
* Note that the password itself is not listed as a literal to
* prevent someone from just reading this command file to obtain
* it. Instead, it is a series of substring functions which
* operates on a memvar called "a" restored from the constant file.
* The memvar contains the string: "NOPQRSTUVWXYZ ABCDEFGHIJKLM"
*
IF !(t:password) # $(a,18,1)+$(a,16,1)+$(a,15,1)+$(a,06,1)+;
$(a,19,1)+$(a,14,1)+$(a,23,1)+$(a,23,1)
@ 12,15 SAY "NOT A VALID PASSWORD -- PLEASE ENTER AGAIN."
STORE pw:tries+1 TO pw:tries
LOOP
ENDIF
SET EXACT OFF
@ 6,15
@ 6,25 SAY "Hi. Nice to see you today!"
STORE F TO t:enter
STORE 0 TO pw:tries
ENDDO
SET COLON ON
*
* Restore environment and move on to the main menu...
RELEASE ALL LIKE t:*
RETURN
*
* EOF: Password.prg