]> code.citadel.org Git - citadel.git/commitdiff
Minor mods
authorArt Cancro <ajc@citadel.org>
Sun, 22 Nov 1998 07:08:19 +0000 (07:08 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 22 Nov 1998 07:08:19 +0000 (07:08 +0000)
citadel/TODO
citadel/sysop.txt
citadel/user_ops.c

index a7477183ab5bb9f1795ad7e937474c9905029ded..2253af856683a77e0dac8c8497845500313fbddc 100644 (file)
@@ -1,6 +1,8 @@
 Citadel/UX v5.50 showstoppers list
 ----------------------------------
 * Figure out a way to auto-launch expire functions (and other functions)
+
+Other things that might be nice to take care of:
+------------------------------------------------
 * Fix the way netproc handles incoming file transfers. (marked)
-* Don't delete a user who is currently logged in. (marked)
 * Don't try to delete a msglist that doesn't exist. (marked)
index d8f295a9f90d2dc4fcd515653d095b41bcc803d5..0058eff90c8b3bf1809acab1da6ae6ea25812568 100644 (file)
@@ -54,6 +54,7 @@ to normal users. They are:
                              Aide> may not be deleted.
  .<A>ide <R>oom <I>nvite     Invites a user to the room if it is private.
  .<A>ide <R>oom <K>ickOut    Kicks a user out of the room if it is private.
+ .<A>ide <S>ystem config     Edits global system configuration.
  .<A>ide <U>serEdit          Edits certain parameters of a user's account.
  .<A>ide <V>alidate newusers Lists users who have recently registered and
                              prompts for new access levels.
index 3d4c7cb8e12d7e819ec3715a7589962d0cb139eb..bec8751edb44dc36975dc9b7b14edf978c1255d3 100644 (file)
@@ -404,6 +404,8 @@ int purge_user(char pname[]) {
        struct quickroom qrbuf;
        char lowercase_name[32];
        int a;
+       struct CitContext *ccptr;
+       int user_is_logged_in = 0;
 
        for (a=0; a<=strlen(pname); ++a) {
                lowercase_name[a] = tolower(pname[a]);
@@ -414,9 +416,26 @@ int purge_user(char pname[]) {
                return(ERROR+NO_SUCH_USER);
                }
 
-       lprintf(5, "Deleting user <%s>\n", pname);
+       /* Don't delete a user who is currently logged in.  Instead, just
+        * set the access level to 0, and let the account get swept up
+        * during the next purge.
+        */
+       user_is_logged_in = 0;
+       begin_critical_section(S_SESSION_TABLE);
+       for (ccptr=ContextList; ccptr!=NULL; ccptr=ccptr->next) {
+               if (ccptr->usersupp.usernum == usbuf.usernum) {
+                       user_is_logged_in = 1;
+                       }
+               }
+       end_critical_section(S_SESSION_TABLE);
+       if (user_is_logged_in == 1) {
+               lprintf(5, "User <%s> is logged in; not deleting.\n", pname);
+               usbuf.axlevel = 0;
+               putuser(&usbuf, pname);
+               return(1);
+               }
 
-       /* FIX   Don't delete a user who is currently logged in. */
+       lprintf(5, "Deleting user <%s>\n", pname);
 
        /* Perform any purge functions registered by server extensions */
        PerformUserHooks(usbuf.fullname, usbuf.usernum, EVT_PURGEUSER);