]> code.citadel.org Git - citadel.git/blobdiff - citadel/context.c
* Changed some instances of 'struct CitContext *CCC = CC;' to 'struct CitContext...
[citadel.git] / citadel / context.c
index 03638d2992e3b65ed32cb1ce73dbe003072caadf..fb4a5dd11f9a68537204b958c5e7362a7b1aa750 100644 (file)
@@ -367,7 +367,6 @@ CitContext *CreateNewContext(void) {
                return NULL;
        }
        memset(me, 0, sizeof(CitContext));
-       
        /* Give the contaxt a name. Hopefully makes it easier to track */
        strcpy (me->user.fullname, "SYS_notauth");
        
@@ -439,6 +438,8 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        strcpy (sysname, "SYS_");
        strcat (sysname, name);
        len = cutuserkey(sysname);
+       memcpy(context->curr_user, sysname, len + 1);
+
        /* internal_create_user has the side effect of loading the user regardless of wether they
         * already existed or needed to be created
         */
@@ -455,6 +456,17 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        }
 }
 
+/*
+ * flush it again...
+ */
+void CtdlClearSystemContext(void)
+{
+       CitContext *CCC = MyContext();
+
+       memset(CCC, 0, sizeof(CitContext));
+       citthread_setspecific(MyConKey, NULL);
+}
+
 /*
  * Cleanup any contexts that are left lying around
  */