home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / DB3STOCK.ZIP / PASSWERD.PRG < prev    next >
Encoding:
Text File  |  1986-04-12  |  2.3 KB  |  95 lines

  1. * -------------------------------------------------------------
  2. * PASSWERD.PRG - COMPLETE SECURITY PROGRAM FOR AUTHORIZED USERS
  3. * -------------------------------------------------------------
  4. use SECURITY.dbf
  5. go top
  6. delete all for enterok=space(12)
  7. pack
  8. go top
  9. mastrpass=trim(enterok)
  10. header="Authorized Users Check"
  11. do bigboxdt
  12. ct=1
  13. password=space(12)
  14. nupasswd=space(12)
  15. MSG=" "
  16. do dlinboxm
  17. do while .t.
  18.    @ 12,14 say space(50)
  19.    password=space(12)
  20.    @ 12,23 say "Enter your PASSWORD:  "
  21.    SET console Off
  22.    ACCEPT TO PASSWORD
  23.    SET console ON
  24.    @ 12,14 say space(50)
  25.    @ 12,20 say "Checking authorized users.  Please wait."
  26.    password=upper(password)
  27.    nupass=""
  28.    z=1
  29.    do while z<len(password)+1
  30.       tz=asc(substr(password,z,1))+117
  31.       nupass=nupass+chr(tz)
  32.       z=z+1
  33.    enddo
  34.    go top
  35.    locate for nupass=trim(enterok)
  36.    if eof()
  37.       @ 12,14 say space(50)
  38.       ct=ct+1
  39.       if ct>5
  40.          set color to 15/0
  41.          @ 12,21 say "I think you are an unauthorized user."
  42.          set color to 7/0
  43.          set console off
  44.          set escape off
  45.          do while .t.
  46.             loop
  47.          enddo
  48.        else
  49.          msg="Wrong SECURITY CODE.  Press any key to continue."
  50.          do linmsg23
  51.          loop
  52.       endif
  53.    endif
  54.    if nupass<>mastrpass
  55.       exit
  56.    endif
  57.    * ---------------------------------------
  58.    * PASSWORD ADDITION ROUTINE follows here:
  59.    * ---------------------------------------
  60.    do while .t.
  61.       @ 12,14 say space(50)
  62.       @ 12,21 say "Enter a password to add:  "
  63.       set console OFF
  64.       ACCEPT TO NUPASSWD
  65.       nupasswd=upper(nupasswd)
  66.       set console on
  67.       nupass=""
  68.       nupasswd=trim(nupasswd)
  69.       z=1
  70.       do while z<len(nupasswd)+1
  71.          tz=asc(substr(nupasswd,z,1))+117
  72.          nupass=nupass+chr(tz)
  73.          z=z+1
  74.       enddo
  75.       append blank
  76.       replace enterok with nupass
  77.       msg="Enter another NEW password?  <Y/N>  "
  78.       test="YN"
  79.       do linprm23
  80.       if tz="Y"
  81.          loop
  82.         else
  83.          exit
  84.       endif
  85.    enddo
  86.    * -----------------------------------
  87.    * PASSWORD ADDITION ROUTINE ends here
  88.    * -----------------------------------
  89. enddo
  90. use
  91. set color to 15/0
  92. @ 23,6 say "The System identifies you.  Welcome!  Please wait."
  93. set color to 7/0
  94. RETURN
  95.