home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PCBOARD / BADBOY.ZIP / BADBOY.PPS < prev    next >
Text File  |  1994-03-17  |  5KB  |  121 lines

  1. ;BADBOY.ppe
  2. ;A fully-functional "example" file to stop and punish users from 
  3. ;accessing any command you wish.
  4. ;By: gorilla of 516
  5. ;Install: Enter the command you wish to restrict in your Cmdlist and
  6. ;point to this PPE.
  7. ;
  8. ;NOTE: By re-naming this file and making "copies" with different commands
  9. ;you can restrict and punish multiple activities.
  10. ;
  11. ;NOTE: This example file is set up to restrict the "9" key (access DOS
  12. ;from remote).   
  13. ;
  14. ;NOTE: For some reason, the sysop sometimes doesn't have his mail 
  15. ;waiting flag set. This might be a PCB15.x bug. If I revise this PPE
  16. ;in the future, I will examine the PPE commands to set and check the 
  17. ;mail-waiting flags
  18.  
  19. ;Variables & Initializations
  20. INTEGER LEVEL
  21. INTEGER conf                           ' The conference to post in
  22. STRING  to                             ' The sysop or whoever
  23. STRING  from                           ' The user the message is from
  24. STRING  subj                           ' The message subject
  25. STRING  msec                           ' Message Security
  26. DATE    pack                           ' Pack out date
  27. BOOLEAN rr                             ' Return receipt flag
  28. BOOLEAN echo                           ' Net Echo
  29. STRING  file                           ' The file with the message text
  30. STRING excuse1,excuse2,excuse3         ' Their lame excuse
  31.  
  32. ;Get the users info
  33. getuser
  34.  
  35. ;See if the user is allowed to access the resticted command. You could
  36. ;make it complicated by using an EXEMPT or .CFG file but why bother? Only
  37. ;you, your co's or your most trusted users would have high security level
  38. ;anyway. So just check if the users level is high enough. I use SL 50
  39. ;as the cut-off point but you can use whatever you wish.
  40.  
  41. ;Get the users current security level
  42. LET LEVEL = U_SEC              
  43.     if (level=>50) goto OK
  44.  
  45. ;Security Level you wish user reduced to. Level 5 (on my system) allows
  46. ;them on but all they can do is read the msg. You could set this to a
  47. ;level that bars them from entering your BBS completely and use DELUSER
  48. ;to mark them for deletion
  49. LET LEVEL=5                    
  50.                                
  51. ;Defaults for the message to the sysop
  52. ;You can make the message whatever you wish
  53. LET conf = 0                          ' Post message in Main base
  54. LET to   = "SYSOP"                    ' The sysop or whoever
  55. LET from = ""                         ' The User
  56. LET subj = "BAD BOY!"                 ' Subject 
  57. LET msec = "R"                        ' Receiver only 
  58. LET pack = DATE()+30                  ' Pack it out in 30 days
  59. LET rr   = FALSE                      ' No need for a return receipt
  60. LET echo = FALSE                      ' Don't echo
  61. LET file = PPEPATH()+"BadBoy"+".MSG"  ' Path and file name of message
  62.  
  63. ;Send the message
  64. MESSAGE conf,to,from,subj,msec,pack,rr,echo,file
  65.  
  66. ;This changes the security level of user
  67. IF (LEVEL=>10) U_SEC=5
  68.     LET U_sec=LEVEL
  69.         PUTUSER
  70.  
  71. ;Log attempt to Call Log. Change message to whatever you wish
  72. log "User Attempted to DROP to DOS. SL reduced to 5", 1 
  73.  
  74. ;Get rid of the bum
  75.      STRING    command                       ;line 1
  76.      command = TOKENSTR()                    ;line 2
  77.  
  78. ;Here you display a msg to the user before dumping them. You could
  79. ;use DISPFILE or DISPSTR to display a text file, string or run 
  80. ;another PPE if you wanna get fancy. I'm a monkey. I ain't fancy :)
  81. cls
  82. println "@X8CMistake!@X0F"
  83. println ""
  84. println "You attempted to access a command or function you had no"
  85. println "right to think about, much less try."
  86. println ""
  87. println "But, we all make mistakes at one time or another so I will"
  88. println "give you a chance to explain your action."
  89. println ""
  90. println "Depending on your response, and my mood, I may or may not"
  91. println "reduce your access or, perhaps, delete you from MY board."
  92. println ""
  93. println "You'll have 3 lines. Make them good."
  94. println ""
  95. wait
  96. println ""
  97.  
  98. ;Here we let him write a message to the user log before we disconnect
  99. 'him or her.
  100. inputtext "Well ",excuse1,@X0C,65
  101. println ""
  102. inputtext "     ",excuse2,@X0C,65
  103. println
  104. inputtext "     ",excuse3,@X0C,65
  105.  
  106. ;Post their excuse to the caller log
  107. log excuse1, 1
  108. log excuse2, 1
  109. log excuse3, 1
  110.  
  111. ;Now, we actually dump them
  112. KBDSTUFF  "BYE" + command + CHR(13)   
  113. END
  114.  
  115. :OK
  116. ;User has the proper SL so they can access the command.
  117. ;Put the command they typed between the quotes. In this case, "9"
  118. STRING typed
  119. typed = Tokenstr()
  120. KBDSTUFF  "9" + typed + CHR(13)
  121. end