home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PWAULTP3.ZIP / PWAPRGMS.A02 / PWA95 / PWAEF211.ZIP / EXTERNAL.ZIP / BCNUKE.PPS < prev    next >
Text File  |  1994-12-05  |  3KB  |  90 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; BCNUKE.PPE by Drew [PWA] 
  3. ; Last updated 12-3-94
  4. ;
  5. ; This was originally PWANUKE.PPE from BlackCat's Nuker.  It is slightly
  6. ; modified to work more smoothly with EFLAG, including using USERS.CFG to
  7. ; control access to flag-nuking access.  USERS.CFG simply contains all user
  8. ; names which you wish to allow flagging files for nuking, one user name
  9. ; per line.
  10. ;
  11. ; To install, copy BCNUKE.PPE and BCNUKE.CFG into any directory (the most
  12. ; logical ones would be in the same directory as EFLAG or the same directory
  13. ; where the nuker is).  Edit BCNUKE.CFG and put the full pathname to
  14. ; BlackCat's nuker in it.  See the nuker docs for more details.  Finally,
  15. ; edit either PROMPT1.CFG and/or PROMPT2.CFG to have a command point at this
  16. ; PPE.  See either of those two config files for more instructions.
  17. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  18.  
  19. ; Use this PPE to nuke files when using PWA flag by Drew.
  20. ; Install this PPE in EFLAG.CFG as an external command. It's all explained
  21. ; in EFLAG.CFG.
  22.  
  23. string nukecfg, nukefile, filename, dirnr
  24. filename = gettoken()
  25. nukecfg = ppepath() + "bcnuke.cfg"
  26.  
  27. if (!exist(nukecfg)) then
  28.     freshline
  29.     println "Error: Flag.ppe is setup to use NUKE.PPE but cannot"
  30.     println "find BCNUKE.CFG, please contact sysop"
  31.     end
  32. endif
  33.  
  34.  
  35. string line
  36. boolean allowed
  37.  
  38.  
  39. ; now check if the user online is even allowed to nuke files
  40. ;
  41. allowed = FALSE
  42. if (exist(ppepath() + "USERS.CFG")) then
  43.     getuser
  44.     fopen 1, ppepath() + "USERS.CFG", O_RD, S_DW
  45.     fget 1, line
  46.     while (!ferr(1)) do
  47.     if (upper(line) == upper(u_name())) then
  48.         allowed = TRUE
  49.         fclose 1
  50.         break
  51.     endif
  52.     fget 1, line
  53.     endwhile
  54.     fclose 1
  55. endif
  56.  
  57. if (allowed == FALSE) then
  58.     print "@X0CSorry, you are not allowed to nuke files.@X07"
  59.     delay 25
  60.     newline
  61.     end
  62. endif
  63.  
  64.  
  65.  
  66. nukefile = readline(nukecfg, 1) + "\bcnk" + string(curconf()) +"."+ \
  67.        string(pcbnode())
  68.  
  69. if (upper(readline(nukefile, 1) <> u_name())) then
  70.     fclose -1
  71.     delete nukefile
  72.     fappend 1, nukefile, O_WR, S_DN
  73.     fputln 1, u_name()
  74. else
  75.     fclose -1
  76.     fappend 1, nukefile, O_WR, S_DN
  77. endif
  78. dirnr = string(pcbmac("@DIRNUM@"))
  79.  
  80. ; oops, assume upload dir, there's nothing we can do
  81. if (dirnr == "") then 
  82.     dirnr = string(pcbmac("@NUMDIR@"))
  83. endif
  84.  
  85. if (filename <> "") fputln 1, filename + " " + dirnr
  86. fclose 1
  87. print "@X0CFile flagged for nuking.  Don't forget to run NUKE!@X07"
  88. delay 25
  89.  
  90.