]> code.citadel.org Git - citadel.git/commitdiff
fixed user purge
authorArt Cancro <ajc@citadel.org>
Mon, 9 Nov 1998 04:58:34 +0000 (04:58 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 9 Nov 1998 04:58:34 +0000 (04:58 +0000)
citadel/room_ops.c
citadel/routines2.c
citadel/user_ops.c

index 5808b2e7bbc018872b6dba3ca86d6cb4cae68cda..4558ba974813642b8409411f8e5c7f4d11004d38 100644 (file)
@@ -324,6 +324,10 @@ void put_msglist(struct quickroom *whichroom) {
 
 /*
  * delete_msglist()  -  delete room message pointers
+ * FIX - this really should check first to make sure there's actually a
+ *       msglist to delete.  As things stand now, calling this function on
+ *       a room which has never been posted in will result in a message
+ *       like "gdbm: illegal data" (no big deal, but could use fixing).
  */
 void delete_msglist(struct quickroom *whichroom) {
        char dbkey[256];
@@ -1135,6 +1139,8 @@ void delete_room(struct quickroom *qrbuf) {
        char aaa[100];
        int a;
 
+       lprintf(9, "Deleting room <%s>\n", qrbuf->QRname);
+
        /* Delete the info file */
        assoc_file_name(aaa, qrbuf, "info");
        unlink(aaa);
index 555275fc75ab540c9c8fcc3b70a5de3f9b1eff12..0c8abf07174240c7de25fb8314ac10722a8948db 100644 (file)
@@ -634,19 +634,18 @@ void do_system_configuration(void) {
                "Automatically move promblem user messages to twit room",
                atoi(&sc[8][0]))));
 
-       strprompt("Initial access level for new users", &sc[9][0], 1);
-       strprompt("Name of twit room", &sc[10][0], ROOMNAMELEN);
-       strprompt("Paginator prompt", &sc[11][0], 79);
+       strprompt("Name of twit room", &sc[9][0], ROOMNAMELEN);
+       strprompt("Paginator prompt", &sc[10][0], 79);
 
-       sprintf(&sc[12][0], "%d", (boolprompt(
+       sprintf(&sc[11][0], "%d", (boolprompt(
                "Restrict Internet mail to only those with that privilege",
-               atoi(&sc[12][0]))));
+               atoi(&sc[11][0]))));
 
-       strprompt("Geographic location of this system", &sc[13][0], 31);
-       strprompt("Name of system administrator", &sc[14][0], 25);
-       strprompt("Maximum concurrent sessions", &sc[15][0], 4);
-       strprompt("Server-to-server networking password", &sc[16][0], 19);
-       strprompt("Default user purge time (days)", &sc[17][0], 5);
+       strprompt("Geographic location of this system", &sc[12][0], 31);
+       strprompt("Name of system administrator", &sc[13][0], 25);
+       strprompt("Maximum concurrent sessions", &sc[14][0], 4);
+       strprompt("Server-to-server networking password", &sc[15][0], 19);
+       strprompt("Default user purge time (days)", &sc[16][0], 5);
 
        /* Angels and demons dancing in my head... */
        do {
index c6b64bfbb0587a8f896df18d89240a359025b6e2..772c893a554033ddc2d4f0e3de6e630cbe21d305 100644 (file)
@@ -464,11 +464,17 @@ void cmd_pass(char *buf)
 /*
  * Delete a user record *and* all of its related resources.
  */
-int purge_user(char *pname) {
+int purge_user(char pname[]) {
        char filename[64];
        char mailboxname[ROOMNAMELEN];
        struct usersupp usbuf;
        struct quickroom qrbuf;
+       char lowercase_name[32];
+       int a;
+
+       for (a=0; a<=strlen(pname); ++a) {
+               lowercase_name[a] = tolower(pname[a]);
+               }
 
        if (getuser(&usbuf, pname) != 0) {
                lprintf(5, "Cannot purge user <%s> - not found\n", pname);
@@ -492,7 +498,7 @@ int purge_user(char *pname) {
                }
 
        /* delete the userlog entry */
-       cdb_delete(CDB_USERSUPP, pname, strlen(pname));
+       cdb_delete(CDB_USERSUPP, lowercase_name, strlen(lowercase_name));
 
        /* remove the user's bio file */        
        sprintf(filename, "./bio/%ld", usbuf.usernum);