home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxlog0b3.zip / rxlogin.cmd < prev    next >
OS/2 REXX Batch file  |  1997-01-07  |  3KB  |  109 lines

  1. /*--------------------------------------------------------------*/
  2. /* RxLogin v1.0b3 - An ultra-simple login program...            */
  3. /*      originally written by Digital Productions,              */
  4. /* Rewritten by darkpoet - darkpoet@bellsouth.net               */
  5. /*      copyright (c) 1997 darkpoet productions, inc.           */
  6. /*--------------------------------------------------------------*/
  7. CALL rxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. CALL SysLoadFuncs
  9.  
  10. /* colors: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE       */
  11. /*  fg      30   31   32     33    34     35    36    37        */
  12. /*  bg      40   41   42     43    44     45    46    47        */
  13. BlueOnBlack =D2C(27)||"["||34||";"||40||";m"
  14. /* atributes: NORMAL HIGH LOW ITALIC UNDERLINE BLINK RAPID REVERSE */
  15. /*              0     1    2    3      4         5     6     7     */
  16. Normal =D2C(27)||"["||0||";m"
  17.  
  18. SIGNAL ON HALT NAME NiceExit;
  19.  
  20. PARSE VALUE SysTextScreenSize() with height width
  21.  
  22. PARSE ARG checkpass
  23.  
  24. IF LENGTH(checkpass) > 0 THEN
  25.   DO
  26.     checkpass = INSERT(D2C(13), checkpass, LENGTH(checkpass))
  27.     PARSE VALUE SysCurPos() with row col
  28.     IF row >= (height-2) THEN
  29.       DO
  30.         SAY
  31.         SAY
  32.         row = height - 3
  33.       END
  34.     SIGNAL BreakFoil
  35.   END
  36.  
  37. SAY BlueOnBlack "What password should I use? ->"
  38. PARSE VALUE SysCurPos() with row col
  39. row = row - 1
  40. col = 31
  41. DO UNTIL (C2D(key) = 13) | (row = width)
  42.   PARSE VALUE SysCurPos(row, col) with x y
  43.   key = SysGetKey('NOECHO')
  44.   IF C2D(key) = 8 THEN
  45.     DO
  46.       IF col > 30 THEN
  47.         DO
  48.           col = col - 1
  49.           PARSE VALUE SysCurPos(row, col) with x y
  50.           SAY " "
  51.           checkpass = LEFT(checkpass, LENGTH(checkpass) - 1)
  52.         END
  53.     END
  54.   ELSE
  55.     DO
  56.       SAY "*"
  57.       checkpass = INSERT(key, checkpass, LENGTH(checkpass))
  58.       col = col + 1
  59.     END
  60. END
  61.  
  62. SAY BlueOnBlack "Machine now locked."
  63.  
  64. row = row + 2
  65. IF row >= (height-1) THEN
  66.   DO
  67.     SAY
  68.     SAY
  69.     row = height - 3
  70.   END
  71.  
  72. BreakFoil:
  73. SIGNAL ON HALT NAME BreakFoil;
  74.  
  75. DO UNTIL password = checkpass
  76.   col = 29
  77.   PARSE VALUE SysCurPos(row, 0) with x y
  78.   SAY COPIES(' ',width)
  79.   PARSE VALUE SysCurPos(row, 0) with x y
  80.   SAY BlueOnBlack "Please enter the password ->"
  81.   password = ""
  82.   DO UNTIL (C2D(key) = 13) | (col = width)
  83.     PARSE VALUE SysCurPos(row, col) with x y
  84.     key = SysGetKey('NOECHO')
  85.  
  86.     IF C2D(key) = 8 THEN
  87.       DO
  88.         IF col > 28 THEN
  89.           DO
  90.             col = col - 1
  91.             PARSE VALUE SysCurPos(row, col) with x y
  92.             SAY " "
  93.             password = LEFT(password, LENGTH(password) - 1)
  94.           END
  95.       END
  96.     ELSE
  97.       DO
  98.         SAY "*"
  99.         password = INSERT(key, password, LENGTH(password))
  100.         col = col + 1
  101.       END
  102.   END
  103. END
  104.  
  105. NiceExit:
  106. SAY Normal
  107. SAY BlueOnBlack "RxLogin v1.0b2, copyright (c) 1997, darkpoet productions, inc."
  108. SAY Normal
  109.