]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/expire/serv_expire.c
* follo hashiterator api-change
[citadel.git] / citadel / modules / expire / serv_expire.c
index 4d384a56cefc2356b46b4adecafeb1d95d4851a9..2a585e5515f02068ef6f55fc43cc620d755fc225 100644 (file)
@@ -415,6 +415,10 @@ void do_user_purge(struct ctdluser *us, void *data) {
 
        /* The default rule is to not purge. */
        purge = 0;
+       
+       /* don't attempt to purge system users. */
+       if (!strncmp(us->fullname, "SYS_", 4))
+               goto skip_all_this;
 
        /* If the user hasn't called in two months and expiring of accounts is turned on, his/her account
         * has expired, so purge the record.
@@ -494,7 +498,8 @@ void do_user_purge(struct ctdluser *us, void *data) {
                }
        }
 
-
+skip_all_this:
+               
        if (purge == 1) {
                pptr = (struct PurgeList *) malloc(sizeof(struct PurgeList));
                pptr->next = UserPurgeList;
@@ -797,7 +802,7 @@ int PurgeStaleOpenIDassociations(void) {
        char *deleteme = NULL;
        long len;
        void *Value;
-       char *Key;
+       const char *Key;
        int num_deleted = 0;
 
        keys = NewHash(1, NULL);
@@ -819,7 +824,7 @@ int PurgeStaleOpenIDassociations(void) {
 
        /* Go through the hash list, deleting keys we stored in it */
 
-       HashPos = GetNewHashPos();
+       HashPos = GetNewHashPos(keys, 0);
        while (GetNextHashPos(keys, HashPos, &len, &Key, &Value)!=0)
        {
                CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", Value);
@@ -930,6 +935,10 @@ void *purge_databases(void *args)
 /*****************************************************************************/
 
 
+/* The FSCK command has been removed because people were misusing it */
+
+#if 0
+
 void do_fsck_msg(long msgnum, void *userdata) {
        struct ctdlroomref *ptr;
 
@@ -1008,6 +1017,7 @@ void cmd_fsck(char *argbuf) {
 
 }
 
+#endif /* end of commented-out fsck cmd */
 
 /*
  * Manually initiate a run of The Dreaded Auto-Purger (tm)
@@ -1025,7 +1035,7 @@ CTDL_MODULE_INIT(expire)
 {
        if (!threading)
        {
-               CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts");
+               /* CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts"); */
                CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger");
        }
        else