4 * This program is a server extension which purges the user file of any user
5 * who has not logged in for a period of time, or who has elected to delete
6 * their account by setting their password to "deleteme".
9 /* PURGE_TIME is the amount of time (in seconds) for which a user must not
10 * have logged in for his/her account to be purged.
12 #define PURGE_TIME (5184000L) /* two months */
23 void do_user_purge(struct usersupp *us) {
27 /* The default rule is to not purge. */
30 /* If the user hasn't called in two months, his/her account
31 * has expired, so purge the record.
34 if ((now - us->lastcall) > PURGE_TIME) purge = 1;
36 /* If the user set his/her password to 'deleteme', he/she
37 * wishes to be deleted, so purge the record.
39 if (!strcasecmp(us->password, "deleteme")) purge = 1;
41 /* If the record is marked as permanent, don't purge it.
43 if (us->flags & US_PERM) purge = 0;
45 /* If the access level is 0, the record should already have been
46 * deleted, but maybe the user was logged in at the time or something.
47 * Delete the record now.
49 if (us->axlevel == 0) purge = 1;
51 /* 0 calls is impossible. If there are 0 calls, it must
52 * be a corrupted record, so purge it.
54 if (us->timescalled == 0) purge = 1;
57 /* do the delete call */
64 void MyReallyCoolModuleEntryPoint() {
65 ForEachUser(do_user_purge);