home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PCBOARD / LGSRN110.ZIP / LOGSIREN.PPS < prev    next >
Text File  |  1994-02-09  |  3KB  |  114 lines

  1. ;*****************************************************************************
  2. ;*                                                                           *
  3. ;*                                                                           *
  4. ;*                            Login-Siren v1.1                               *
  5. ;*                  Copyright (c) 1993 by Eric D. Scales                     *
  6. ;*                                                                           *
  7. ;*           Sounds a 5-second siren when a problem user logs on...          *
  8. ;*                                                                           *
  9. ;*                                                                           *
  10. ;*                  Development Started  10/31/93  11:00am                   *
  11. ;*                                                                           *
  12. ;*                Call E.D.S. Development at (812) 423-3394                  *
  13. ;*                                                                           *
  14. ;*****************************************************************************
  15.  
  16. ;***********************
  17. ;*  Declare Variables  *
  18. ;***********************
  19.  
  20. BOOLEAN Trouble
  21. STRING Name, Prompts(2)
  22. INTEGER Times
  23.  
  24. ;**************************
  25. ;*  Initialize Variables  *
  26. ;**************************
  27.  
  28. Trouble = False
  29. Name = ""
  30. Times = 0
  31.  
  32. ;********************************************
  33. ;*  Look for Prompt file and open if found  *
  34. ;********************************************
  35.  
  36. IF (EXIST(ppepath() + "SIRENTXT" + LANGEXT())) THEN
  37.   FOPEN 1, ppepath() + "SIRENTXT" + LANGEXT(), O_RD, S_DN
  38. ELSE
  39.   IF (EXIST(ppepath() + "SIRENTXT.")) THEN
  40.     FOPEN 1, ppepath() + "SIRENTXT.", O_RD, S_DN
  41.   ELSE
  42.     PRINTLN "@X0CLOGSIREN FATAL ERROR: @X0FNo prompt file!"
  43.     DELAY 4
  44.     LOG "LOGSIREN FATAL ERROR: No prompt file!", FALSE
  45.     GOTO END
  46.   ENDIF
  47. ENDIF
  48.  
  49. ;************************************************************
  50. ;*  Read all three prompts into the variable array PROMPTS  *
  51. ;************************************************************
  52. FOR Times = 0 to 2 
  53.   FGET 1, Prompts(Times)
  54. NEXT
  55. FCLOSE 1
  56.  
  57. ;************************
  58. ;*  Main Program Start  *
  59. ;************************
  60.  
  61. PRINTLN
  62. DISPSTR Prompts(0)
  63. PRINTLN
  64. IF (EXIST(ppepath() + "LOGSIREN.BAD")) GOSUB LOOKUPUSER
  65. IF (Trouble) THEN
  66.   DISPSTR Prompts(1)
  67.   LOG Prompts(2), FALSE
  68.   WHILE (Times<5) DO
  69.     Sound 300
  70.     Delay 5
  71.     Sound 0
  72.     Sound 600
  73.     Delay 5
  74.     Sound 0
  75.     Sound 900
  76.     Delay 5
  77.     Sound 0
  78.     Sound 1200
  79.     Delay 5
  80.     Sound 0
  81.     INC Times
  82.   ENDWHILE
  83. ENDIF
  84. GOTO END
  85.  
  86. ;*************************************************************
  87. ;*  LOOKUPUSER Subroutine                                    *
  88. ;*                                                           *
  89. ;*     Opens LOGSIREN.BAD file and looks for a substring of  *
  90. ;*     the user's name.                                      *
  91. ;*************************************************************
  92.  
  93. :LOOKUPUSER
  94.  FOPEN 1, ppepath() + "LOGSIREN.BAD", O_RD, S_DW
  95.  WHILE (FERR(1) == FALSE) DO 
  96.    FGET 1, Name
  97.    IF (INSTR(UPPER(U_NAME()), UPPER(NAME)) != 0) THEN
  98.      Trouble = True
  99.      FCLOSE 1
  100.      RETURN
  101.    ENDIF
  102.  ENDWHILE
  103.  FCLOSE 1
  104.  RETURN
  105.  
  106.  
  107. ;***********************
  108. ;*  End PPE Execution  *
  109. ;***********************
  110.  
  111. :END
  112.  End
  113.  
  114.