/*
* 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];
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);
"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 {
/*
* 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);
}
/* 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);