home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / WWIV.ZIP / GFILES / CAPTURES / DELUSE.MOD < prev    next >
Text File  |  1995-01-09  |  8KB  |  179 lines

  1. ok here's the mod.
  2. Deltaman #1 @34
  3. Mon Jan 09 19:17:39 1995
  4. 0R 34 01/09 20:17 DigiNet 54->17
  5. 0R 34 01/10 19:39 DigiNet 34->54
  6. 0R 34 01/09 19:17 DigiNet ->34
  7. RE: Ok...
  8.  
  9. 2Reply 3: 1If you want to0
  10.  
  11.  2[bMESSAGE STATUS2]p No Reply Neccessary0
  12. 7═══════════════════════════════════════════════════════════════════════════════0
  13.  
  14. ╒════════════════════════════════════════════════════════════════════════════╕
  15. │ Mod Name   : Auto User Maintenance      Mod Author: Hackmaster 'J' 1 @6101 │
  16. │                                                                    WWIVnet │
  17. │ Difficulty : Easy                       Date      : 04DEC93                │
  18. │                                                                            │
  19. │ WWIV Ver.  : 4.23                       Filename  : HJ01F.MOD or (ZIP)     │
  20. │                                                                            │
  21. │ Description:  This mod runs a routine when the beginday function runs this │
  22. │               routine compares the laston of all your users and deletes the│
  23. │               users that haven't logged on in over 60 days(interval can be │
  24. │               easily changed).                                             │
  25. │                                                                            │
  26. │          **** Sub Mod -- Show actual exemptions not just the number        │
  27. │                                                                            │
  28. ╘════════════════════════════════════════════════════════════════════════════╛
  29. ----------------------------------------------------------------------------
  30. 04DEC93
  31. Redid portions of the code to remove some uneeded variables. The 4.22 ver
  32. would not compile under 4.23 due to some variable changes, so a better
  33. method has been found.  Now includes a DEFINE for number of days after
  34. which to delete inactive users.
  35. ----------------------------------------------------------------------------
  36. 29JAN93
  37. Revised code slightly.  Tested on V4.22 OK!
  38. ----------------------------------------------------------------------------
  39. 16AUG92
  40. Kinda incorporated another mod into this one this simple little mod is to
  41. show exemptions in UEDIT not just the number and of course it will show
  42. exemption from auto-deletion as well as the stock ones...
  43.  
  44. So now its a lot easier to tell what a user is exempt from without having
  45. a clue about binary number system.....
  46. ----------------------------------------------------------------------------
  47. 10AUG92
  48. Finally fixed(I hope!) the del new user mail error
  49. ----------------------------------------------------------------------------
  50. 19OCT91:  Speeded up the code a bit removed the output to the screen(no need
  51. for the user to know who is getting deleted).  Most importantly The bit that
  52. used the callsign to save the user is gone.  To exempt a user from being auto-
  53. deleted you must give him an exemption of 16.  A user with an exemption of 16
  54. will not be deleted by this mod.  Example if the user already had an exemption
  55. of 1 then make his 17 to exclude him from being deleted the exemptions are bit
  56. mapped, so mark it out in binary to see the full picture.  In other words if
  57. want a user to be exempt from this mod just add 16 to his exemption whatever
  58. it may be now....  Me and my ramblings....
  59. ----------------------------------------------------------------------------
  60. 07SEP91
  61. This mod is the fine tuned product of the previous mods I've made on the same
  62. subject.  It does full reporting to the sysop log of whom it deleted.  In
  63. addition if you wish to exclude anyone from the auto_user_purge put a acsii
  64. char 'Y' as the last character in their callsign.  This version also fixes the
  65. bug that a newuser's feedback message was deleted when he was the first user
  66. of the day.  This mod requires modification of only the SYSOPF.C file.
  67.  
  68.  
  69. ==============================================================================
  70. Go into SYSOPF.C search for function void beginday and block read the
  71. following function void auto_user_purge right before it.
  72. ------------------------------------------------------------------------------
  73.  
  74. /* MOD */
  75. void auto_user_purge(void)
  76. {
  77.   char         s[80];
  78.   unsigned int un, d;
  79.   long         l;
  80.   userrec      u;
  81.  
  82. # define DAY_LIMIT 60             /* Number of days after which to delete */
  83.                   /* inactive users                       */
  84.   time(&l);
  85.   un=1;
  86.   read_user(un,&u);
  87.   sprintf(s,"Auto-Purged Non-Active Users (over %d days)",DAY_LIMIT);
  88.   sl1(0,s);
  89.  
  90.   do {
  91.     read_user(un,&u);
  92.     if (!(u.exempt & 0x10)) {     /* Add 16 to Exemption to stop deletion */
  93.       d=(unsigned int) ((l-u.daten)/24.0/3600.0);
  94.       if (((u.inact & inact_deleted)==0) && (d > DAY_LIMIT)) {
  95.     sprintf(s,"  Deleted User: #%3.3d %s",un,u.name);
  96.     sl1(0,s);
  97.     deluser(un);
  98.       }
  99.     }
  100.     ++un;
  101.   }
  102.   while (un <= status.users);
  103. }
  104. /* END */
  105. -----------------------------------------------------------------------------
  106. Modify function void beginday as below:
  107. NOTE: Only modification is the line added right before the very last line
  108. of the functione
  109. -----------------------------------------------------------------------------
  110.  
  111. =void beginday(void)                          -----------------------------
  112. ={                                            ! Legend = is original line !
  113. =  char s[255];                               !        + is changed line  !
  114. =  zlogrec z,z1;                              -----------------------------
  115. =  int f,i;
  116.    .
  117.    .
  118.    .
  119.  
  120. =  if (syscfg.beginday_c[0]) {
  121. =    stuff_in(s,syscfg.beginday_c,create_chain_file(),"","","","");
  122. =    do_remote(s,1);
  123. =  }
  124. +  auto_user_purge();    /* MOD ADD */
  125. =}
  126. -----------------------------------------------------------------------------
  127. Now add the following line to void newuser in file NEWUSER.C:
  128.  
  129. =    input_age(&thisuser);
  130. =    input_comptype();
  131. =    input_screensize();
  132. =
  133. +    thisuser.daten=0;     /* MOD to fix new users from being deleted */
  134. +
  135. =    if (numed && (thisuser.sysstatus & sysstatus_ansi)) {
  136. =      nl();
  137. =      prt(5,get_string(568));
  138.  
  139. -----------------------------------------------------------------------------
  140. Now modify function void print_data in file UEDIT.C as follows:
  141. -----------------------------------------------------------------------------
  142.  
  143. =  outstr("  DSL=");
  144. =  pln(u->dsl);
  145. =  if (u_qsc) {
  146. =    if ((*u_qsc)!=999) {
  147. =      outstr(get_string(256)); pln(*u_qsc);
  148. =    }
  149. =  }
  150. /* MOD to show proper exemptions */
  151.   if (u->exempt) {
  152.     npr("%s%s",get_string(257),(u->exempt & exempt_ratio)?"XFER ":"     ");
  153.     npr("%s",(u->exempt & exempt_time)?"TIME ":"     ");
  154.     npr("%s",(u->exempt & exempt_all )?"ALL ":"    ");
  155.     npr("%s",(u->exempt & exempt_post)?"POST ":"     ");
  156.     npr("%s (%d)\r\n",(u->exempt & 0x10)?"ADEL":"    ",u->exempt);
  157.   }
  158. /* END MODIFY */
  159. =  strcpy(s3,restrict_string);
  160. =  for (i=0; i<=15; i++) {
  161. =    if (u->ar & (1 << i))
  162. =      s[i]='A'+i;
  163.  
  164. ============================================================================
  165. Type MAKE FCNS or edit the FCNS.H file to show that function auto_user_purge
  166. is in file SYSOPF.C.  Then Compile the BBS and you're done Enjoy!
  167.  
  168. Hackmaster 'J' 1@6101 WWIVnet
  169.  
  170.  
  171. 9-----
  172. 95D2Σ3└7┬1á4m7ä5ñ
  173.  
  174. 85┌──────────────────────────────────────────────┐
  175. 75│1DigiNet@340  7   The Pyramid BBS0     1PlaNet@41165│
  176. 65│8WWIVNet@8306 0  7 (410)532-76440    8UtopiaNet@1055│
  177. 55│11.4 gig  0       124 hours/day0     1    WWIV 4.235│
  178. 45└──────────────────────────────────────────────┘
  179.