home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- * G E T P A S S . S C R --- Get password for remote system *
- ***************************************************************************
- *
- * Dialing entry to get password for
- Import DEntry Integer
- * Password to return to calling script
- Import PassWord String
- *
- ***************************************************************************
- * *
- * Script: GetPass.Scr *
- * *
- * Purpose: Returns entry in password file corresponding to *
- * given dialing entry. *
- * *
- * Invocation: *
- * *
- * Execute "GetPass" DialEnt PassWord *
- * *
- * DialEnt --- Number of entry to get password for *
- * PassWord --- Password for entry "DialEnt" *
- * *
- * Remarks: *
- * *
- * PibTerm does not store passwords for systems to be dialed in the *
- * dialing directory. This is for security reasons. However, *
- * you may find it convenient to maintain a file of passwords for *
- * each system on your own. You can do this with the built-in *
- * PibTerm editor, for example. *
- * *
- * This script provides a mechanism for accessing your password *
- * file from another script invoked as the result of a PibTerm *
- * request. Your dialing script just needs to invoke this script *
- * as indicated above. *
- * *
- * Using a password file allows you to write one script which can *
- * handle the signon sequence for a number of remote systems. For *
- * example, you can write a generic routine to log into PC Board *
- * systems. Then you can attach this generic script to the dialing *
- * entries for all the PC Board systems you call. The major *
- * difference will be the password, and using GETPASS.SCR allows you *
- * to handle that difference rather easily. *
- * *
- * The password file is assumed to be called 'c:\pibterm\mypass.dat' *
- * but you can change that to whatever name you like. The format *
- * of the password file is simple: for each entry in the dialing *
- * directory, place a corresponding password on the matching line *
- * number in the password file. Hence, if your dialing directory *
- * (PIBTERM.FON) has 25 entries, then your password file should also *
- * have 25 lines. Each line has the password corresponding to one *
- * dialing entry. For example, the 10th line in the password file *
- * should have the password for the 10th entry in the dialing *
- * directory. *
- * *
- * A non-existent password is returned as a null string. *
- * *
- ***************************************************************************
- *
- * Current entry in password file
- Declare IEntry Integer
- * Return null password in case of error
- PassWord = ''
- * Make sure dialing # is reasonable
- IF ( DEntry <= 0 ) THEN
- EXIT
- ENDIF
- * Open password file.
- * Change name to whatever you want.
- *
- Open 1 "c:\modem\mypass.dat" "Input"
- *
- * Check that open went OK -- if not,
- * return to caller.
- IF ( IOResult <> 0 ) THEN
- EXIT
- ENDIF
- * Skip down to correct entry
- *
- FOR IEntry = 1 TO ( DEntry - 1 ) DO
- Readln 1 PassWord
- IF ( IOResult <> 0 ) THEN
- PassWord = ''
- CLOSE 1
- EXIT
- ENDIF
- ENDFOR
- * Read correct entry
- Readln 1 PassWord
- *
- IF ( IOResult <> 0 ) THEN
- PassWord = ''
- CLOSE 1
- EXIT
- ENDIF
- * Close password file
- Close 1