home *** CD-ROM | disk | FTP | other *** search
- /*
- Program: PASS_CHK()
- System: GRUMPFISH LIBRARY
- Author: Greg Lief
- Copyright (c) 1988-90, Greg Lief
- Clipper 5.01 version
- Compile instructions: clipper passchk /n/w/a
- Generic password checking utility
- */
-
- //───── begin preprocessor directives
-
- #include "grump.ch"
-
- //───── end preprocessor directives
-
-
- function Pass_Chk(password, nrow)
- local mpass := space(len(password)), ret_val := .t.
- local wid := int((maxcol() - 3 - (16 + len(mpass))) / 2), getlist := {}
- local oldscore := set(_SET_SCOREBOARD, .F.), oldscrn
- default nrow to 12
- nrow := min(nrow, maxrow() - 3)
- gfsaveenv()
- colorset(C_MESSAGE)
- oldscrn := shadowbox(nrow - 1, wid, nrow + 1, 79-wid, 4)
- @ nrow, wid + 2 ssay 'Enter password:'
- @ nrow, col() + 1 get mpass color ',n/n'
- read
- byebyebox(oldscrn)
- gfrestenv()
- if ! ( ret_val := (upper(mpass) == upper(password)) )
- err_msg('Invalid password')
- endif
- set(_SET_SCOREBOARD, oldscore)
- return ret_val
-
- * end function Pass_Chk()
- *--------------------------------------------------------------------*
-
- * eof passchk.prg
-