Fix the user purge / delete thing once and for all.
authorDave West <davew@uncensored.citadel.org>
Sat, 19 Jan 2008 23:53:29 +0000 (23:53 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 19 Jan 2008 23:53:29 +0000 (23:53 +0000)
When a user is deleted they are purged from the database immediately
unless they are currently logged in.
This used to rely on the autopurger purging the user at a later date.

Now when the user logs out we check to see if they have been marked for
deletion and if they have purge them immediately.

citadel/user_ops.c

index 6c16a167a5c410e3c94e5f96b556c544c19fb199..9cb18c870c25ac8030b9cf1e62d3b5c5322a93a9 100644 (file)
@@ -606,6 +606,10 @@ void logout(struct CitContext *who)
 
        /* Do modular stuff... */
        PerformSessionHooks(EVT_LOGOUT);
+       
+       /* Check to see if the user was deleted whilst logged in and purge them if necessary */
+       if (who->user.axlevel == 0)
+               purge_user(who->user.fullname);
 
        /* Free any output buffers */
        if (who->output_buffer != NULL) {