]> code.citadel.org Git - citadel.git/commitdiff
* userpurge.c: rewrote using functions from the server core, rather
authorArt Cancro <ajc@citadel.org>
Wed, 2 Sep 1998 03:12:10 +0000 (03:12 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 2 Sep 1998 03:12:10 +0000 (03:12 +0000)
          than the now-defunct external API.  This'll be ready once the module
          loading code is done.  (I just had to commit _something_ tonight.)

citadel/ChangeLog
citadel/userpurge.c

index 2eee0ffa7d1c9ed9ccbca1d372401d0fbc6c55d8..3ddf9da59d7f99ead983de99a4b2f3f2cfb74c7d 100644 (file)
@@ -1,3 +1,8 @@
+Tue Sep  1 23:09:50 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * userpurge.c: rewrote using functions from the server core, rather
+         than the now-defunct external API.  This'll be ready once the module
+         loading code is done.  (I just had to commit _something_ tonight.)
+
 Mon Aug 31 22:47:58 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Yanked the citadelapi.c module.  This wasn't working out well.
        * techdocs/citadelapi.txt - began documenting the new API to be used
index ed57fa10c0a280cf8b7c97f3f789ed496fc59bdc..027d8c64c8f58c754a1133e83d77a9e7e59c401c 100644 (file)
 #include <errno.h>
 #include "citadel.h"
 
-void do_purge(char *who) {
+void do_user_purge(struct usersupp *us) {
        int purge;
-       time_t call, now;
-       int calls;
-       char password[64];
-       unsigned int flags;
+       time_t now;
 
        /* The default rule is to not purge. */
        purge = 0;
@@ -33,41 +30,37 @@ void do_purge(char *who) {
        /* If the user hasn't called in two months, his/her account
         * has expired, so purge the record.
         */
-       call = CtdlGetUserLastCall(who);
        now = time(NULL);
-       if ((now - call) > PURGE_TIME) purge = 1;
+       if ((now - us->lastcall) > PURGE_TIME) purge = 1;
 
        /* If the user set his/her password to 'deleteme', he/she
         * wishes to be deleted, so purge the record.
         */
-       CtdlGetUserPassword(password, who);
-       if (!strcasecmp(password, "deleteme")) purge = 1;
+       if (!strcasecmp(us->password, "deleteme")) purge = 1;
 
        /* If the record is marked as permanent, don't purge it.
         */
-       flags = CtdlGetUserFlags(who);
-       if (flags & US_PERM) purge = 0;
+       if (us->flags & US_PERM) purge = 0;
 
        /* If the access level is 0, the record should already have been
         * deleted, but maybe the user was logged in at the time or something.
         * Delete the record now.
         */
-       if (CtdlGetUserAccessLevel(who) == 0) purge = 1;
+       if (us->axlevel == 0) purge = 1;
 
        /* 0 calls is impossible.  If there are 0 calls, it must
         * be a corrupted record, so purge it.
         */
-       calls = CtdlGetUserTimesCalled(who);
-       if (calls == 0) purge = 1;
+       if (us->timescalled == 0) purge = 1;
 
        if (purge == 1) {
-               CtdlSendExpressMessage("IGnatius T Foobar", "who");
+               /* FIX add the delete call here. */
                }
 
 
        }
 
 
-void CtdlMain() {
-       CtdlForEachUser(do_purge);
+void MyReallyCoolModuleEntryPoint() {
+       ForEachUser(do_user_purge);
        }