From: Art Cancro Date: Sun, 29 Jun 2003 04:06:42 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v7.86~5834 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=95340caeddca31acdfd6f966325833b8368c4556 *** empty log message *** --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 1b3116344..85a5270f7 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 607.12 2003/06/29 04:06:41 ajc + *** empty log message *** + Revision 607.11 2003/06/29 03:58:41 ajc * Renamed fields in 'struct config' which are no longer relevant (but kept them in place to avoid corrupting everyone's data files). Removed them @@ -4808,4 +4811,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.c b/citadel/citadel.c index 639cd23ca..a0457670f 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -342,7 +342,7 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) char from_floor; int ugpos = uglistsize; int r; /* IPC result code */ - struct ctdlipcroom *roomrec = NULL; + struct ctdlipcroom *room = NULL; /* store ungoto information */ if (fromungoto == 0) { @@ -365,10 +365,10 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) } /* first try an exact match */ - r = CtdlIPCGotoRoom(ipc, towhere, "", &roomrec, aaa); + r = CtdlIPCGotoRoom(ipc, towhere, "", &room, aaa); if (r / 10 == 54) { newprompt("Enter room password: ", bbb, 9); - r = CtdlIPCGotoRoom(ipc, towhere, bbb, &roomrec, aaa); + r = CtdlIPCGotoRoom(ipc, towhere, bbb, &room, aaa); if (r / 10 == 54) { scr_printf("Wrong password.\n"); return; @@ -415,22 +415,22 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) scr_printf("No room '%s'.\n", towhere); return; } - roomrec = NULL; - r = CtdlIPCGotoRoom(ipc, bbb, "", &roomrec, aaa); + room = NULL; + r = CtdlIPCGotoRoom(ipc, bbb, "", &room, aaa); } if (r / 100 != 1 && r / 100 != 2) { scr_printf("%s\n", aaa); return; } - safestrncpy(room_name, roomrec->RRname, ROOMNAMELEN); - room_flags = roomrec->RRflags; + safestrncpy(room_name, room->RRname, ROOMNAMELEN); + room_flags = room->RRflags; from_floor = curr_floor; - curr_floor = roomrec->RRfloor; + curr_floor = room->RRfloor; remove_march(room_name, 0); if (!strcasecmp(towhere, "_BASEROOM_")) remove_march(towhere, 0); - if (!roomrec->RRunread) + if (!room->RRunread) next_lazy_cmd = 5; /* Don't read new if no new msgs */ if ((from_floor != curr_floor) && (display_name > 0) && (floor_mode == 1)) { if (floorlist[(int) curr_floor][0] == 0) @@ -445,26 +445,26 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) } if (display_name != 2) { color(BRIGHT_YELLOW); - scr_printf("%d ", roomrec->RRunread); + scr_printf("%d ", room->RRunread); color(DIM_WHITE); scr_printf("new of "); color(BRIGHT_YELLOW); - scr_printf("%d ", roomrec->RRtotal); + scr_printf("%d ", room->RRtotal); color(DIM_WHITE); scr_printf("messages.\n"); } - highest_msg_read = roomrec->RRlastread; - maxmsgnum = roomrec->RRhighest; - is_mail = roomrec->RRismailbox; - is_room_aide = roomrec->RRaide; - ls = roomrec->RRlastread; + highest_msg_read = room->RRlastread; + maxmsgnum = room->RRhighest; + is_mail = room->RRismailbox; + is_room_aide = room->RRaide; + ls = room->RRlastread; /* read info file if necessary */ - if (roomrec->RRinfoupdated > 0) + if (room->RRinfoupdated > 0) readinfo(ipc); /* check for newly arrived mail if we can */ - newmailcount = roomrec->RRnewmail; + newmailcount = room->RRnewmail; if (newmailcount > 0) { color(BRIGHT_RED); if (newmailcount == 1) { @@ -538,7 +538,7 @@ void forget_all_rooms_on(CtdlIPC *ipc, int ffloor) { char buf[SIZ]; struct march *flist, *fptr; - struct ctdlipcroom *roomrec; /* Ignored */ + struct ctdlipcroom *room; /* Ignored */ int r; /* IPC response code */ scr_printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]); @@ -549,7 +549,7 @@ void forget_all_rooms_on(CtdlIPC *ipc, int ffloor) return; } while (flist) { - r = CtdlIPCGotoRoom(ipc, flist->march_name, "", &roomrec, buf); + r = CtdlIPCGotoRoom(ipc, flist->march_name, "", &room, buf); if (r / 100 == 2) { r = CtdlIPCForgetRoom(ipc, buf); } @@ -1001,7 +1001,7 @@ int main(int argc, char **argv) int stored_password = 0; char password[SIZ]; struct ctdlipcmisc chek; - struct usersupp *myself = NULL; + struct user *myself = NULL; CtdlIPC* ipc; /* Our server connection */ int r; /* IPC result code */ diff --git a/citadel/citadel.h b/citadel/citadel.h index 97e348202..814cf2c3d 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -156,10 +156,9 @@ struct march { #define RESTRICT_INTERNET config.c_restrict /* - * User records. (It's called "usersupp" because in ancient times it was - * a supplement to /etc/passwd, but not anymore.) + * User records. */ -struct usersupp { /* User record */ +struct user { /* User record */ int version; /* Cit vers. which created this rec */ uid_t uid; /* Associate with a unix account? */ char password[32]; /* password (for BBS-only users) */ @@ -194,10 +193,9 @@ struct CitControl { #define MM_VALID 4 /* New users need validating */ /* - * Room records. (It's called "quickroom" because it was once merely an - * index to a "fullroom" file, but the new database layout changed everything.) + * Room records. */ -struct quickroom { +struct room { char QRname[ROOMNAMELEN]; /* Name of room */ char QRpasswd[10]; /* Only valid if it's a private rm */ long QRroomaide; /* User number of room aide */ diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index 97cd0ac3d..49353a6e4 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -328,14 +328,14 @@ int CtdlIPCKnownRooms(CtdlIPC *ipc, enum RoomList which, int floor, struct march /* GETU */ -/* Caller must free the struct usersupp; caller may pass an existing one */ -int CtdlIPCGetConfig(CtdlIPC *ipc, struct usersupp **uret, char *cret) +/* Caller must free the struct user; caller may pass an existing one */ +int CtdlIPCGetConfig(CtdlIPC *ipc, struct user **uret, char *cret) { register int ret; if (!cret) return -2; if (!uret) return -2; - if (!*uret) *uret = (struct usersupp *)calloc(1, sizeof (struct usersupp)); + if (!*uret) *uret = (struct user *)calloc(1, sizeof (struct user)); if (!*uret) return -1; ret = CtdlIPCGenericCommand(ipc, "GETU", NULL, 0, NULL, NULL, cret); @@ -349,7 +349,7 @@ int CtdlIPCGetConfig(CtdlIPC *ipc, struct usersupp **uret, char *cret) /* SETU */ -int CtdlIPCSetConfig(CtdlIPC *ipc, struct usersupp *uret, char *cret) +int CtdlIPCSetConfig(CtdlIPC *ipc, struct user *uret, char *cret) { char aaa[48]; @@ -736,13 +736,13 @@ int CtdlIPCKickoutUserFromRoom(CtdlIPC *ipc, const char *username, char *cret) /* GETR */ -int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct quickroom **qret, char *cret) +int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct room **qret, char *cret) { register int ret; if (!cret) return -2; if (!qret) return -2; - if (!*qret) *qret = (struct quickroom *)calloc(1, sizeof (struct quickroom)); + if (!*qret) *qret = (struct room *)calloc(1, sizeof (struct room)); if (!*qret) return -1; ret = CtdlIPCGenericCommand(ipc, "GETR", NULL, 0, NULL, NULL, cret); @@ -762,7 +762,7 @@ int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct quickroom **qret, char *cret) /* SETR */ /* set forget to kick all users out of room */ -int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct quickroom *qret, char *cret) +int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct room *qret, char *cret) { register int ret; char *aaa; @@ -1663,14 +1663,14 @@ time_t CtdlIPCServerTime(CtdlIPC *ipc, char *cret) /* AGUP */ int CtdlIPCAideGetUserParameters(CtdlIPC *ipc, const char *who, - struct usersupp **uret, char *cret) + struct user **uret, char *cret) { register int ret; char aaa[SIZ]; if (!cret) return -2; if (!uret) return -2; - if (!*uret) *uret = (struct usersupp *)calloc(1, sizeof(struct usersupp)); + if (!*uret) *uret = (struct user *)calloc(1, sizeof(struct user)); if (!*uret) return -1; sprintf(aaa, "AGUP %s", who); @@ -1692,7 +1692,7 @@ int CtdlIPCAideGetUserParameters(CtdlIPC *ipc, const char *who, /* ASUP */ -int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct usersupp *uret, char *cret) +int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct user *uret, char *cret) { register int ret; char *aaa; diff --git a/citadel/citadel_ipc.h b/citadel/citadel_ipc.h index 314e6baa2..d1083f604 100644 --- a/citadel/citadel_ipc.h +++ b/citadel/citadel_ipc.h @@ -164,8 +164,8 @@ int CtdlIPCCreateUser(CtdlIPC *ipc, const char *username, int selfservice, int CtdlIPCChangePassword(CtdlIPC *ipc, const char *passwd, char *cret); int CtdlIPCKnownRooms(CtdlIPC *ipc, enum RoomList which, int floor, struct march **listing, char *cret); -int CtdlIPCGetConfig(CtdlIPC *ipc, struct usersupp **uret, char *cret); -int CtdlIPCSetConfig(CtdlIPC *ipc, struct usersupp *uret, char *cret); +int CtdlIPCGetConfig(CtdlIPC *ipc, struct user **uret, char *cret); +int CtdlIPCSetConfig(CtdlIPC *ipc, struct user *uret, char *cret); int CtdlIPCGotoRoom(CtdlIPC *ipc, const char *room, const char *passwd, struct ctdlipcroom **rret, char *cret); int CtdlIPCGetMessages(CtdlIPC *ipc, enum MessageList which, int whicharg, @@ -179,8 +179,8 @@ int CtdlIPCReadDirectory(CtdlIPC *ipc, char **listing, char *cret); int CtdlIPCSetLastRead(CtdlIPC *ipc, long msgnum, char *cret); int CtdlIPCInviteUserToRoom(CtdlIPC *ipc, const char *username, char *cret); int CtdlIPCKickoutUserFromRoom(CtdlIPC *ipc, const char *username, char *cret); -int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct quickroom **qret, char *cret); -int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct quickroom *qret, +int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct room **qret, char *cret); +int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct room *qret, char *cret); int CtdlIPCGetRoomAide(CtdlIPC *ipc, char *cret); int CtdlIPCSetRoomAide(CtdlIPC *ipc, const char *username, char *cret); @@ -260,8 +260,8 @@ int CtdlIPCChangeRoomname(CtdlIPC *ipc, const char *roomname, char *cret); int CtdlIPCChangeUsername(CtdlIPC *ipc, const char *username, char *cret); time_t CtdlIPCServerTime(CtdlIPC *ipc, char *crert); int CtdlIPCAideGetUserParameters(CtdlIPC *ipc, const char *who, - struct usersupp **uret, char *cret); -int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct usersupp *uret, char *cret); + struct user **uret, char *cret); +int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct user *uret, char *cret); int CtdlIPCGetMessageExpirationPolicy(CtdlIPC *ipc, int which, struct ExpirePolicy **policy, char *cret); int CtdlIPCSetMessageExpirationPolicy(CtdlIPC *ipc, int which, diff --git a/citadel/citserver.c b/citadel/citserver.c index 2694739fd..ec01ebd40 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -71,7 +71,7 @@ time_t server_startup_time; */ void master_startup(void) { struct timeval tv; - struct quickroom qrbuf; + struct room qrbuf; lprintf(9, "master_startup() started\n"); time(&server_startup_time); @@ -610,12 +610,12 @@ void GenerateRoomDisplay(char *real_room, struct CitContext *viewed, struct CitContext *viewer) { - strcpy(real_room, viewed->quickroom.QRname); - if (viewed->quickroom.QRflags & QR_MAILBOX) { + strcpy(real_room, viewed->room.QRname); + if (viewed->room.QRflags & QR_MAILBOX) { strcpy(real_room, &real_room[11]); } - if (viewed->quickroom.QRflags & QR_PRIVATE) { - if ( (CtdlRoomAccess(&viewed->quickroom, &viewer->usersupp) + if (viewed->room.QRflags & QR_PRIVATE) { + if ( (CtdlRoomAccess(&viewed->room, &viewer->user) & UA_KNOWN) == 0) { strcpy(real_room, ""); } @@ -642,7 +642,7 @@ int CtdlAccessCheck(int required_level) { return(-1); } - if (CC->usersupp.axlevel >= 6) return(0); + if (CC->user.axlevel >= 6) return(0); if (required_level >= ac_aide) { cprintf("%d This command requires Aide access.\n", ERROR+HIGHER_ACCESS_REQUIRED); @@ -689,8 +689,8 @@ void cmd_term(char *cmdbuf) for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { if (session_num == ccptr->cs_pid) { found_it = 1; - if ((ccptr->usersupp.usernum == CC->usersupp.usernum) - || (CC->usersupp.axlevel >= 6)) { + if ((ccptr->user.usernum == CC->user.usernum) + || (CC->user.axlevel >= 6)) { allowed = 1; ccptr->kill_me = 1; } diff --git a/citadel/file_ops.c b/citadel/file_ops.c index dd5f2bdbd..7725507cd 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -120,7 +120,7 @@ void cmd_delf(char *filename) if (CtdlAccessCheck(ac_room_aide)) return; - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d No directory in this room.\n", ERROR + NOT_HERE); return; @@ -137,7 +137,7 @@ void cmd_delf(char *filename) } } snprintf(pathname, sizeof pathname, "./files/%s/%s", - CC->quickroom.QRdirname, filename); + CC->room.QRdirname, filename); a = unlink(pathname); if (a == 0) { cprintf("%d File '%s' deleted.\n", CIT_OK, pathname); @@ -162,14 +162,14 @@ void cmd_movf(char *cmdbuf) char newroom[SIZ]; char buf[SIZ]; int a; - struct quickroom qrbuf; + struct room qrbuf; extract(filename, cmdbuf, 0); extract(newroom, cmdbuf, 1); if (CtdlAccessCheck(ac_room_aide)) return; - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d No directory in this room.\n", ERROR + NOT_HERE); return; @@ -187,7 +187,7 @@ void cmd_movf(char *cmdbuf) } } snprintf(pathname, sizeof pathname, "./files/%s/%s", - CC->quickroom.QRdirname, filename); + CC->room.QRdirname, filename); if (access(pathname, 0) != 0) { cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname); @@ -215,7 +215,7 @@ void cmd_movf(char *cmdbuf) /* this is a crude method of copying the file description */ snprintf(buf, sizeof buf, "cat ./files/%s/filedir |grep %s >>./files/%s/filedir", - CC->quickroom.QRdirname, filename, qrbuf.QRdirname); + CC->room.QRdirname, filename, qrbuf.QRdirname); system(buf); cprintf("%d File '%s' has been moved.\n", CIT_OK, filename); } @@ -238,7 +238,7 @@ void cmd_netf(char *cmdbuf) if (CtdlAccessCheck(ac_room_aide)) return; - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d No directory in this room.\n", ERROR + NOT_HERE); return; @@ -256,7 +256,7 @@ void cmd_netf(char *cmdbuf) } } snprintf(pathname, sizeof pathname, "./files/%s/%s", - CC->quickroom.QRdirname, filename); + CC->room.QRdirname, filename); if (access(pathname, 0) != 0) { cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname); @@ -281,14 +281,14 @@ void cmd_netf(char *cmdbuf) putc(255, ofp); putc(MES_NORMAL, ofp); putc(0, ofp); - fprintf(ofp, "Pcit%ld", CC->usersupp.usernum); + fprintf(ofp, "Pcit%ld", CC->user.usernum); putc(0, ofp); time(&now); fprintf(ofp, "T%ld", (long) now); putc(0, ofp); - fprintf(ofp, "A%s", CC->usersupp.fullname); + fprintf(ofp, "A%s", CC->user.fullname); putc(0, ofp); - fprintf(ofp, "O%s", CC->quickroom.QRname); + fprintf(ofp, "O%s", CC->room.QRname); putc(0, ofp); fprintf(ofp, "N%s", NODENAME); putc(0, ofp); @@ -301,7 +301,7 @@ void cmd_netf(char *cmdbuf) snprintf(buf, sizeof buf, "cd ./files/%s; uuencode %s <%s 2>/dev/null >>%s", - CC->quickroom.QRdirname, filename, filename, outfile); + CC->room.QRdirname, filename, filename, outfile); system(buf); ofp = fopen(outfile, "a"); @@ -349,7 +349,7 @@ void cmd_open(char *cmdbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d No directory in this room.\n", ERROR + NOT_HERE); return; @@ -374,7 +374,7 @@ void cmd_open(char *cmdbuf) } snprintf(pathname, sizeof pathname, - "./files/%s/%s", CC->quickroom.QRdirname, filename); + "./files/%s/%s", CC->room.QRdirname, filename); CC->download_fp = fopen(pathname, "r"); if (CC->download_fp == NULL) { @@ -393,7 +393,7 @@ void cmd_oimg(char *cmdbuf) { char filename[SIZ]; char pathname[SIZ]; - struct usersupp usbuf; + struct user usbuf; char which_user[USERNAME_SIZE]; int which_floor; int a; @@ -426,7 +426,7 @@ void cmd_oimg(char *cmdbuf) snprintf(pathname, sizeof pathname, "./images/floor.%d.gif", which_floor); } else if (!strcasecmp(filename, "_roompic_")) { - assoc_file_name(pathname, sizeof pathname, &CC->quickroom, "images"); + assoc_file_name(pathname, sizeof pathname, &CC->room, "images"); } else { for (a = 0; a < strlen(filename); ++a) { filename[a] = tolower(filename[a]); @@ -460,7 +460,7 @@ void cmd_uopn(char *cmdbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d No directory in this room.\n", ERROR + NOT_HERE); return; @@ -484,9 +484,9 @@ void cmd_uopn(char *cmdbuf) } } snprintf(CC->upl_path, sizeof CC->upl_path, "./files/%s/%s", - CC->quickroom.QRdirname, CC->upl_file); + CC->room.QRdirname, CC->upl_file); snprintf(CC->upl_filedir, sizeof CC->upl_filedir, - "./files/%s/filedir", CC->quickroom.QRdirname); + "./files/%s/filedir", CC->room.QRdirname); CC->upload_fp = fopen(CC->upl_path, "r"); if (CC->upload_fp != NULL) { @@ -540,25 +540,25 @@ void cmd_uimg(char *cmdbuf) } } - if (CC->usersupp.axlevel >= 6) { + if (CC->user.axlevel >= 6) { snprintf(CC->upl_path, sizeof CC->upl_path, "./images/%s", basenm); } if (!strcasecmp(basenm, "_userpic_")) { snprintf(CC->upl_path, sizeof CC->upl_path, - "./userpics/%ld.gif", CC->usersupp.usernum); + "./userpics/%ld.gif", CC->user.usernum); } if ((!strcasecmp(basenm, "_floorpic_")) - && (CC->usersupp.axlevel >= 6)) { + && (CC->user.axlevel >= 6)) { which_floor = extract_int(cmdbuf, 2); snprintf(CC->upl_path, sizeof CC->upl_path, "./images/floor.%d.gif", which_floor); } if ((!strcasecmp(basenm, "_roompic_")) && (is_room_aide())) { - assoc_file_name(CC->upl_path, sizeof CC->upl_path, &CC->quickroom, "images"); + assoc_file_name(CC->upl_path, sizeof CC->upl_path, &CC->room, "images"); } if (strlen(CC->upl_path) == 0) { @@ -665,7 +665,7 @@ void cmd_ucls(char *cmd) snprintf(upload_notice, sizeof upload_notice, "NEW UPLOAD: '%s'\n %s\n", CC->upl_file, CC->upl_comment); - quickie_message(CC->curr_user, NULL, CC->quickroom.QRname, + quickie_message(CC->curr_user, NULL, CC->room.QRname, upload_notice, 0, NULL); } else { abort_upl(CC); diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index c0eb5d2cc..09dbad4eb 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -92,7 +92,7 @@ void check_sched_shutdown(void) { * NOTE: this function pair should ONLY be called during startup. It is NOT * thread safe. */ -void check_ref_counts_backend(struct quickroom *qrbuf, void *data) { +void check_ref_counts_backend(struct room *qrbuf, void *data) { struct floor flbuf; getfloor(&flbuf, qrbuf->QRfloor); diff --git a/citadel/imap_misc.c b/citadel/imap_misc.c index aac16cc7c..2dbb473f7 100644 --- a/citadel/imap_misc.c +++ b/citadel/imap_misc.c @@ -281,7 +281,7 @@ void imap_append(int num_parms, char *parms[]) { * folder is selected, save its name so we can return there!!!!!) */ if (IMAP->selected) { - strcpy(savedroom, CC->quickroom.QRname); + strcpy(savedroom, CC->room.QRname); } usergoto(roomname, 0, 0, &msgs, &new); @@ -293,11 +293,11 @@ void imap_append(int num_parms, char *parms[]) { * private mailboxes. */ if (CC->logged_in) { - if ( (CC->quickroom.QRflags & QR_MAILBOX) == 0) { + if ( (CC->room.QRflags & QR_MAILBOX) == 0) { if (msg->cm_fields['A'] != NULL) phree(msg->cm_fields['A']); if (msg->cm_fields['N'] != NULL) phree(msg->cm_fields['N']); if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']); - msg->cm_fields['A'] = strdoop(CC->usersupp.fullname); + msg->cm_fields['A'] = strdoop(CC->user.fullname); msg->cm_fields['N'] = strdoop(config.c_nodename); msg->cm_fields['H'] = strdoop(config.c_humannode); } diff --git a/citadel/imap_tools.c b/citadel/imap_tools.c index 9b42b043c..f0299f3be 100644 --- a/citadel/imap_tools.c +++ b/citadel/imap_tools.c @@ -89,9 +89,9 @@ int imap_parameterize(char **args, char *buf) } /* - * Convert a struct quickroom to an IMAP-compatible mailbox name. + * Convert a struct room to an IMAP-compatible mailbox name. */ -void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf) +void imap_mailboxname(char *buf, int bufsize, struct room *qrbuf) { struct floor *fl; int i; @@ -190,7 +190,7 @@ int imap_roomname(char *rbuf, int bufsize, char *foldername) if (ret & IR_MAILBOX) { if (atol(rbuf) == 0L) { strcpy(buf, rbuf); - sprintf(rbuf, "%010ld.%s", CC->usersupp.usernum, buf); + sprintf(rbuf, "%010ld.%s", CC->user.usernum, buf); } } ***/ diff --git a/citadel/imap_tools.h b/citadel/imap_tools.h index f5ed8f74d..d679074c2 100644 --- a/citadel/imap_tools.h +++ b/citadel/imap_tools.h @@ -15,7 +15,7 @@ void imap_strout(char *buf); int imap_parameterize(char **args, char *buf); -void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf); +void imap_mailboxname(char *buf, int bufsize, struct room *qrbuf); void imap_ial_out(struct internet_address_list *ialist); int imap_roomname(char *buf, int bufsize, char *foldername); int imap_is_message_set(char *); diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index c6837c38e..731c12079 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -113,7 +113,7 @@ int CtdlHostAlias(char *fqdn) { * * FIXME ... this needs to be updated to handle aliases. */ -int fuzzy_match(struct usersupp *us, char *matchstring) { +int fuzzy_match(struct user *us, char *matchstring) { int a; if ( (!strncasecmp(matchstring, "cit", 3)) diff --git a/citadel/internet_addressing.h b/citadel/internet_addressing.h index f9c610d6f..c072fceeb 100644 --- a/citadel/internet_addressing.h +++ b/citadel/internet_addressing.h @@ -13,7 +13,7 @@ struct internet_address_list { }; -int fuzzy_match(struct usersupp *us, char *matchstring); +int fuzzy_match(struct user *us, char *matchstring); void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name); char *rfc822_fetch_field(char *rfc822, char *fieldname); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 7f7e1ccf3..eb0e1dd04 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -292,7 +292,7 @@ void CtdlGetSeen(char *buf) { struct visit vbuf; /* Learn about the user and room in question */ - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); safestrncpy(buf, vbuf.v_seen, SIZ); } @@ -315,10 +315,10 @@ void CtdlSetSeen(long target_msgnum, int target_setting) { int num_msgs = 0; /* Learn about the user and room in question */ - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); /* Load the message list */ - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr != NULL) { msglist = mallok(cdbfr->len); memcpy(msglist, cdbfr->ptr, cdbfr->len); @@ -377,7 +377,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting) { safestrncpy(vbuf.v_seen, newseen, SIZ); lprintf(9, " after optimize: %s\n", vbuf.v_seen); phree(msglist); - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); } @@ -407,11 +407,11 @@ int CtdlForEachMessage(int mode, long ref, /* Learn about the user and room in question */ get_mm(); - getuser(&CC->usersupp, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + getuser(&CC->user, CC->curr_user); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); /* Load the message list */ - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr != NULL) { msglist = mallok(cdbfr->len); memcpy(msglist, cdbfr->ptr, cdbfr->len); @@ -490,7 +490,7 @@ int CtdlForEachMessage(int mode, long ref, || ((mode == MSGS_EQ) && (thismsg == ref)) ) ) { - if ((mode == MSGS_NEW) && (CC->usersupp.flags & US_LASTOLD) && (lastold > 0L) && (printed_lastold == 0) && (!is_seen)) { + if ((mode == MSGS_NEW) && (CC->user.flags & US_LASTOLD) && (lastold > 0L) && (printed_lastold == 0) && (!is_seen)) { if (CallBack) CallBack(lastold, userdata); printed_lastold = 1; @@ -597,8 +597,8 @@ void do_help_subst(char *buffer) help_subst(buffer, "^nodename", config.c_nodename); help_subst(buffer, "^humannode", config.c_humannode); help_subst(buffer, "^fqdn", config.c_fqdn); - help_subst(buffer, "^username", CC->usersupp.fullname); - snprintf(buf2, sizeof buf2, "%ld", CC->usersupp.usernum); + help_subst(buffer, "^username", CC->user.fullname); + snprintf(buf2, sizeof buf2, "%ld", CC->user.usernum); help_subst(buffer, "^usernum", buf2); help_subst(buffer, "^sysadm", config.c_sysadm); help_subst(buffer, "^variantname", CITADEL); @@ -1588,7 +1588,7 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { lprintf(9, "CtdlSaveMsgPointerInRoom(%s, %ld, %d)\n", roomname, msgid, flags); - strcpy(hold_rm, CC->quickroom.QRname); + strcpy(hold_rm, CC->room.QRname); /* We may need to check to see if this message is real */ if ( (flags & SM_VERIFY_GOODNESS) @@ -1601,8 +1601,8 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { /* Perform replication checks if necessary */ if ( (flags & SM_DO_REPL_CHECK) && (msg != NULL) ) { - if (getroom(&CC->quickroom, - ((roomname != NULL) ? roomname : CC->quickroom.QRname) ) + if (getroom(&CC->room, + ((roomname != NULL) ? roomname : CC->room.QRname) ) != 0) { lprintf(9, "No such room <%s>\n", roomname); if (msg != NULL) CtdlFreeMessage(msg); @@ -1610,7 +1610,7 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { } if (ReplicationChecks(msg) != 0) { - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); if (msg != NULL) CtdlFreeMessage(msg); lprintf(9, "Did replication, and newer exists\n"); return(0); @@ -1618,15 +1618,15 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { } /* Now the regular stuff */ - if (lgetroom(&CC->quickroom, - ((roomname != NULL) ? roomname : CC->quickroom.QRname) ) + if (lgetroom(&CC->room, + ((roomname != NULL) ? roomname : CC->room.QRname) ) != 0) { lprintf(9, "No such room <%s>\n", roomname); if (msg != NULL) CtdlFreeMessage(msg); return(ERROR + ROOM_NOT_FOUND); } - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr == NULL) { msglist = NULL; num_msgs = 0; @@ -1646,8 +1646,8 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { */ if (num_msgs > 0) for (i=0; iquickroom); /* unlock the room */ - getroom(&CC->quickroom, hold_rm); + lputroom(&CC->room); /* unlock the room */ + getroom(&CC->room, hold_rm); if (msg != NULL) CtdlFreeMessage(msg); return(ERROR + ALREADY_EXISTS); } @@ -1670,16 +1670,16 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags) { highest_msg = msglist[num_msgs - 1]; /* Write it back to disk. */ - cdb_store(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long), + cdb_store(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long), msglist, num_msgs * sizeof(long)); /* Free up the memory we used. */ phree(msglist); /* Update the highest-message pointer and unlock the room. */ - CC->quickroom.QRhighest = highest_msg; - lputroom(&CC->quickroom); - getroom(&CC->quickroom, hold_rm); + CC->room.QRhighest = highest_msg; + lputroom(&CC->room); + getroom(&CC->room, hold_rm); /* Bump the reference count for this message. */ if ((flags & SM_DONT_BUMP_REF)==0) { @@ -1822,7 +1822,7 @@ void check_repl(long msgnum, void *userdata) { lprintf(9, "older!\n"); /* Existing isn't newer? Then delete the old one(s). */ - CtdlDeleteMessages(CC->quickroom.QRname, msgnum, ""); + CtdlDeleteMessages(CC->room.QRname, msgnum, ""); } @@ -1884,7 +1884,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ char recipient[SIZ]; long newmsgid; char *mptr = NULL; - struct usersupp userbuf; + struct user userbuf; int a, i; struct MetaData smi; FILE *network_fp = NULL; @@ -1967,8 +1967,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* Goto the correct room */ lprintf(9, "Switching rooms\n"); - strcpy(hold_rm, CC->quickroom.QRname); - strcpy(actual_rm, CC->quickroom.QRname); + strcpy(hold_rm, CC->room.QRname); + strcpy(actual_rm, CC->room.QRname); if (recps != NULL) { strcpy(actual_rm, SENTITEMS); } @@ -1976,7 +1976,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* If the user is a twit, move to the twit room for posting */ lprintf(9, "Handling twit stuff\n"); if (TWITDETECT) { - if (CC->usersupp.axlevel == 2) { + if (CC->user.axlevel == 2) { strcpy(hold_rm, actual_rm); strcpy(actual_rm, config.c_twitroom); } @@ -1988,15 +1988,15 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ } lprintf(9, "Possibly relocating\n"); - if (strcasecmp(actual_rm, CC->quickroom.QRname)) { - getroom(&CC->quickroom, actual_rm); + if (strcasecmp(actual_rm, CC->room.QRname)) { + getroom(&CC->room, actual_rm); } /* * If this message has no O (room) field, generate one. */ if (msg->cm_fields['O'] == NULL) { - msg->cm_fields['O'] = strdoop(CC->quickroom.QRname); + msg->cm_fields['O'] = strdoop(CC->room.QRname); } /* Perform "before save" hooks (aborting if any return nonzero) */ @@ -2054,9 +2054,9 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* Bump this user's messages posted counter. */ lprintf(9, "Updating user\n"); - lgetuser(&CC->usersupp, CC->curr_user); - CC->usersupp.posted = CC->usersupp.posted + 1; - lputuser(&CC->usersupp); + lgetuser(&CC->user, CC->curr_user); + CC->user.posted = CC->user.posted + 1; + lputuser(&CC->user); /* If this is private, local mail, make a copy in the * recipient's mailbox and bump the reference count. @@ -2123,8 +2123,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* Go back to the room we started from */ lprintf(9, "Returning to original room\n"); - if (strcasecmp(hold_rm, CC->quickroom.QRname)) - getroom(&CC->quickroom, hold_rm); + if (strcasecmp(hold_rm, CC->room.QRname)) + getroom(&CC->room, hold_rm); /* For internet mail, generate delivery instructions. * Yes, this is recursive. Deal with it. Infinite recursion does @@ -2292,7 +2292,7 @@ char *CtdlReadMessageBody(char *terminator, /* token signalling EOT */ */ struct CtdlMessage *CtdlMakeMessage( - struct usersupp *author, /* author's usersupp structure */ + struct user *author, /* author's user structure */ char *recipient, /* NULL if it's not mail */ char *room, /* room where it's going */ int type, /* see MES_ types in header file */ @@ -2327,11 +2327,11 @@ struct CtdlMessage *CtdlMakeMessage( else msg->cm_fields['A'] = strdoop(author->fullname); - if (CC->quickroom.QRflags & QR_MAILBOX) { /* room */ - msg->cm_fields['O'] = strdoop(&CC->quickroom.QRname[11]); + if (CC->room.QRflags & QR_MAILBOX) { /* room */ + msg->cm_fields['O'] = strdoop(&CC->room.QRname[11]); } else { - msg->cm_fields['O'] = strdoop(CC->quickroom.QRname); + msg->cm_fields['O'] = strdoop(CC->room.QRname); } msg->cm_fields['N'] = strdoop(NODENAME); /* nodename */ @@ -2344,7 +2344,7 @@ struct CtdlMessage *CtdlMakeMessage( msg->cm_fields['D'] = strdoop(dest_node); } - if ( (author == &CC->usersupp) && (strlen(CC->cs_inet_email) > 0) ) { + if ( (author == &CC->user) && (strlen(CC->cs_inet_email) > 0) ) { msg->cm_fields['F'] = strdoop(CC->cs_inet_email); } @@ -2379,21 +2379,21 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n) { return (ERROR + NOT_LOGGED_IN); } - if ((CC->usersupp.axlevel < 2) - && ((CC->quickroom.QRflags & QR_MAILBOX) == 0)) { + if ((CC->user.axlevel < 2) + && ((CC->room.QRflags & QR_MAILBOX) == 0)) { snprintf(errmsgbuf, n, "Need to be validated to enter " "(except in %s> to sysop)", MAILROOM); return (ERROR + HIGHER_ACCESS_REQUIRED); } - if ((CC->usersupp.axlevel < 4) - && (CC->quickroom.QRflags & QR_NETWORK)) { + if ((CC->user.axlevel < 4) + && (CC->room.QRflags & QR_NETWORK)) { snprintf(errmsgbuf, n, "Need net privileges to enter here."); return (ERROR + HIGHER_ACCESS_REQUIRED); } - if ((CC->usersupp.axlevel < 6) - && (CC->quickroom.QRflags & QR_READONLY)) { + if ((CC->user.axlevel < 6) + && (CC->room.QRflags & QR_READONLY)) { snprintf(errmsgbuf, n, "Sorry, this is a read-only room."); return (ERROR + HIGHER_ACCESS_REQUIRED); } @@ -2407,7 +2407,7 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n) { * Check to see if the specified user has Internet mail permission * (returns nonzero if permission is granted) */ -int CtdlCheckInternetMailPermission(struct usersupp *who) { +int CtdlCheckInternetMailPermission(struct user *who) { /* Globally enabled? */ if (config.c_restrict == 0) return(1); @@ -2437,8 +2437,8 @@ struct recptypes *validate_recipients(char *recipients) { int i, j; int mailtype; int invalid; - struct usersupp tempUS; - struct quickroom tempQR; + struct user tempUS; + struct room tempQR; /* Initialize */ ret = (struct recptypes *) malloc(sizeof(struct recptypes)); @@ -2636,7 +2636,7 @@ void cmd_ent0(char *entargs) /* Check some other permission type things. */ if (post == 2) { - if (CC->usersupp.axlevel < 6) { + if (CC->user.axlevel < 6) { cprintf("%d You don't have permission to masquerade.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; @@ -2654,10 +2654,10 @@ void cmd_ent0(char *entargs) * make sure the user has specified at least one recipient. Then * validate the recipient(s). */ - if ( (CC->quickroom.QRflags & QR_MAILBOX) - && (!strcasecmp(&CC->quickroom.QRname[11], MAILROOM)) ) { + if ( (CC->room.QRflags & QR_MAILBOX) + && (!strcasecmp(&CC->room.QRname[11], MAILROOM)) ) { - if (CC->usersupp.axlevel < 2) { + if (CC->user.axlevel < 2) { strcpy(recp, "sysop"); } @@ -2669,7 +2669,7 @@ void cmd_ent0(char *entargs) return; } if (valid->num_internet > 0) { - if (CtdlCheckInternetMailPermission(&CC->usersupp)==0) { + if (CtdlCheckInternetMailPermission(&CC->user)==0) { cprintf("%d You do not have permission " "to send Internet mail.\n", ERROR + HIGHER_ACCESS_REQUIRED); @@ -2679,7 +2679,7 @@ void cmd_ent0(char *entargs) } if ( ( (valid->num_internet + valid->num_ignet) > 0) - && (CC->usersupp.axlevel < 4) ) { + && (CC->user.axlevel < 4) ) { cprintf("%d Higher access required for network mail.\n", ERROR + HIGHER_ACCESS_REQUIRED); phree(valid); @@ -2687,7 +2687,7 @@ void cmd_ent0(char *entargs) } if ((RESTRICT_INTERNET == 1) && (valid->num_internet > 0) - && ((CC->usersupp.flags & US_INTERNET) == 0) + && ((CC->user.flags & US_INTERNET) == 0) && (!CC->internal_pgm)) { cprintf("%d You don't have access to Internet mail.\n", ERROR + HIGHER_ACCESS_REQUIRED); @@ -2699,16 +2699,16 @@ void cmd_ent0(char *entargs) /* Is this a room which has anonymous-only or anonymous-option? */ anonymous = MES_NORMAL; - if (CC->quickroom.QRflags & QR_ANONONLY) { + if (CC->room.QRflags & QR_ANONONLY) { anonymous = MES_ANONONLY; } - if (CC->quickroom.QRflags & QR_ANONOPT) { + if (CC->room.QRflags & QR_ANONOPT) { if (anon_flag == 1) { /* only if the user requested it */ anonymous = MES_ANONOPT; } } - if ((CC->quickroom.QRflags & QR_MAILBOX) == 0) { + if ((CC->room.QRflags & QR_MAILBOX) == 0) { recp[0] = 0; } @@ -2735,8 +2735,8 @@ void cmd_ent0(char *entargs) /* Read in the message from the client. */ cprintf("%d send message\n", SEND_LISTING); - msg = CtdlMakeMessage(&CC->usersupp, recp, - CC->quickroom.QRname, anonymous, format_type, + msg = CtdlMakeMessage(&CC->user, recp, + CC->room.QRname, anonymous, format_type, masquerade_as, subject, NULL); if (msg != NULL) { @@ -2760,7 +2760,7 @@ int CtdlDeleteMessages(char *room_name, /* which room */ ) { - struct quickroom qrbuf; + struct room qrbuf; struct cdbdata *cdbfr; long *msglist = NULL; long *dellist = NULL; @@ -2849,10 +2849,10 @@ int CtdlDeleteMessages(char *room_name, /* which room */ * the current room (returns 1 for yes, 0 for no) */ int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void) { - getuser(&CC->usersupp, CC->curr_user); - if ((CC->usersupp.axlevel < 6) - && (CC->usersupp.usernum != CC->quickroom.QRroomaide) - && ((CC->quickroom.QRflags & QR_MAILBOX) == 0) + getuser(&CC->user, CC->curr_user); + if ((CC->user.axlevel < 6) + && (CC->user.usernum != CC->room.QRroomaide) + && ((CC->room.QRflags & QR_MAILBOX) == 0) && (!(CC->internal_pgm))) { return(0); } @@ -2876,7 +2876,7 @@ void cmd_dele(char *delstr) } delnum = extract_long(delstr, 0); - num_deleted = CtdlDeleteMessages(CC->quickroom.QRname, delnum, ""); + num_deleted = CtdlDeleteMessages(CC->room.QRname, delnum, ""); if (num_deleted) { cprintf("%d %d message%s deleted.\n", CIT_OK, @@ -2909,7 +2909,7 @@ void cmd_move(char *args) { long num; char targ[SIZ]; - struct quickroom qtemp; + struct room qtemp; int err; int is_copy = 0; @@ -2923,16 +2923,16 @@ void cmd_move(char *args) return; } - getuser(&CC->usersupp, CC->curr_user); + getuser(&CC->user, CC->curr_user); /* Aides can move/copy */ - if ((CC->usersupp.axlevel < 6) + if ((CC->user.axlevel < 6) /* Roomaides can move/copy */ - && (CC->usersupp.usernum != CC->quickroom.QRroomaide) + && (CC->user.usernum != CC->room.QRroomaide) /* Permit move/copy to/from personal rooms */ - && (!((CC->quickroom.QRflags & QR_MAILBOX) + && (!((CC->room.QRflags & QR_MAILBOX) && (qtemp.QRflags & QR_MAILBOX))) /* Permit only copy from public to personal room */ - && (!(is_copy && !(CC->quickroom.QRflags & QR_MAILBOX) + && (!(is_copy && !(CC->room.QRflags & QR_MAILBOX) && (qtemp.QRflags & QR_MAILBOX)))) { cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED); @@ -2950,7 +2950,7 @@ void cmd_move(char *args) * if this is a 'move' rather than a 'copy' operation. */ if (is_copy == 0) { - CtdlDeleteMessages(CC->quickroom.QRname, num, ""); + CtdlDeleteMessages(CC->room.QRname, num, ""); } cprintf("%d Message %s.\n", CIT_OK, (is_copy ? "copied" : "moved") ); @@ -3052,7 +3052,7 @@ void AdjRefCount(long msgnum, int incr) void CtdlWriteObject(char *req_room, /* Room to stuff it in */ char *content_type, /* MIME type of this object */ char *tempfilename, /* Where to fetch it from */ - struct usersupp *is_mailbox, /* Mailbox room? */ + struct user *is_mailbox, /* Mailbox room? */ int is_binary, /* Is encoding necessary? */ int is_unique, /* Del others of this type? */ unsigned int flags /* Internal save flags */ @@ -3060,7 +3060,7 @@ void CtdlWriteObject(char *req_room, /* Room to stuff it in */ { FILE *fp; - struct quickroom qrbuf; + struct room qrbuf; char roomname[ROOMNAMELEN]; struct CtdlMessage *msg; @@ -3135,7 +3135,7 @@ void CtdlWriteObject(char *req_room, /* Room to stuff it in */ msg->cm_magic = CTDLMESSAGE_MAGIC; msg->cm_anon_type = MES_NORMAL; msg->cm_format_type = 4; - msg->cm_fields['A'] = strdoop(CC->usersupp.fullname); + msg->cm_fields['A'] = strdoop(CC->user.fullname); msg->cm_fields['O'] = strdoop(req_room); msg->cm_fields['N'] = strdoop(config.c_nodename); msg->cm_fields['H'] = strdoop(config.c_humannode); @@ -3178,9 +3178,9 @@ char *CtdlGetSysConfig(char *sysconfname) { struct CtdlMessage *msg; char buf[SIZ]; - strcpy(hold_rm, CC->quickroom.QRname); - if (getroom(&CC->quickroom, SYSCONFIGROOM) != 0) { - getroom(&CC->quickroom, hold_rm); + strcpy(hold_rm, CC->room.QRname); + if (getroom(&CC->room, SYSCONFIGROOM) != 0) { + getroom(&CC->room, hold_rm); return NULL; } @@ -3207,7 +3207,7 @@ char *CtdlGetSysConfig(char *sysconfname) { } } - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); if (conf != NULL) do { extract_token(buf, conf, 0, '\n'); @@ -3251,7 +3251,7 @@ int CtdlIsMe(char *addr) { for (i=0; inum_local; ++i) { extract(addr, recp->recp_local, i); - if (!strcasecmp(addr, CC->usersupp.fullname)) { + if (!strcasecmp(addr, CC->user.fullname)) { phree(recp); return(1); } diff --git a/citadel/msgbase.h b/citadel/msgbase.h index e1dbe8499..c5a9351b0 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -99,7 +99,7 @@ int CtdlForEachMessage(int mode, long ref, void (*CallBack) (long, void *), void *userdata); int CtdlDeleteMessages(char *, long, char *); -void CtdlWriteObject(char *, char *, char *, struct usersupp *, +void CtdlWriteObject(char *, char *, char *, struct user *, int, int, unsigned int); struct CtdlMessage *CtdlFetchMessage(long msgnum); void CtdlFreeMessage(struct CtdlMessage *msg); @@ -128,7 +128,7 @@ void CtdlSetSeen(long target_msgnum, int target_setting); struct recptypes *validate_recipients(char *recipients); void CtdlGetSeen(char *buf); struct CtdlMessage *CtdlMakeMessage( - struct usersupp *author, /* author's usersupp structure */ + struct user *author, /* author's user structure */ char *recipient, /* NULL if it's not mail */ char *room, /* room where it's going */ int type, /* see MES_ types in header file */ @@ -137,5 +137,5 @@ struct CtdlMessage *CtdlMakeMessage( char *subject, /* Subject (optional) */ char *preformatted_text /* ...or NULL to read text from client */ ); -int CtdlCheckInternetMailPermission(struct usersupp *who); +int CtdlCheckInternetMailPermission(struct user *who); int CtdlIsMe(char *addr); diff --git a/citadel/policy.c b/citadel/policy.c index fce225c5c..2ed72622f 100644 --- a/citadel/policy.c +++ b/citadel/policy.c @@ -44,7 +44,7 @@ /* * Retrieve the applicable expire policy for a specific room */ -void GetExpirePolicy(struct ExpirePolicy *epbuf, struct quickroom *qrbuf) { +void GetExpirePolicy(struct ExpirePolicy *epbuf, struct room *qrbuf) { struct floor *fl; /* If the room has its own policy, return it */ @@ -75,10 +75,10 @@ void cmd_gpex(char *argbuf) { extract(which, argbuf, 0); if (!strcasecmp(which, "room")) { - memcpy(&exp, &CC->quickroom.QRep, sizeof(struct ExpirePolicy)); + memcpy(&exp, &CC->room.QRep, sizeof(struct ExpirePolicy)); } else if (!strcasecmp(which, "floor")) { - fl = cgetfloor(CC->quickroom.QRfloor); + fl = cgetfloor(CC->room.QRfloor); memcpy(&exp, &fl->f_ep, sizeof(struct ExpirePolicy)); } else if (!strcasecmp(which, "site")) { @@ -117,23 +117,23 @@ void cmd_spex(char *argbuf) { ERROR+HIGHER_ACCESS_REQUIRED); return; } - lgetroom(&CC->quickroom, CC->quickroom.QRname); - memcpy(&CC->quickroom.QRep, &exp, sizeof(struct ExpirePolicy)); - lputroom(&CC->quickroom); + lgetroom(&CC->room, CC->room.QRname); + memcpy(&CC->room.QRep, &exp, sizeof(struct ExpirePolicy)); + lputroom(&CC->room); cprintf("%d Room expire policy set.\n", CIT_OK); return; } - if (CC->usersupp.axlevel < 6) { + if (CC->user.axlevel < 6) { cprintf("%d Higher access required.\n", ERROR+HIGHER_ACCESS_REQUIRED); return; } if (!strcasecmp(which, "floor")) { - lgetfloor(&flbuf, CC->quickroom.QRfloor); + lgetfloor(&flbuf, CC->room.QRfloor); memcpy(&flbuf.f_ep, &exp, sizeof(struct ExpirePolicy)); - lputfloor(&flbuf, CC->quickroom.QRfloor); + lputfloor(&flbuf, CC->room.QRfloor); cprintf("%d Floor expire policy set.\n", CIT_OK); return; } diff --git a/citadel/policy.h b/citadel/policy.h index 0c647bdd5..273d28876 100644 --- a/citadel/policy.h +++ b/citadel/policy.h @@ -1,4 +1,4 @@ /* $Id$ */ -void GetExpirePolicy(struct ExpirePolicy *epbuf, struct quickroom *qrbuf); +void GetExpirePolicy(struct ExpirePolicy *epbuf, struct room *qrbuf); void cmd_gpex(char *argbuf); void cmd_spex(char *argbuf); diff --git a/citadel/room_ops.c b/citadel/room_ops.c index ff827bff3..99c0432f1 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -49,7 +49,7 @@ struct floor *floorcache[MAXFLOORS]; /* * Generic routine for determining user access to rooms */ -int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) +int CtdlRoomAccess(struct room *roombuf, struct user *userbuf) { int retval = 0; struct visit vbuf; @@ -120,7 +120,7 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) if ( ( ((roombuf->QRflags & QR_PRIVATE) == 0) && ((roombuf->QRflags & QR_MAILBOX) == 0) ) || ( (roombuf->QRflags & QR_MAILBOX) - && (atol(roombuf->QRname) == CC->usersupp.usernum))) { + && (atol(roombuf->QRname) == CC->user.usernum))) { retval = retval | UA_ZAPPED; } } @@ -162,7 +162,7 @@ NEWMSG: /* By the way, we also check for the presence of new messages */ /* * Self-checking stuff for a room record read into memory */ -void room_sanity_check(struct quickroom *qrbuf) +void room_sanity_check(struct room *qrbuf) { /* Mailbox rooms are always on the lowest floor */ if (qrbuf->QRflags & QR_MAILBOX) { @@ -181,7 +181,7 @@ void room_sanity_check(struct quickroom *qrbuf) /* * getroom() - retrieve room data from disk */ -int getroom(struct quickroom *qrbuf, char *room_name) +int getroom(struct room *qrbuf, char *room_name) { struct cdbdata *cdbqr; char lowercase_name[ROOMNAMELEN]; @@ -193,7 +193,7 @@ int getroom(struct quickroom *qrbuf, char *room_name) } lowercase_name[a] = 0; - memset(qrbuf, 0, sizeof(struct quickroom)); + memset(qrbuf, 0, sizeof(struct room)); /* First, try the public namespace */ cdbqr = cdb_fetch(CDB_QUICKROOM, @@ -203,15 +203,15 @@ int getroom(struct quickroom *qrbuf, char *room_name) if (cdbqr == NULL) { snprintf(personal_lowercase_name, sizeof personal_lowercase_name, "%010ld.%s", - CC->usersupp.usernum, lowercase_name); + CC->user.usernum, lowercase_name); cdbqr = cdb_fetch(CDB_QUICKROOM, personal_lowercase_name, strlen(personal_lowercase_name)); } if (cdbqr != NULL) { memcpy(qrbuf, cdbqr->ptr, - ((cdbqr->len > sizeof(struct quickroom)) ? - sizeof(struct quickroom) : cdbqr->len)); + ((cdbqr->len > sizeof(struct room)) ? + sizeof(struct room) : cdbqr->len)); cdb_free(cdbqr); room_sanity_check(qrbuf); @@ -225,7 +225,7 @@ int getroom(struct quickroom *qrbuf, char *room_name) /* * lgetroom() - same as getroom() but locks the record (if supported) */ -int lgetroom(struct quickroom *qrbuf, char *room_name) +int lgetroom(struct room *qrbuf, char *room_name) { register int retval; retval = getroom(qrbuf, room_name); @@ -238,7 +238,7 @@ int lgetroom(struct quickroom *qrbuf, char *room_name) * b_putroom() - back end to putroom() and b_deleteroom() * (if the supplied buffer is NULL, delete the room record) */ -void b_putroom(struct quickroom *qrbuf, char *room_name) +void b_putroom(struct room *qrbuf, char *room_name) { char lowercase_name[ROOMNAMELEN]; int a; @@ -254,7 +254,7 @@ void b_putroom(struct quickroom *qrbuf, char *room_name) time(&qrbuf->QRmtime); cdb_store(CDB_QUICKROOM, lowercase_name, strlen(lowercase_name), - qrbuf, sizeof(struct quickroom)); + qrbuf, sizeof(struct room)); } } @@ -262,7 +262,7 @@ void b_putroom(struct quickroom *qrbuf, char *room_name) /* * putroom() - store room data to disk */ -void putroom(struct quickroom *qrbuf) { +void putroom(struct room *qrbuf) { b_putroom(qrbuf, qrbuf->QRname); } @@ -279,7 +279,7 @@ void b_deleteroom(char *room_name) { /* * lputroom() - same as putroom() but unlocks the record (if supported) */ -void lputroom(struct quickroom *qrbuf) +void lputroom(struct room *qrbuf) { putroom(qrbuf); @@ -381,19 +381,19 @@ void lputfloor(struct floor *flbuf, int floor_num) /* * Traverse the room file... */ -void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data), +void ForEachRoom(void (*CallBack) (struct room *EachRoom, void *out_data), void *in_data) { - struct quickroom qrbuf; + struct room qrbuf; struct cdbdata *cdbqr; cdb_rewind(CDB_QUICKROOM); while (cdbqr = cdb_next_item(CDB_QUICKROOM), cdbqr != NULL) { - memset(&qrbuf, 0, sizeof(struct quickroom)); + memset(&qrbuf, 0, sizeof(struct room)); memcpy(&qrbuf, cdbqr->ptr, - ((cdbqr->len > sizeof(struct quickroom)) ? - sizeof(struct quickroom) : cdbqr->len)); + ((cdbqr->len > sizeof(struct room)) ? + sizeof(struct room) : cdbqr->len)); cdb_free(cdbqr); room_sanity_check(&qrbuf); if (qrbuf.QRflags & QR_INUSE) @@ -405,7 +405,7 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data), /* * delete_msglist() - delete room message pointers */ -void delete_msglist(struct quickroom *whichroom) +void delete_msglist(struct room *whichroom) { struct cdbdata *cdbml; @@ -464,7 +464,7 @@ int sort_msglist(long listptrs[], int oldcount) /* * Determine whether a given room is non-editable. */ -int is_noneditable(struct quickroom *qrbuf) +int is_noneditable(struct room *qrbuf) { /* Mail> rooms are non-editable */ @@ -481,13 +481,13 @@ int is_noneditable(struct quickroom *qrbuf) /* * Back-back-end for all room listing commands */ -void list_roomname(struct quickroom *qrbuf, int ra) +void list_roomname(struct room *qrbuf, int ra) { char truncated_roomname[ROOMNAMELEN]; /* For my own mailbox rooms, chop off the owner prefix */ if ( (qrbuf->QRflags & QR_MAILBOX) - && (atol(qrbuf->QRname) == CC->usersupp.usernum) ) { + && (atol(qrbuf->QRname) == CC->user.usernum) ) { strcpy(truncated_roomname, qrbuf->QRname); strcpy(truncated_roomname, &truncated_roomname[11]); cprintf("%s", truncated_roomname); @@ -511,13 +511,13 @@ void list_roomname(struct quickroom *qrbuf, int ra) /* * cmd_lrms() - List all accessible rooms, known or forgotten */ -void cmd_lrms_backend(struct quickroom *qrbuf, void *data) +void cmd_lrms_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ((( ra & (UA_KNOWN | UA_ZAPPED))) && ((qrbuf->QRfloor == (FloorBeingSearched)) @@ -533,7 +533,7 @@ void cmd_lrms(char *argbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Can't locate user!\n", ERROR + INTERNAL_ERROR); return; } @@ -548,13 +548,13 @@ void cmd_lrms(char *argbuf) /* * cmd_lkra() - List all known rooms */ -void cmd_lkra_backend(struct quickroom *qrbuf, void *data) +void cmd_lkra_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ((( ra & (UA_KNOWN))) && ((qrbuf->QRfloor == (FloorBeingSearched)) @@ -570,7 +570,7 @@ void cmd_lkra(char *argbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Can't locate user!\n", ERROR + INTERNAL_ERROR); return; } @@ -582,13 +582,13 @@ void cmd_lkra(char *argbuf) -void cmd_lprm_backend(struct quickroom *qrbuf, void *data) +void cmd_lprm_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ( ((qrbuf->QRflags & QR_PRIVATE) == 0) && ((qrbuf->QRflags & QR_MAILBOX) == 0) @@ -614,13 +614,13 @@ void cmd_lprm(char *argbuf) /* * cmd_lkrn() - List all known rooms with new messages */ -void cmd_lkrn_backend(struct quickroom *qrbuf, void *data) +void cmd_lkrn_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ((ra & UA_KNOWN) && (ra & UA_HASNEWMSGS) @@ -637,7 +637,7 @@ void cmd_lkrn(char *argbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Can't locate user!\n", ERROR + INTERNAL_ERROR); return; } @@ -652,13 +652,13 @@ void cmd_lkrn(char *argbuf) /* * cmd_lkro() - List all known rooms */ -void cmd_lkro_backend(struct quickroom *qrbuf, void *data) +void cmd_lkro_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ((ra & UA_KNOWN) && ((ra & UA_HASNEWMSGS) == 0) @@ -675,7 +675,7 @@ void cmd_lkro(char *argbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Can't locate user!\n", ERROR + INTERNAL_ERROR); return; } @@ -690,13 +690,13 @@ void cmd_lkro(char *argbuf) /* * cmd_lzrm() - List all forgotten rooms */ -void cmd_lzrm_backend(struct quickroom *qrbuf, void *data) +void cmd_lzrm_backend(struct room *qrbuf, void *data) { int FloorBeingSearched = (-1); int ra; FloorBeingSearched = *(int *)data; - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ((ra & UA_GOTOALLOWED) && (ra & UA_ZAPPED) @@ -713,7 +713,7 @@ void cmd_lzrm(char *argbuf) if (CtdlAccessCheck(ac_logged_in)) return; - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Can't locate user!\n", ERROR + INTERNAL_ERROR); return; } @@ -746,40 +746,40 @@ void usergoto(char *where, int display_result, int transiently, int num_msgs = 0; /* If the supplied room name is NULL, the caller wants us to know that - * it has already copied the quickroom record into CC->quickroom, so + * it has already copied the room record into CC->room, so * we can skip the extra database fetch. */ if (where != NULL) { - strcpy(CC->quickroom.QRname, where); - getroom(&CC->quickroom, where); + strcpy(CC->room.QRname, where); + getroom(&CC->room, where); } /* Take care of all the formalities. */ begin_critical_section(S_USERSUPP); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); /* Know the room ... but not if it's the page log room, or if the * caller specified that we're only entering this room transiently. */ - if ((strcasecmp(CC->quickroom.QRname, config.c_logpages)) + if ((strcasecmp(CC->room.QRname, config.c_logpages)) && (transiently == 0) ) { vbuf.v_flags = vbuf.v_flags & ~V_FORGET & ~V_LOCKOUT; vbuf.v_flags = vbuf.v_flags | V_ACCESS; } - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); end_critical_section(S_USERSUPP); /* Check for new mail */ newmailcount = NewMailCount(); /* set info to 1 if the user needs to read the room's info file */ - if (CC->quickroom.QRinfo > vbuf.v_lastseen) { + if (CC->room.QRinfo > vbuf.v_lastseen) { info = 1; } get_mm(); - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr != NULL) { msglist = mallok(cdbfr->len); memcpy(msglist, cdbfr->ptr, cdbfr->len); @@ -798,27 +798,27 @@ void usergoto(char *where, int display_result, int transiently, if (msglist != NULL) phree(msglist); - if (CC->quickroom.QRflags & QR_MAILBOX) + if (CC->room.QRflags & QR_MAILBOX) rmailflag = 1; else rmailflag = 0; - if ((CC->quickroom.QRroomaide == CC->usersupp.usernum) - || (CC->usersupp.axlevel >= 6)) + if ((CC->room.QRroomaide == CC->user.usernum) + || (CC->user.axlevel >= 6)) raideflag = 1; else raideflag = 0; - strcpy(truncated_roomname, CC->quickroom.QRname); - if ( (CC->quickroom.QRflags & QR_MAILBOX) - && (atol(CC->quickroom.QRname) == CC->usersupp.usernum) ) { + strcpy(truncated_roomname, CC->room.QRname); + if ( (CC->room.QRflags & QR_MAILBOX) + && (atol(CC->room.QRname) == CC->user.usernum) ) { strcpy(truncated_roomname, &truncated_roomname[11]); } if (retmsgs != NULL) *retmsgs = total_messages; if (retnew != NULL) *retnew = new_messages; lprintf(9, "<%s> %d new of %d total messages\n", - CC->quickroom.QRname, + CC->room.QRname, new_messages, total_messages ); @@ -829,15 +829,15 @@ void usergoto(char *where, int display_result, int transiently, (int)new_messages, (int)total_messages, (int)info, - (int)CC->quickroom.QRflags, - (long)CC->quickroom.QRhighest, + (int)CC->room.QRflags, + (long)CC->room.QRhighest, (long)vbuf.v_lastseen, (int)rmailflag, (int)raideflag, (int)newmailcount, - (int)CC->quickroom.QRfloor, + (int)CC->room.QRfloor, (int)vbuf.v_view, - (int)CC->quickroom.QRdefaultview + (int)CC->room.QRdefaultview ); } } @@ -848,7 +848,7 @@ void usergoto(char *where, int display_result, int transiently, */ void cmd_goto(char *gargs) { - struct quickroom QRscratch; + struct room QRscratch; int c; int ok = 0; int ra; @@ -863,7 +863,7 @@ void cmd_goto(char *gargs) extract(password, gargs, 1); transiently = extract_int(gargs, 2); - getuser(&CC->usersupp, CC->curr_user); + getuser(&CC->user, CC->curr_user); if (!strcasecmp(towhere, "_BASEROOM_")) strcpy(towhere, config.c_baseroom); @@ -881,7 +881,7 @@ void cmd_goto(char *gargs) /* Then try a mailbox name match */ if (c != 0) { MailboxName(augmented_roomname, sizeof augmented_roomname, - &CC->usersupp, towhere); + &CC->user, towhere); c = getroom(&QRscratch, augmented_roomname); if (c == 0) strcpy(towhere, augmented_roomname); @@ -892,14 +892,14 @@ void cmd_goto(char *gargs) /* Let internal programs go directly to any room. */ if (CC->internal_pgm) { - memcpy(&CC->quickroom, &QRscratch, - sizeof(struct quickroom)); + memcpy(&CC->room, &QRscratch, + sizeof(struct room)); usergoto(NULL, 1, transiently, NULL, NULL); return; } /* See if there is an existing user/room relationship */ - ra = CtdlRoomAccess(&QRscratch, &CC->usersupp); + ra = CtdlRoomAccess(&QRscratch, &CC->user); /* normal clients have to pass through security */ if (ra & UA_GOTOALLOWED) { @@ -909,14 +909,14 @@ void cmd_goto(char *gargs) if (ok == 1) { if ((QRscratch.QRflags & QR_MAILBOX) && ((ra & UA_GOTOALLOWED))) { - memcpy(&CC->quickroom, &QRscratch, - sizeof(struct quickroom)); + memcpy(&CC->room, &QRscratch, + sizeof(struct room)); usergoto(NULL, 1, transiently, NULL, NULL); return; } else if ((QRscratch.QRflags & QR_PASSWORDED) && ((ra & UA_KNOWN) == 0) && (strcasecmp(QRscratch.QRpasswd, password)) && - (CC->usersupp.axlevel < 6) + (CC->user.axlevel < 6) ) { cprintf("%d wrong or missing passwd\n", ERROR + PASSWORD_REQUIRED); @@ -925,13 +925,13 @@ void cmd_goto(char *gargs) ((QRscratch.QRflags & QR_PASSWORDED) == 0) && ((QRscratch.QRflags & QR_GUESSNAME) == 0) && ((ra & UA_KNOWN) == 0) && - (CC->usersupp.axlevel < 6) + (CC->user.axlevel < 6) ) { lprintf(9, "Failed to acquire private room\n"); goto NOPE; } else { - memcpy(&CC->quickroom, &QRscratch, - sizeof(struct quickroom)); + memcpy(&CC->room, &QRscratch, + sizeof(struct room)); usergoto(NULL, 1, transiently, NULL, NULL); return; } @@ -944,17 +944,17 @@ NOPE: cprintf("%d room '%s' not found\n", ERROR + ROOM_NOT_FOUND, towhere); void cmd_whok(void) { - struct usersupp temp; + struct user temp; struct cdbdata *cdbus; - getuser(&CC->usersupp, CC->curr_user); + getuser(&CC->user, CC->curr_user); /* * This command is only allowed by aides, room aides, * and room namespace owners */ if (is_room_aide() - || (atol(CC->quickroom.QRname) == CC->usersupp.usernum) ) { + || (atol(CC->room.QRname) == CC->user.usernum) ) { /* access granted */ } else { @@ -971,8 +971,8 @@ void cmd_whok(void) memcpy(&temp, cdbus->ptr, sizeof temp); cdb_free(cdbus); - if ((CC->quickroom.QRflags & QR_INUSE) - && (CtdlRoomAccess(&CC->quickroom, &temp) & UA_KNOWN) + if ((CC->room.QRflags & QR_INUSE) + && (CtdlRoomAccess(&CC->room, &temp) & UA_KNOWN) ) cprintf("%s\n", temp.fullname); } @@ -993,27 +993,27 @@ void cmd_rdir(void) if (CtdlAccessCheck(ac_logged_in)) return; - getroom(&CC->quickroom, CC->quickroom.QRname); - getuser(&CC->usersupp, CC->curr_user); + getroom(&CC->room, CC->room.QRname); + getuser(&CC->user, CC->curr_user); - if ((CC->quickroom.QRflags & QR_DIRECTORY) == 0) { + if ((CC->room.QRflags & QR_DIRECTORY) == 0) { cprintf("%d not here.\n", ERROR + NOT_HERE); return; } - if (((CC->quickroom.QRflags & QR_VISDIR) == 0) - && (CC->usersupp.axlevel < 6) - && (CC->usersupp.usernum != CC->quickroom.QRroomaide)) { + if (((CC->room.QRflags & QR_VISDIR) == 0) + && (CC->user.axlevel < 6) + && (CC->user.usernum != CC->room.QRroomaide)) { cprintf("%d not here.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; } cprintf("%d %s|%s/files/%s\n", - LISTING_FOLLOWS, config.c_fqdn, BBSDIR, CC->quickroom.QRdirname); + LISTING_FOLLOWS, config.c_fqdn, BBSDIR, CC->room.QRdirname); snprintf(buf, sizeof buf, "ls %s/files/%s >%s 2> /dev/null", - BBSDIR, CC->quickroom.QRdirname, CC->temp); + BBSDIR, CC->room.QRdirname, CC->temp); system(buf); - snprintf(buf, sizeof buf, "%s/files/%s/filedir", BBSDIR, CC->quickroom.QRdirname); + snprintf(buf, sizeof buf, "%s/files/%s/filedir", BBSDIR, CC->room.QRdirname); fd = fopen(buf, "r"); if (fd == NULL) fd = fopen("/dev/null", "r"); @@ -1023,7 +1023,7 @@ void cmd_rdir(void) flnm[strlen(flnm) - 1] = 0; if (strcasecmp(flnm, "filedir")) { snprintf(buf, sizeof buf, "%s/files/%s/%s", - BBSDIR, CC->quickroom.QRdirname, flnm); + BBSDIR, CC->room.QRdirname, flnm); stat(buf, &statbuf); strcpy(comment, ""); fseek(fd, 0L, 0); @@ -1053,26 +1053,26 @@ void cmd_getr(void) { if (CtdlAccessCheck(ac_room_aide)) return; - getroom(&CC->quickroom, CC->quickroom.QRname); + getroom(&CC->room, CC->room.QRname); cprintf("%d%c%s|%s|%s|%d|%d|%d|%d|%d|\n", CIT_OK, CtdlCheckExpress(), - ((CC->quickroom.QRflags & QR_MAILBOX) ? - &CC->quickroom.QRname[11] : CC->quickroom.QRname), + ((CC->room.QRflags & QR_MAILBOX) ? + &CC->room.QRname[11] : CC->room.QRname), - ((CC->quickroom.QRflags & QR_PASSWORDED) ? - CC->quickroom.QRpasswd : ""), + ((CC->room.QRflags & QR_PASSWORDED) ? + CC->room.QRpasswd : ""), - ((CC->quickroom.QRflags & QR_DIRECTORY) ? - CC->quickroom.QRdirname : ""), + ((CC->room.QRflags & QR_DIRECTORY) ? + CC->room.QRdirname : ""), - CC->quickroom.QRflags, - (int) CC->quickroom.QRfloor, - (int) CC->quickroom.QRorder, + CC->room.QRflags, + (int) CC->room.QRfloor, + (int) CC->room.QRorder, - CC->quickroom.QRdefaultview, - CC->quickroom.QRflags2 + CC->room.QRdefaultview, + CC->room.QRflags2 ); } @@ -1087,8 +1087,8 @@ void cmd_getr(void) */ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) { int old_floor = 0; - struct quickroom qrbuf; - struct quickroom qrtmp; + struct room qrbuf; + struct room qrtmp; int ret = 0; struct floor *fl; struct floor flbuf; @@ -1116,9 +1116,9 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) { ret = crr_room_not_found; } - else if ( (CC->usersupp.axlevel < 6) - && (CC->usersupp.usernum != qrbuf.QRroomaide) - && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CC->usersupp.usernum))) ) { + else if ( (CC->user.axlevel < 6) + && (CC->user.usernum != qrbuf.QRroomaide) + && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CC->user.usernum))) ) { ret = crr_access_denied; } @@ -1186,9 +1186,9 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) { lgetfloor(&flbuf, old_floor); --flbuf.f_ref_count; lputfloor(&flbuf, old_floor); - lgetfloor(&flbuf, CC->quickroom.QRfloor); + lgetfloor(&flbuf, CC->room.QRfloor); ++flbuf.f_ref_count; - lputfloor(&flbuf, CC->quickroom.QRfloor); + lputfloor(&flbuf, CC->room.QRfloor); } /* ...and everybody say "YATTA!" */ @@ -1218,14 +1218,14 @@ void cmd_setr(char *args) /* When is a new name more than just a new name? When the old name * has a namespace prefix. */ - if (CC->quickroom.QRflags & QR_MAILBOX) { - sprintf(new_name, "%010ld.", atol(CC->quickroom.QRname) ); + if (CC->room.QRflags & QR_MAILBOX) { + sprintf(new_name, "%010ld.", atol(CC->room.QRname) ); } else { strcpy(new_name, ""); } extract(&new_name[strlen(new_name)], args, 0); - r = CtdlRenameRoom(CC->quickroom.QRname, new_name, new_floor); + r = CtdlRenameRoom(CC->room.QRname, new_name, new_floor); if (r == crr_room_not_found) { cprintf("%d Internal error - room not found?\n", ERROR); @@ -1240,7 +1240,7 @@ void cmd_setr(char *args) } else if (r == crr_access_denied) { cprintf("%d You do not have permission to edit '%s'\n", ERROR + HIGHER_ACCESS_REQUIRED, - CC->quickroom.QRname); + CC->room.QRname); } else if (r != crr_ok) { cprintf("%d Error: CtdlRenameRoom() returned %d\n", ERROR, r); @@ -1250,7 +1250,7 @@ void cmd_setr(char *args) return; } - getroom(&CC->quickroom, new_name); + getroom(&CC->room, new_name); /* Now we have to do a bunch of other stuff */ @@ -1262,76 +1262,76 @@ void cmd_setr(char *args) new_order = 127; } - lgetroom(&CC->quickroom, CC->quickroom.QRname); + lgetroom(&CC->room, CC->room.QRname); /* Directory room */ extract(buf, args, 2); buf[15] = 0; - safestrncpy(CC->quickroom.QRdirname, buf, - sizeof CC->quickroom.QRdirname); + safestrncpy(CC->room.QRdirname, buf, + sizeof CC->room.QRdirname); /* Default view */ if (num_parms(args) >= 8) { - CC->quickroom.QRdefaultview = extract_int(args, 7); + CC->room.QRdefaultview = extract_int(args, 7); } /* Second set of flags */ if (num_parms(args) >= 9) { - CC->quickroom.QRflags2 = extract_int(args, 8); + CC->room.QRflags2 = extract_int(args, 8); } /* Misc. flags */ - CC->quickroom.QRflags = (extract_int(args, 3) | QR_INUSE); + CC->room.QRflags = (extract_int(args, 3) | QR_INUSE); /* Clean up a client boo-boo: if the client set the room to * guess-name or passworded, ensure that the private flag is * also set. */ - if ((CC->quickroom.QRflags & QR_GUESSNAME) - || (CC->quickroom.QRflags & QR_PASSWORDED)) - CC->quickroom.QRflags |= QR_PRIVATE; + if ((CC->room.QRflags & QR_GUESSNAME) + || (CC->room.QRflags & QR_PASSWORDED)) + CC->room.QRflags |= QR_PRIVATE; /* Some changes can't apply to BASEROOM */ - if (!strncasecmp(CC->quickroom.QRname, config.c_baseroom, + if (!strncasecmp(CC->room.QRname, config.c_baseroom, ROOMNAMELEN)) { - CC->quickroom.QRorder = 0; - CC->quickroom.QRpasswd[0] = '\0'; - CC->quickroom.QRflags &= ~(QR_PRIVATE & QR_PASSWORDED & + CC->room.QRorder = 0; + CC->room.QRpasswd[0] = '\0'; + CC->room.QRflags &= ~(QR_PRIVATE & QR_PASSWORDED & QR_GUESSNAME & QR_PREFONLY & QR_MAILBOX); - CC->quickroom.QRflags |= QR_PERMANENT; + CC->room.QRflags |= QR_PERMANENT; } else { /* March order (doesn't apply to AIDEROOM) */ if (num_parms(args) >= 7) - CC->quickroom.QRorder = (char) new_order; + CC->room.QRorder = (char) new_order; /* Room password */ extract(buf, args, 1); buf[10] = 0; - safestrncpy(CC->quickroom.QRpasswd, buf, - sizeof CC->quickroom.QRpasswd); + safestrncpy(CC->room.QRpasswd, buf, + sizeof CC->room.QRpasswd); /* Kick everyone out if the client requested it * (by changing the room's generation number) */ if (extract_int(args, 4)) { - time(&CC->quickroom.QRgen); + time(&CC->room.QRgen); } } /* Some changes can't apply to AIDEROOM */ - if (!strncasecmp(CC->quickroom.QRname, config.c_baseroom, + if (!strncasecmp(CC->room.QRname, config.c_baseroom, ROOMNAMELEN)) { - CC->quickroom.QRorder = 0; - CC->quickroom.QRflags &= ~QR_MAILBOX; - CC->quickroom.QRflags |= QR_PERMANENT; + CC->room.QRorder = 0; + CC->room.QRflags &= ~QR_MAILBOX; + CC->room.QRflags |= QR_PERMANENT; } /* Write the room record back to disk */ - lputroom(&CC->quickroom); + lputroom(&CC->room); /* Create a room directory if necessary */ - if (CC->quickroom.QRflags & QR_DIRECTORY) { + if (CC->room.QRflags & QR_DIRECTORY) { snprintf(buf, sizeof buf, "./files/%s", - CC->quickroom.QRdirname); + CC->room.QRdirname); mkdir(buf, 0755); } - snprintf(buf, sizeof buf, "%s> edited by %s\n", CC->quickroom.QRname, CC->curr_user); + snprintf(buf, sizeof buf, "%s> edited by %s\n", CC->room.QRname, CC->curr_user); aide_message(buf); cprintf("%d Ok\n", CIT_OK); } @@ -1343,11 +1343,11 @@ void cmd_setr(char *args) */ void cmd_geta(void) { - struct usersupp usbuf; + struct user usbuf; if (CtdlAccessCheck(ac_logged_in)) return; - if (getuserbynumber(&usbuf, CC->quickroom.QRroomaide) == 0) { + if (getuserbynumber(&usbuf, CC->room.QRroomaide) == 0) { cprintf("%d %s\n", CIT_OK, usbuf.fullname); } else { cprintf("%d \n", CIT_OK); @@ -1360,7 +1360,7 @@ void cmd_geta(void) */ void cmd_seta(char *new_ra) { - struct usersupp usbuf; + struct user usbuf; long newu; char buf[SIZ]; int post_notice; @@ -1373,13 +1373,13 @@ void cmd_seta(char *new_ra) newu = usbuf.usernum; } - lgetroom(&CC->quickroom, CC->quickroom.QRname); + lgetroom(&CC->room, CC->room.QRname); post_notice = 0; - if (CC->quickroom.QRroomaide != newu) { + if (CC->room.QRroomaide != newu) { post_notice = 1; } - CC->quickroom.QRroomaide = newu; - lputroom(&CC->quickroom); + CC->room.QRroomaide = newu; + lputroom(&CC->room); /* * We have to post the change notice _after_ writing changes to @@ -1389,11 +1389,11 @@ void cmd_seta(char *new_ra) if (strlen(usbuf.fullname) > 0) snprintf(buf, sizeof buf, "%s is now room aide for %s>\n", - usbuf.fullname, CC->quickroom.QRname); + usbuf.fullname, CC->room.QRname); else snprintf(buf, sizeof buf, "There is now no room aide for %s>\n", - CC->quickroom.QRname); + CC->room.QRname); aide_message(buf); } cprintf("%d Ok\n", CIT_OK); @@ -1403,7 +1403,7 @@ void cmd_seta(char *new_ra) * Generate an associated file name for a room */ void assoc_file_name(char *buf, size_t n, - struct quickroom *qrbuf, const char *prefix) + struct room *qrbuf, const char *prefix) { snprintf(buf, n, "./%s/%ld", prefix, qrbuf->QRnumber); } @@ -1417,7 +1417,7 @@ void cmd_rinf(void) char buf[SIZ]; FILE *info_fp; - assoc_file_name(filename, sizeof filename, &CC->quickroom, "info"); + assoc_file_name(filename, sizeof filename, &CC->room, "info"); info_fp = fopen(filename, "r"); if (info_fp == NULL) { @@ -1437,7 +1437,7 @@ void cmd_rinf(void) /* * Back end processing to delete a room and everything associated with it */ -void delete_room(struct quickroom *qrbuf) +void delete_room(struct room *qrbuf) { struct floor flbuf; char filename[100]; @@ -1480,7 +1480,7 @@ void delete_room(struct quickroom *qrbuf) /* * Check access control for deleting a room */ -int CtdlDoIHavePermissionToDeleteThisRoom(struct quickroom *qr) { +int CtdlDoIHavePermissionToDeleteThisRoom(struct room *qr) { if ((!(CC->logged_in)) && (!(CC->internal_pgm))) { return(0); @@ -1497,7 +1497,7 @@ int CtdlDoIHavePermissionToDeleteThisRoom(struct quickroom *qr) { if (strlen(qr->QRname) < 12) return(0); /* bad name */ - if (atol(qr->QRname) != CC->usersupp.usernum) { + if (atol(qr->QRname) != CC->user.usernum) { return(0); /* not my room */ } @@ -1525,20 +1525,20 @@ void cmd_kill(char *argbuf) kill_ok = extract_int(argbuf, 0); - if (CtdlDoIHavePermissionToDeleteThisRoom(&CC->quickroom) == 0) { + if (CtdlDoIHavePermissionToDeleteThisRoom(&CC->room) == 0) { cprintf("%d Can't delete this room.\n", ERROR + NOT_HERE); return; } if (kill_ok) { - if (CC->quickroom.QRflags & QR_MAILBOX) { - strcpy(deleted_room_name, &CC->quickroom.QRname[11]); + if (CC->room.QRflags & QR_MAILBOX) { + strcpy(deleted_room_name, &CC->room.QRname[11]); } else { - strcpy(deleted_room_name, CC->quickroom.QRname); + strcpy(deleted_room_name, CC->room.QRname); } /* Do the dirty work */ - delete_room(&CC->quickroom); + delete_room(&CC->room); /* Return to the Lobby */ usergoto(config.c_baseroom, 0, 0, NULL, NULL); @@ -1568,7 +1568,7 @@ unsigned create_room(char *new_room_name, int avoid_access) { - struct quickroom qrbuf; + struct room qrbuf; struct floor flbuf; struct visit vbuf; @@ -1579,7 +1579,7 @@ unsigned create_room(char *new_room_name, } - memset(&qrbuf, 0, sizeof(struct quickroom)); + memset(&qrbuf, 0, sizeof(struct room)); safestrncpy(qrbuf.QRpasswd, new_room_pass, sizeof qrbuf.QRpasswd); qrbuf.QRflags = QR_INUSE; if (new_room_type > 0) @@ -1595,7 +1595,7 @@ unsigned create_room(char *new_room_name, * name accordingly (prepend the user number) */ if (new_room_type == 4) { - MailboxName(qrbuf.QRname, sizeof qrbuf.QRname, &CC->usersupp, new_room_name); + MailboxName(qrbuf.QRname, sizeof qrbuf.QRname, &CC->user, new_room_name); } else { safestrncpy(qrbuf.QRname, new_room_name, sizeof qrbuf.QRname); @@ -1606,7 +1606,7 @@ unsigned create_room(char *new_room_name, * set the room aide to undefined. */ if ((qrbuf.QRflags & QR_PRIVATE) && (CREATAIDE == 1)) { - qrbuf.QRroomaide = CC->usersupp.usernum; + qrbuf.QRroomaide = CC->user.usernum; } else { qrbuf.QRroomaide = (-1L); } @@ -1634,12 +1634,12 @@ unsigned create_room(char *new_room_name, * parameter was specified. */ if (avoid_access == 0) { - lgetuser(&CC->usersupp, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->usersupp, &qrbuf); + lgetuser(&CC->user, CC->curr_user); + CtdlGetRelationship(&vbuf, &CC->user, &qrbuf); vbuf.v_flags = vbuf.v_flags & ~V_FORGET & ~V_LOCKOUT; vbuf.v_flags = vbuf.v_flags | V_ACCESS; - CtdlSetRelationship(&vbuf, &CC->usersupp, &qrbuf); - lputuser(&CC->usersupp); + CtdlSetRelationship(&vbuf, &CC->user, &qrbuf); + lputuser(&CC->user); } /* resume our happy day */ @@ -1695,7 +1695,7 @@ void cmd_cre8(char *args) if (CtdlAccessCheck(ac_logged_in)) return; - if (CC->usersupp.axlevel < config.c_createax) { + if (CC->user.axlevel < config.c_createax) { cprintf("%d You need higher access to create rooms.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; @@ -1713,7 +1713,7 @@ void cmd_cre8(char *args) if (new_room_type == 5) { if ((config.c_aide_mailboxes == 0) - || (CC->usersupp.axlevel < 6)) { + || (CC->user.axlevel < 6)) { cprintf("%d Higher access required\n", ERROR+HIGHER_ACCESS_REQUIRED); return; @@ -1743,7 +1743,7 @@ void cmd_cre8(char *args) /* post a message in Aide> describing the new room */ safestrncpy(aaa, new_room_name, sizeof aaa); strcat(aaa, "> created by "); - strcat(aaa, CC->usersupp.fullname); + strcat(aaa, CC->user.fullname); if (newflags & QR_MAILBOX) strcat(aaa, " [personal]"); else if (newflags & QR_PRIVATE) @@ -1774,7 +1774,7 @@ void cmd_einf(char *ok) cprintf("%d Ok.\n", CIT_OK); return; } - assoc_file_name(infofilename, sizeof infofilename, &CC->quickroom, "info"); + assoc_file_name(infofilename, sizeof infofilename, &CC->room, "info"); lprintf(9, "opening\n"); fp = fopen(infofilename, "w"); lprintf(9, "checking\n"); @@ -1793,9 +1793,9 @@ void cmd_einf(char *ok) fclose(fp); /* now update the room index so people will see our new info */ - lgetroom(&CC->quickroom, CC->quickroom.QRname); /* lock so no one steps on us */ - CC->quickroom.QRinfo = CC->quickroom.QRhighest + 1L; - lputroom(&CC->quickroom); + lgetroom(&CC->room, CC->room.QRname); /* lock so no one steps on us */ + CC->room.QRinfo = CC->room.QRhighest + 1L; + lputroom(&CC->room); } diff --git a/citadel/room_ops.h b/citadel/room_ops.h index a8ed3b790..4526389b3 100644 --- a/citadel/room_ops.h +++ b/citadel/room_ops.h @@ -1,16 +1,16 @@ /* $Id$ */ -int is_known (struct quickroom *roombuf, int roomnum, - struct usersupp *userbuf); -int has_newmsgs (struct quickroom *roombuf, int roomnum, - struct usersupp *userbuf); -int is_zapped (struct quickroom *roombuf, int roomnum, - struct usersupp *userbuf); -int getroom(struct quickroom *qrbuf, char *room_name); -void b_putroom(struct quickroom *qrbuf, char *room_name); -void putroom(struct quickroom *); +int is_known (struct room *roombuf, int roomnum, + struct user *userbuf); +int has_newmsgs (struct room *roombuf, int roomnum, + struct user *userbuf); +int is_zapped (struct room *roombuf, int roomnum, + struct user *userbuf); +int getroom(struct room *qrbuf, char *room_name); +void b_putroom(struct room *qrbuf, char *room_name); +void putroom(struct room *); void b_deleteroom(char *); -int lgetroom(struct quickroom *qrbuf, char *room_name); -void lputroom(struct quickroom *qrbuf); +int lgetroom(struct room *qrbuf, char *room_name); +void lputroom(struct room *qrbuf); void getfloor (struct floor *flbuf, int floor_num); struct floor *cgetfloor(int floor_num); void lgetfloor (struct floor *flbuf, int floor_num); @@ -46,15 +46,15 @@ void cmd_lflr (void); void cmd_cflr (char *argbuf); void cmd_kflr (char *argbuf); void cmd_eflr (char *argbuf); -void ForEachRoom(void (*CallBack)(struct quickroom *EachRoom, void *out_data), +void ForEachRoom(void (*CallBack)(struct room *EachRoom, void *out_data), void *in_data); void assoc_file_name(char *buf, size_t n, - struct quickroom *qrbuf, const char *prefix); -void delete_room(struct quickroom *qrbuf); -void list_roomname(struct quickroom *qrbuf, int ra); -int is_noneditable(struct quickroom *qrbuf); -int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf); -int CtdlDoIHavePermissionToDeleteThisRoom(struct quickroom *qr); + struct room *qrbuf, const char *prefix); +void delete_room(struct room *qrbuf); +void list_roomname(struct room *qrbuf, int ra); +int is_noneditable(struct room *qrbuf); +int CtdlRoomAccess(struct room *roombuf, struct user *userbuf); +int CtdlDoIHavePermissionToDeleteThisRoom(struct room *qr); int CtdlRenameRoom(char *old_name, char *new_name, int new_floor); /* diff --git a/citadel/rooms.c b/citadel/rooms.c index 971ce88a4..479010743 100644 --- a/citadel/rooms.c +++ b/citadel/rooms.c @@ -429,7 +429,7 @@ void editthisroom(CtdlIPC *ipc) int rbump = 0; char raide[USERNAME_SIZE]; char buf[SIZ]; - struct quickroom *attr = NULL; + struct room *attr = NULL; struct ExpirePolicy *eptr = NULL; int r; /* IPC response code */ diff --git a/citadel/routines.c b/citadel/routines.c index d0538c240..7bb823949 100644 --- a/citadel/routines.c +++ b/citadel/routines.c @@ -107,7 +107,7 @@ void edituser(CtdlIPC *ipc) { char buf[SIZ]; char who[USERNAME_SIZE]; - struct usersupp *user = NULL; + struct user *user = NULL; int newnow = 0; int r; /* IPC response code */ @@ -204,7 +204,7 @@ int set_attr(CtdlIPC *ipc, unsigned int sval, char *prompt, unsigned int sbit, i void enter_config(CtdlIPC *ipc, int mode) { char buf[SIZ]; - struct usersupp *user = NULL; + struct user *user = NULL; int r; /* IPC response code */ r = CtdlIPCGetConfig(ipc, &user, buf); diff --git a/citadel/serv_bio.c b/citadel/serv_bio.c index 62d313f42..186bb4bfa 100644 --- a/citadel/serv_bio.c +++ b/citadel/serv_bio.c @@ -60,7 +60,7 @@ void cmd_ebio(char *cmdbuf) { return; } - snprintf(buf, sizeof buf, "./bio/%ld",CC->usersupp.usernum); + snprintf(buf, sizeof buf, "./bio/%ld",CC->user.usernum); fp = fopen(buf,"w"); if (fp == NULL) { cprintf("%d Cannot create file\n",ERROR); @@ -78,7 +78,7 @@ void cmd_ebio(char *cmdbuf) { */ void cmd_rbio(char *cmdbuf) { - struct usersupp ruser; + struct user ruser; char buf[SIZ]; FILE *fp; @@ -108,7 +108,7 @@ void cmd_rbio(char *cmdbuf) void cmd_lbio(char *cmdbuf) { char buf[SIZ]; FILE *ls; - struct usersupp usbuf; + struct user usbuf; ls=popen("cd ./bio; ls","r"); if (ls==NULL) { diff --git a/citadel/serv_calendar.c b/citadel/serv_calendar.c index 3b8208844..d0d152cc7 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -107,7 +107,7 @@ icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp) { * * ok */ -void ical_write_to_cal(struct usersupp *u, icalcomponent *cal) { +void ical_write_to_cal(struct user *u, icalcomponent *cal) { char temp[PATH_MAX]; FILE *fp; char *ser; @@ -164,7 +164,7 @@ void ical_add(icalcomponent *cal, int recursion_level) { */ if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) { - ical_write_to_cal(&CC->usersupp, cal); + ical_write_to_cal(&CC->user, cal); } @@ -242,7 +242,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) { striplt(attendee_string); recp = validate_recipients(attendee_string); if (recp != NULL) { - if (!strcasecmp(recp->recp_local, CC->usersupp.fullname)) { + if (!strcasecmp(recp->recp_local, CC->user.fullname)) { if (me_attend) icalproperty_free(me_attend); me_attend = icalproperty_new_clone(attendee); } @@ -316,8 +316,8 @@ void ical_send_a_reply(icalcomponent *request, char *action) { serialized_reply ); - msg = CtdlMakeMessage(&CC->usersupp, organizer_string, - CC->quickroom.QRname, 0, FMT_RFC822, + msg = CtdlMakeMessage(&CC->user, organizer_string, + CC->room.QRname, 0, FMT_RFC822, "", summary_string, /* Use summary for subject */ reply_message_text); @@ -429,7 +429,7 @@ void ical_respond(long msgnum, char *partnum, char *action) { /* Now that we've processed this message, we don't need it * anymore. So delete it. */ - CtdlDeleteMessages(CC->quickroom.QRname, msgnum, ""); + CtdlDeleteMessages(CC->room.QRname, msgnum, ""); /* Free the memory we allocated and return a response. */ icalcomponent_free(ird.cal); @@ -623,10 +623,10 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { ical_learn_uid_of_reply(uid, cal); lprintf(9, "UID of event being replied to is <%s>\n", uid); - strcpy(hold_rm, CC->quickroom.QRname); /* save current room */ + strcpy(hold_rm, CC->room.QRname); /* save current room */ - if (getroom(&CC->quickroom, USERCALENDARROOM) != 0) { - getroom(&CC->quickroom, hold_rm); + if (getroom(&CC->room, USERCALENDARROOM) != 0) { + getroom(&CC->room, hold_rm); lprintf(3, "cannot get user calendar room\n"); return(2); } @@ -644,7 +644,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { CtdlForEachMessage(MSGS_ALL, 0, "text/calendar", template, ical_hunt_for_event_to_update, &msgnum_being_replaced); CtdlFreeMessage(template); - getroom(&CC->quickroom, hold_rm); /* return to saved room */ + getroom(&CC->room, hold_rm); /* return to saved room */ lprintf(9, "msgnum_being_replaced == %ld\n", msgnum_being_replaced); if (msgnum_being_replaced == 0) { @@ -685,7 +685,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { icalcomponent_free(original_event); /* Don't need this anymore. */ if (serialized_event == NULL) return(2); - MailboxName(roomname, sizeof roomname, &CC->usersupp, USERCALENDARROOM); + MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM); message_text = mallok(strlen(serialized_event) + SIZ); if (message_text != NULL) { @@ -694,7 +694,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { serialized_event ); - msg = CtdlMakeMessage(&CC->usersupp, + msg = CtdlMakeMessage(&CC->user, "", /* No recipient */ roomname, 0, FMT_RFC822, @@ -785,7 +785,7 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) { /* Now that we've processed this message, we don't need it * anymore. So delete it. (Maybe make this optional?) */ - CtdlDeleteMessages(CC->quickroom.QRname, msgnum, ""); + CtdlDeleteMessages(CC->room.QRname, msgnum, ""); /* Free the memory we allocated and return a response. */ icalcomponent_free(ird.cal); @@ -974,10 +974,10 @@ void ical_hunt_for_conflicts_backend(long msgnum, void *data) { void ical_hunt_for_conflicts(icalcomponent *cal) { char hold_rm[ROOMNAMELEN]; - strcpy(hold_rm, CC->quickroom.QRname); /* save current room */ + strcpy(hold_rm, CC->room.QRname); /* save current room */ - if (getroom(&CC->quickroom, USERCALENDARROOM) != 0) { - getroom(&CC->quickroom, hold_rm); + if (getroom(&CC->room, USERCALENDARROOM) != 0) { + getroom(&CC->room, hold_rm); cprintf("%d You do not have a calendar.\n", ERROR); return; } @@ -991,7 +991,7 @@ void ical_hunt_for_conflicts(icalcomponent *cal) { ); cprintf("000\n"); - getroom(&CC->quickroom, hold_rm); /* return to saved room */ + getroom(&CC->room, hold_rm); /* return to saved room */ } @@ -1137,7 +1137,7 @@ void ical_freebusy_backend(long msgnum, void *data) { * Grab another user's free/busy times */ void ical_freebusy(char *who) { - struct usersupp usbuf; + struct user usbuf; char calendar_room_name[ROOMNAMELEN]; char hold_rm[ROOMNAMELEN]; char *serialized_request = NULL; @@ -1152,11 +1152,11 @@ void ical_freebusy(char *who) { MailboxName(calendar_room_name, sizeof calendar_room_name, &usbuf, USERCALENDARROOM); - strcpy(hold_rm, CC->quickroom.QRname); /* save current room */ + strcpy(hold_rm, CC->room.QRname); /* save current room */ - if (getroom(&CC->quickroom, calendar_room_name) != 0) { + if (getroom(&CC->room, calendar_room_name) != 0) { cprintf("%d Cannot open calendar\n", ERROR+ROOM_NOT_FOUND); - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); return; } @@ -1167,7 +1167,7 @@ void ical_freebusy(char *who) { cprintf("%d Internal error: cannot allocate memory.\n", ERROR+INTERNAL_ERROR); icalcomponent_free(encaps); - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); return; } @@ -1193,7 +1193,7 @@ void ical_freebusy(char *who) { icalcomponent_free(fb); cprintf("%d Internal error: cannot allocate memory.\n", ERROR+INTERNAL_ERROR); - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); return; } @@ -1214,7 +1214,7 @@ void ical_freebusy(char *who) { cprintf("\n000\n"); /* Go back to the room from which we came... */ - getroom(&CC->quickroom, hold_rm); + getroom(&CC->room, hold_rm); } @@ -1281,7 +1281,7 @@ void cmd_ical(char *argbuf) */ void ical_create_room(void) { - struct quickroom qr; + struct room qr; struct visit vbuf; /* Create the calendar room if it doesn't already exist */ @@ -1297,9 +1297,9 @@ void ical_create_room(void) lputroom(&qr); /* Set the view to a calendar view */ - CtdlGetRelationship(&vbuf, &CC->usersupp, &qr); + CtdlGetRelationship(&vbuf, &CC->user, &qr); vbuf.v_view = 3; /* 3 = calendar */ - CtdlSetRelationship(&vbuf, &CC->usersupp, &qr); + CtdlSetRelationship(&vbuf, &CC->user, &qr); /* Create the tasks list room if it doesn't already exist */ create_room(USERTASKSROOM, 4, "", 0, 1, 0); @@ -1314,9 +1314,9 @@ void ical_create_room(void) lputroom(&qr); /* Set the view to a task list view */ - CtdlGetRelationship(&vbuf, &CC->usersupp, &qr); + CtdlGetRelationship(&vbuf, &CC->user, &qr); vbuf.v_view = 4; /* 4 = tasks */ - CtdlSetRelationship(&vbuf, &CC->usersupp, &qr); + CtdlSetRelationship(&vbuf, &CC->user, &qr); return; } @@ -1441,9 +1441,9 @@ void ical_send_out_invitations(icalcomponent *cal) { serialized_request ); - msg = CtdlMakeMessage(&CC->usersupp, + msg = CtdlMakeMessage(&CC->user, "", /* No single recipient here */ - CC->quickroom.QRname, 0, FMT_RFC822, + CC->room.QRname, 0, FMT_RFC822, "", summary_string, /* Use summary for subject */ request_message_text); @@ -1594,8 +1594,8 @@ int ical_obj_beforesave(struct CtdlMessage *msg) */ /* First determine if this is our room */ - MailboxName(roomname, sizeof roomname, &CC->usersupp, USERCALENDARROOM); - if (strcasecmp(roomname, CC->quickroom.QRname)) { + MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM); + if (strcasecmp(roomname, CC->room.QRname)) { return 0; /* It's not the Calendar room. */ } @@ -1692,8 +1692,8 @@ int ical_obj_aftersave(struct CtdlMessage *msg) */ /* First determine if this is our room */ - MailboxName(roomname, sizeof roomname, &CC->usersupp, USERCALENDARROOM); - if (strcasecmp(roomname, CC->quickroom.QRname)) { + MailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM); + if (strcasecmp(roomname, CC->room.QRname)) { return 0; /* It's not the Calendar room. */ } diff --git a/citadel/serv_chat.c b/citadel/serv_chat.c index 9d005dfe9..c7c7a0065 100644 --- a/citadel/serv_chat.c +++ b/citadel/serv_chat.c @@ -64,7 +64,7 @@ void allwrite(char *cmdbuf, int flag, char *username) if (CC->fake_username[0]) un = CC->fake_username; else - un = CC->usersupp.fullname; + un = CC->user.fullname; if (flag == 1) { snprintf(bcast, sizeof bcast, ":|<%s %s>", un, cmdbuf); } else if (flag == 0) { @@ -88,7 +88,7 @@ void allwrite(char *cmdbuf, int flag, char *username) time(&now); clnew->next = NULL; clnew->chat_time = now; - safestrncpy(clnew->chat_room, CC->quickroom.QRname, + safestrncpy(clnew->chat_room, CC->room.QRname, sizeof clnew->chat_room); clnew->chat_room[sizeof clnew->chat_room - 1] = 0; if (username) { @@ -166,8 +166,8 @@ void do_chat_listing(int allflag) begin_critical_section(S_SESSION_TABLE); for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { if (ccptr->cs_flags & CS_CHAT) { - if (!strcasecmp(ccptr->quickroom.QRname, - CC->quickroom.QRname)) { + if (!strcasecmp(ccptr->room.QRname, + CC->room.QRname)) { ++count; } else { @@ -176,7 +176,7 @@ void do_chat_listing(int allflag) } GenerateRoomDisplay(roomname, ccptr, CC); - if ((CC->usersupp.axlevel < 6) + if ((CC->user.axlevel < 6) && (strlen(ccptr->fake_roomname)>0)) { strcpy(roomname, ccptr->fake_roomname); } @@ -196,7 +196,7 @@ void do_chat_listing(int allflag) for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { GenerateRoomDisplay(roomname, ccptr, CC); - if ((CC->usersupp.axlevel < 6) + if ((CC->user.axlevel < 6) && (strlen(ccptr->fake_roomname)>0)) { strcpy(roomname, ccptr->fake_roomname); } @@ -358,7 +358,7 @@ void cmd_chat(char *argbuf) ThisLastMsg = ChatLastMsg; for (clptr = ChatQueue; clptr != NULL; clptr = clptr->next) { if ((clptr->chat_seq > MyLastMsg) && ((!clptr->chat_username[0]) || (!strncasecmp(un, clptr->chat_username, 32)))) { - if ((!clptr->chat_room[0]) || (!strncasecmp(CC->quickroom.QRname, clptr->chat_room, ROOMNAMELEN))) { + if ((!clptr->chat_room[0]) || (!strncasecmp(CC->room.QRname, clptr->chat_room, ROOMNAMELEN))) { cprintf("%s\n", clptr->chat_text); } } @@ -532,12 +532,12 @@ int send_express_message(char *lun, char *x_user, char *x_msg) if (ccptr->fake_username[0]) /* */ un = ccptr->fake_username; else - un = ccptr->usersupp.fullname; + un = ccptr->user.fullname; if ( ((!strcasecmp(un, x_user)) || (!strcasecmp(x_user, "broadcast"))) && ((ccptr->disable_exp == 0) - || (CC->usersupp.axlevel >= 6)) ) { + || (CC->user.axlevel >= 6)) ) { if (do_send) { newmsg = (struct ExpressMessage *) mallok(sizeof (struct ExpressMessage)); @@ -559,7 +559,7 @@ int send_express_message(char *lun, char *x_user, char *x_msg) sptr->next = sl; MailboxName(sptr->roomname, sizeof sptr->roomname, - &ccptr->usersupp, PAGELOGROOM); + &ccptr->user, PAGELOGROOM); sl = sptr; } } @@ -632,7 +632,7 @@ void cmd_sexp(char *argbuf) if (CC->fake_username[0]) lun = CC->fake_username; else - lun = CC->usersupp.fullname; + lun = CC->user.fullname; extract(x_user, argbuf, 0); @@ -642,7 +642,7 @@ void cmd_sexp(char *argbuf) cprintf("%d You were not previously paged.\n", ERROR); return; } - if ((!strcasecmp(x_user, "broadcast")) && (CC->usersupp.axlevel < 6)) { + if ((!strcasecmp(x_user, "broadcast")) && (CC->user.axlevel < 6)) { cprintf("%d Higher access required to send a broadcast.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; @@ -734,7 +734,7 @@ void cmd_reqt(char *argbuf) { memset(newmsg, 0, sizeof (struct ExpressMessage)); time(&(newmsg->timestamp)); - safestrncpy(newmsg->sender, CC->usersupp.fullname, + safestrncpy(newmsg->sender, CC->user.fullname, sizeof newmsg->sender); newmsg->flags |= EM_GO_AWAY; newmsg->text = strdoop("Automatic logoff requested."); diff --git a/citadel/serv_expire.c b/citadel/serv_expire.c index 83a39308a..76ccd8e6b 100644 --- a/citadel/serv_expire.c +++ b/citadel/serv_expire.c @@ -117,7 +117,7 @@ extern struct CitContext *ContextList; * First phase of message purge -- gather the locations of messages which * qualify for purging and write them to a temp file. */ -void GatherPurgeMessages(struct quickroom *qrbuf, void *data) { +void GatherPurgeMessages(struct room *qrbuf, void *data) { struct ExpirePolicy epbuf; long delnum; time_t xtime, now; @@ -233,7 +233,7 @@ void PurgeMessages(void) { } -void AddValidUser(struct usersupp *usbuf, void *data) { +void AddValidUser(struct user *usbuf, void *data) { struct ValidUser *vuptr; vuptr = (struct ValidUser *)mallok(sizeof(struct ValidUser)); @@ -242,7 +242,7 @@ void AddValidUser(struct usersupp *usbuf, void *data) { ValidUserList = vuptr; } -void AddValidRoom(struct quickroom *qrbuf, void *data) { +void AddValidRoom(struct room *qrbuf, void *data) { struct ValidRoom *vrptr; vrptr = (struct ValidRoom *)mallok(sizeof(struct ValidRoom)); @@ -252,7 +252,7 @@ void AddValidRoom(struct quickroom *qrbuf, void *data) { ValidRoomList = vrptr; } -void DoPurgeRooms(struct quickroom *qrbuf, void *data) { +void DoPurgeRooms(struct room *qrbuf, void *data) { time_t age, purge_secs; struct PurgeList *pptr; struct ValidUser *vuptr; @@ -307,7 +307,7 @@ void DoPurgeRooms(struct quickroom *qrbuf, void *data) { int PurgeRooms(void) { struct PurgeList *pptr; int num_rooms_purged = 0; - struct quickroom qrbuf; + struct room qrbuf; struct ValidUser *vuptr; char *transcript = NULL; @@ -353,7 +353,7 @@ int PurgeRooms(void) { } -void do_user_purge(struct usersupp *us, void *data) { +void do_user_purge(struct user *us, void *data) { int purge; time_t now; time_t purge_time; @@ -361,7 +361,7 @@ void do_user_purge(struct usersupp *us, void *data) { /* stupid recovery routine to re-create missing mailboxen. * don't enable this. - struct quickroom qrbuf; + struct room qrbuf; char mailboxname[ROOMNAMELEN]; MailboxName(mailboxname, us, MAILROOM); create_room(mailboxname, 4, "", 0, 1, 1); @@ -648,9 +648,9 @@ void do_fsck_msg(long msgnum, void *userdata) { rr = ptr; } -void do_fsck_room(struct quickroom *qrbuf, void *data) +void do_fsck_room(struct room *qrbuf, void *data) { - getroom(&CC->quickroom, qrbuf->QRname); + getroom(&CC->room, qrbuf->QRname); CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, do_fsck_msg, NULL); } diff --git a/citadel/serv_imap.c b/citadel/serv_imap.c index 34f04f6f6..ab15d9e12 100644 --- a/citadel/serv_imap.c +++ b/citadel/serv_imap.c @@ -123,7 +123,7 @@ void imap_set_seen_flags(void) { struct visit vbuf; int i; - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); if (IMAP->num_msgs > 0) { for (i=0; inum_msgs; ++i) { if (is_msg_in_mset(vbuf.v_seen, IMAP->msgids[i])) { @@ -210,7 +210,7 @@ void imap_rescan_msgids(void) { /* Load the *current* message list from disk, so we can compare it * to what we have in memory. */ - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr != NULL) { msglist = mallok(cdbfr->len); memcpy(msglist, cdbfr->ptr, cdbfr->len); @@ -465,7 +465,7 @@ void imap_select(int num_parms, char *parms[]) { int c = 0; int ok = 0; int ra = 0; - struct quickroom QRscratch; + struct room QRscratch; int msgs, new; int floornum; int roomflags; @@ -487,7 +487,7 @@ void imap_select(int num_parms, char *parms[]) { /* Then try a mailbox name match */ if (c != 0) { MailboxName(augmented_roomname, sizeof augmented_roomname, - &CC->usersupp, towhere); + &CC->user, towhere); c = getroom(&QRscratch, augmented_roomname); if (c == 0) strcpy(towhere, augmented_roomname); @@ -496,7 +496,7 @@ void imap_select(int num_parms, char *parms[]) { /* If the room exists, check security/access */ if (c == 0) { /* See if there is an existing user/room relationship */ - ra = CtdlRoomAccess(&QRscratch, &CC->usersupp); + ra = CtdlRoomAccess(&QRscratch, &CC->user); /* normal clients have to pass through security */ if (ra & UA_KNOWN) { @@ -516,7 +516,7 @@ void imap_select(int num_parms, char *parms[]) { * usergoto() formally takes us to the desired room, happily returning * the number of messages and number of new messages. */ - memcpy(&CC->quickroom, &QRscratch, sizeof(struct quickroom)); + memcpy(&CC->room, &QRscratch, sizeof(struct room)); usergoto(NULL, 0, 0, &msgs, &new); IMAP->selected = 1; @@ -552,7 +552,7 @@ int imap_do_expunge(void) { if (IMAP->num_msgs > 0) for (i=0; inum_msgs; ++i) { if (IMAP->flags[i] & IMAP_DELETED) { - CtdlDeleteMessages(CC->quickroom.QRname, + CtdlDeleteMessages(CC->room.QRname, IMAP->msgids[i], ""); ++num_expunged; lprintf(9, "%ld ... deleted\n", IMAP->msgids[i]); @@ -625,7 +625,7 @@ void imap_list_floors(char *cmd, char *pattern) { * IMAP "subscribed folder" is equivocated to Citadel "known rooms." This * may or may not be the desired behavior in the future. */ -void imap_lsub_listroom(struct quickroom *qrbuf, void *data) { +void imap_lsub_listroom(struct room *qrbuf, void *data) { char buf[SIZ]; int ra; char *pattern; @@ -633,7 +633,7 @@ void imap_lsub_listroom(struct quickroom *qrbuf, void *data) { pattern = (char *)data; /* Only list rooms to which the user has access!! */ - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if (ra & UA_KNOWN) { imap_mailboxname(buf, sizeof buf, qrbuf); if (imap_mailbox_matches_pattern(pattern, buf)) { @@ -673,7 +673,7 @@ void imap_lsub(int num_parms, char *parms[]) { /* * Back end for imap_list() */ -void imap_list_listroom(struct quickroom *qrbuf, void *data) { +void imap_list_listroom(struct room *qrbuf, void *data) { char buf[SIZ]; int ra; char *pattern; @@ -681,7 +681,7 @@ void imap_list_listroom(struct quickroom *qrbuf, void *data) { pattern = (char *)data; /* Only list rooms to which the user has access!! */ - ra = CtdlRoomAccess(qrbuf, &CC->usersupp); + ra = CtdlRoomAccess(qrbuf, &CC->user); if ( (ra & UA_KNOWN) || ((ra & UA_GOTOALLOWED) && (ra & UA_ZAPPED))) { imap_mailboxname(buf, sizeof buf, qrbuf); @@ -773,7 +773,7 @@ int imap_grabroom(char *returned_roomname, char *foldername) { char augmented_roomname[ROOMNAMELEN]; char roomname[ROOMNAMELEN]; int c; - struct quickroom QRscratch; + struct room QRscratch; int ra; int ok = 0; @@ -788,7 +788,7 @@ int imap_grabroom(char *returned_roomname, char *foldername) { /* Then try a mailbox name match */ if (c != 0) { MailboxName(augmented_roomname, sizeof augmented_roomname, - &CC->usersupp, roomname); + &CC->user, roomname); c = getroom(&QRscratch, augmented_roomname); if (c == 0) strcpy(roomname, augmented_roomname); @@ -797,7 +797,7 @@ int imap_grabroom(char *returned_roomname, char *foldername) { /* If the room exists, check security/access */ if (c == 0) { /* See if there is an existing user/room relationship */ - ra = CtdlRoomAccess(&QRscratch, &CC->usersupp); + ra = CtdlRoomAccess(&QRscratch, &CC->user); /* normal clients have to pass through security */ if (ra & UA_KNOWN) { @@ -841,7 +841,7 @@ void imap_status(int num_parms, char *parms[]) { * folder is selected, save its name so we can return there!!!!!) */ if (IMAP->selected) { - strcpy(savedroom, CC->quickroom.QRname); + strcpy(savedroom, CC->room.QRname); } usergoto(roomname, 0, 0, &msgs, &new); @@ -851,7 +851,7 @@ void imap_status(int num_parms, char *parms[]) { * names and simply spew all possible data items. It's far easier to * code and probably saves us some processing time too. */ - imap_mailboxname(buf, sizeof buf, &CC->quickroom); + imap_mailboxname(buf, sizeof buf, &CC->room); cprintf("* STATUS "); imap_strout(buf); cprintf(" (MESSAGES %d ", msgs); @@ -898,7 +898,7 @@ void imap_subscribe(int num_parms, char *parms[]) { * we're looking for. */ if (IMAP->selected) { - strcpy(savedroom, CC->quickroom.QRname); + strcpy(savedroom, CC->room.QRname); } usergoto(roomname, 0, 0, &msgs, &new); @@ -935,7 +935,7 @@ void imap_unsubscribe(int num_parms, char *parms[]) { * usergoto() formally takes us to the desired room. */ if (IMAP->selected) { - strcpy(savedroom, CC->quickroom.QRname); + strcpy(savedroom, CC->room.QRname); } usergoto(roomname, 0, 0, &msgs, &new); @@ -984,16 +984,16 @@ void imap_delete(int num_parms, char *parms[]) { * folder is selected, save its name so we can return there!!!!!) */ if (IMAP->selected) { - strcpy(savedroom, CC->quickroom.QRname); + strcpy(savedroom, CC->room.QRname); } usergoto(roomname, 0, 0, &msgs, &new); /* * Now delete the room. */ - if (CtdlDoIHavePermissionToDeleteThisRoom(&CC->quickroom)) { + if (CtdlDoIHavePermissionToDeleteThisRoom(&CC->room)) { cprintf("%s OK DELETE completed\r\n", parms[0]); - delete_room(&CC->quickroom); + delete_room(&CC->room); } else { cprintf("%s NO Can't delete this folder.\r\n", parms[0]); @@ -1012,7 +1012,7 @@ void imap_delete(int num_parms, char *parms[]) { /* * Back end function for imap_rename() */ -void imap_rename_backend(struct quickroom *qrbuf, void *data) { +void imap_rename_backend(struct room *qrbuf, void *data) { char foldername[SIZ]; char newfoldername[SIZ]; char newroomname[ROOMNAMELEN]; diff --git a/citadel/serv_inetcfg.c b/citadel/serv_inetcfg.c index f585866c2..737a84da3 100644 --- a/citadel/serv_inetcfg.c +++ b/citadel/serv_inetcfg.c @@ -170,7 +170,7 @@ void spamstrings_init_backend(long msgnum, void *userdata) { void inetcfg_init(void) { - if (getroom(&CC->quickroom, SYSCONFIGROOM) != 0) return; + if (getroom(&CC->room, SYSCONFIGROOM) != 0) return; CtdlForEachMessage(MSGS_LAST, 1, INTERNETCFG, NULL, inetcfg_init_backend, NULL); /* diff --git a/citadel/serv_listsub.c b/citadel/serv_listsub.c index 5ac5850e1..5c3fc2581 100644 --- a/citadel/serv_listsub.c +++ b/citadel/serv_listsub.c @@ -81,7 +81,7 @@ void listsub_generate_token(char *buf) { * Enter a subscription request */ void do_subscribe(char *room, char *email, char *subtype, char *webpage) { - struct quickroom qrbuf; + struct room qrbuf; FILE *ncfp; char filename[SIZ]; char token[SIZ]; @@ -193,7 +193,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) { * Enter an unsubscription request */ void do_unsubscribe(char *room, char *email, char *webpage) { - struct quickroom qrbuf; + struct room qrbuf; FILE *ncfp; char filename[SIZ]; char token[SIZ]; @@ -307,7 +307,7 @@ void do_unsubscribe(char *room, char *email, char *webpage) { * Confirm a subscribe/unsubscribe request. */ void do_confirm(char *room, char *token) { - struct quickroom qrbuf; + struct room qrbuf; FILE *ncfp; char filename[SIZ]; char line_token[SIZ]; diff --git a/citadel/serv_network.c b/citadel/serv_network.c index f4ea9df3d..7fb4f0241 100644 --- a/citadel/serv_network.c +++ b/citadel/serv_network.c @@ -334,10 +334,10 @@ void cmd_gnet(char *argbuf) { FILE *fp; if (CtdlAccessCheck(ac_room_aide)) return; - assoc_file_name(filename, sizeof filename, &CC->quickroom, "netconfigs"); + assoc_file_name(filename, sizeof filename, &CC->room, "netconfigs"); cprintf("%d Network settings for room #%ld <%s>\n", LISTING_FOLLOWS, - CC->quickroom.QRnumber, CC->quickroom.QRname); + CC->room.QRnumber, CC->room.QRname); fp = fopen(filename, "r"); if (fp != NULL) { @@ -360,7 +360,7 @@ void cmd_snet(char *argbuf) { if (CtdlAccessCheck(ac_room_aide)) return; safestrncpy(tempfilename, tmpnam(NULL), sizeof tempfilename); - assoc_file_name(filename, sizeof filename, &CC->quickroom, "netconfigs"); + assoc_file_name(filename, sizeof filename, &CC->room, "netconfigs"); fp = fopen(tempfilename, "w"); if (fp == NULL) { @@ -508,7 +508,7 @@ void network_spool_msg(long msgnum, void *userdata) { if (msg->cm_fields['C'] != NULL) { phree(msg->cm_fields['C']); } - msg->cm_fields['C'] = strdoop(CC->quickroom.QRname); + msg->cm_fields['C'] = strdoop(CC->room.QRname); /* * Determine if this message is set to be deleted @@ -573,7 +573,7 @@ void network_spool_msg(long msgnum, void *userdata) { /* Delete this message if delete-after-send is set */ if (delete_after_send) { - CtdlDeleteMessages(CC->quickroom.QRname, msgnum, ""); + CtdlDeleteMessages(CC->room.QRname, msgnum, ""); } } @@ -607,9 +607,9 @@ void network_deliver_digest(struct SpoolControl *sc) { sprintf(buf, "%ld", time(NULL)); msg->cm_fields['T'] = strdoop(buf); - msg->cm_fields['A'] = strdoop(CC->quickroom.QRname); - msg->cm_fields['U'] = strdoop(CC->quickroom.QRname); - sprintf(buf, "room_%s@%s", CC->quickroom.QRname, config.c_fqdn); + msg->cm_fields['A'] = strdoop(CC->room.QRname); + msg->cm_fields['U'] = strdoop(CC->room.QRname); + sprintf(buf, "room_%s@%s", CC->room.QRname, config.c_fqdn); for (i=0; i\n", room_to_spool); - if (getroom(&CC->quickroom, room_to_spool) != 0) { + if (getroom(&CC->room, room_to_spool) != 0) { lprintf(1, "ERROR: cannot load <%s>\n", room_to_spool); return; } memset(&sc, 0, sizeof(struct SpoolControl)); - assoc_file_name(filename, sizeof filename, &CC->quickroom, "netconfigs"); + assoc_file_name(filename, sizeof filename, &CC->room, "netconfigs"); begin_critical_section(S_NETCONFIGS); end_critical_section(S_NETCONFIGS); @@ -708,13 +708,13 @@ void network_spoolout_room(char *room_to_spool) { fp = fopen(filename, "r"); if (fp == NULL) { lprintf(7, "Outbound batch processing skipped for <%s>\n", - CC->quickroom.QRname); + CC->room.QRname); end_critical_section(S_NETCONFIGS); return; } lprintf(5, "Outbound batch processing started for <%s>\n", - CC->quickroom.QRname); + CC->room.QRname); while (fgets(buf, sizeof buf, fp) != NULL) { buf[strlen(buf)-1] = 0; @@ -786,7 +786,7 @@ void network_spoolout_room(char *room_to_spool) { /* If we wrote a digest, deliver it and then close it */ snprintf(buf, sizeof buf, "room_%s@%s", - CC->quickroom.QRname, config.c_fqdn); + CC->room.QRname, config.c_fqdn); for (i=0; iquickroom.QRname, buf + CC->room.QRname, buf ); network_deliver_digest(&sc); /* deliver and close */ } @@ -845,14 +845,14 @@ void network_spoolout_room(char *room_to_spool) { end_critical_section(S_NETCONFIGS); lprintf(5, "Outbound batch processing finished for <%s>\n", - CC->quickroom.QRname); + CC->room.QRname); } /* * Batch up and send all outbound traffic from the current room */ -void network_queue_room(struct quickroom *qrbuf, void *data) { +void network_queue_room(struct room *qrbuf, void *data) { struct RoomProcList *ptr; ptr = (struct RoomProcList *) mallok(sizeof (struct RoomProcList)); diff --git a/citadel/serv_newuser.c b/citadel/serv_newuser.c index 365dd3e58..4d0923368 100644 --- a/citadel/serv_newuser.c +++ b/citadel/serv_newuser.c @@ -63,18 +63,18 @@ void CopyNewUserGreetings(void) { /* Only do this for new users. */ - if (CC->usersupp.timescalled != 1) return; + if (CC->user.timescalled != 1) return; /* This user's mailbox. */ - MailboxName(mailboxname, sizeof mailboxname, &CC->usersupp, MAILROOM); + MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM); /* Go to the source room ... bail out silently if it's not there, * or if it's not private. */ - if (getroom(&CC->quickroom, NEWUSERGREETINGS) != 0) return; - if (! CC->quickroom.QRflags & QR_PRIVATE ) return; + if (getroom(&CC->room, NEWUSERGREETINGS) != 0) return; + if (! CC->room.QRflags & QR_PRIVATE ) return; - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long)); + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); if (cdbfr != NULL) { msglist = mallok(cdbfr->len); diff --git a/citadel/serv_pas2.c b/citadel/serv_pas2.c index bae7fa347..94c6ff483 100644 --- a/citadel/serv_pas2.c +++ b/citadel/serv_pas2.c @@ -52,14 +52,14 @@ void cmd_pas2(char *argbuf) extract(pw, argbuf, 0); - if (getuser(&CC->usersupp, CC->curr_user)) + if (getuser(&CC->user, CC->curr_user)) { cprintf("%d Unable to find user record for %s.\n", ERROR, CC->curr_user); return; } strproc(pw); - strproc(CC->usersupp.password); + strproc(CC->user.password); if (strlen(pw) != (MD5_HEXSTRING_SIZE-1)) { @@ -67,7 +67,7 @@ void cmd_pas2(char *argbuf) return; } - make_apop_string(CC->usersupp.password, CC->cs_nonce, hexstring, sizeof hexstring); + make_apop_string(CC->user.password, CC->cs_nonce, hexstring, sizeof hexstring); if (!strcmp(hexstring, pw)) { diff --git a/citadel/serv_pop3.c b/citadel/serv_pop3.c index 44e501756..26851523b 100644 --- a/citadel/serv_pop3.c +++ b/citadel/serv_pop3.c @@ -161,14 +161,14 @@ int pop3_grab_mailbox(void) { struct visit vbuf; int i; - if (getroom(&CC->quickroom, MAILROOM) != 0) return(-1); + if (getroom(&CC->room, MAILROOM) != 0) return(-1); /* Load up the messages */ CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, pop3_add_message, NULL); /* Figure out which are old and which are new */ - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); POP3->lastseen = (-1); if (POP3->num_msgs) for (i=0; inum_msgs; ++i) { if (is_msg_in_mset(vbuf.v_seen, @@ -187,7 +187,7 @@ void pop3_login(void) msgs = pop3_grab_mailbox(); if (msgs >= 0) { cprintf("+OK %s is logged in (%d messages)\r\n", - CC->usersupp.fullname, msgs); + CC->user.fullname, msgs); lprintf(9, "POP3 password login successful\n"); } else { @@ -232,13 +232,13 @@ void pop3_apop(char *argbuf) return; } - if (getuser(&CC->usersupp, CC->curr_user)) + if (getuser(&CC->user, CC->curr_user)) { cprintf("-ERR No such user.\r\n"); return; } - make_apop_string(CC->usersupp.password, CC->cs_nonce, realdigest, sizeof realdigest); + make_apop_string(CC->user.password, CC->cs_nonce, realdigest, sizeof realdigest); if (!strncasecmp(realdigest, userdigest, MD5_HEXSTRING_SIZE-1)) { do_login(); @@ -447,14 +447,14 @@ void pop3_update(void) { /* Set last read pointer */ if (POP3->num_msgs > 0) { - lgetuser(&CC->usersupp, CC->curr_user); + lgetuser(&CC->user, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", POP3->msgs[POP3->num_msgs-1].msgnum); - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); - lputuser(&CC->usersupp); + lputuser(&CC->user); } } diff --git a/citadel/serv_rwho.c b/citadel/serv_rwho.c index 7645bf7fb..6b1d1abac 100644 --- a/citadel/serv_rwho.c +++ b/citadel/serv_rwho.c @@ -61,7 +61,7 @@ void cmd_rwho(char *argbuf) { char real_room[ROOMNAMELEN], room[ROOMNAMELEN]; char host[64], flags[5]; - aide = CC->usersupp.axlevel >= 6; + aide = CC->user.axlevel >= 6; cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() ); for (cptr = ContextList; cptr != NULL; cptr = cptr->next) diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index f1d1b8b08..b150272d8 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -62,7 +62,7 @@ struct citsmtp { /* Information about the current session */ int command_state; char helo_node[SIZ]; - struct usersupp vrfy_buffer; + struct user vrfy_buffer; int vrfy_count; char vrfy_match[SIZ]; char from[SIZ]; @@ -192,7 +192,7 @@ void smtp_get_pass(char *argbuf) { CtdlDecodeBase64(password, argbuf, SIZ); lprintf(9, "Trying <%s>\n", password); if (CtdlTryPassword(password) == pass_ok) { - cprintf("235 2.0.0 Hello, %s\r\n", CC->usersupp.fullname); + cprintf("235 2.0.0 Hello, %s\r\n", CC->user.fullname); lprintf(9, "SMTP authenticated login successful\n"); CC->internal_pgm = 0; CC->cs_flags &= ~CS_STEALTH; @@ -230,11 +230,11 @@ void smtp_auth(char *argbuf) { /* * Back end for smtp_vrfy() command */ -void smtp_vrfy_backend(struct usersupp *us, void *data) { +void smtp_vrfy_backend(struct user *us, void *data) { if (!fuzzy_match(us, SMTP->vrfy_match)) { ++SMTP->vrfy_count; - memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp)); + memcpy(&SMTP->vrfy_buffer, us, sizeof(struct user)); } } @@ -269,7 +269,7 @@ void smtp_vrfy(char *argbuf) { /* * Back end for smtp_expn() command */ -void smtp_expn_backend(struct usersupp *us, void *data) { +void smtp_expn_backend(struct user *us, void *data) { if (!fuzzy_match(us, SMTP->vrfy_match)) { @@ -281,7 +281,7 @@ void smtp_expn_backend(struct usersupp *us, void *data) { } ++SMTP->vrfy_count; - memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp)); + memcpy(&SMTP->vrfy_buffer, us, sizeof(struct user)); } } @@ -530,7 +530,7 @@ void smtp_data(void) { if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']); if (msg->cm_fields['F'] != NULL) phree(msg->cm_fields['F']); if (msg->cm_fields['O'] != NULL) phree(msg->cm_fields['O']); - msg->cm_fields['A'] = strdoop(CC->usersupp.fullname); + msg->cm_fields['A'] = strdoop(CC->user.fullname); msg->cm_fields['N'] = strdoop(config.c_nodename); msg->cm_fields['H'] = strdoop(config.c_humannode); msg->cm_fields['F'] = strdoop(CC->cs_inet_email); @@ -1348,7 +1348,7 @@ void smtp_do_queue(void) { */ lprintf(7, "SMTP: processing outbound queue\n"); - if (getroom(&CC->quickroom, SMTP_SPOOLOUT_ROOM) != 0) { + if (getroom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) { lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM); return; } @@ -1407,7 +1407,7 @@ void cmd_smtp(char *argbuf) { * Initialize the SMTP outbound queue */ void smtp_init_spoolout(void) { - struct quickroom qrbuf; + struct room qrbuf; /* * Create the room. This will silently fail if the room already diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 60def57dc..3bd60e9e0 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -44,9 +44,9 @@ #include "tools.h" #include "serv_upgrade.h" -void do_pre555_usersupp_upgrade(void) { - struct pre555usersupp usbuf; - struct usersupp newus; +void do_pre555_user_upgrade(void) { + struct pre555user usbuf; + struct user newus; struct cdbdata *cdbus; char tempfilename[PATH_MAX]; FILE *fp, *tp; @@ -63,20 +63,20 @@ void do_pre555_usersupp_upgrade(void) { /* First, back out all old version records to a flat file */ cdb_rewind(CDB_USERSUPP); while(cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) { - memset(&usbuf, 0, sizeof(struct pre555usersupp)); + memset(&usbuf, 0, sizeof(struct pre555user)); memcpy(&usbuf, cdbus->ptr, - ( (cdbus->len > sizeof(struct pre555usersupp)) ? - sizeof(struct pre555usersupp) : cdbus->len) ); + ( (cdbus->len > sizeof(struct pre555user)) ? + sizeof(struct pre555user) : cdbus->len) ); cdb_free(cdbus); - fwrite(&usbuf, sizeof(struct pre555usersupp), 1, fp); + fwrite(&usbuf, sizeof(struct pre555user), 1, fp); } /* ...and overwrite the records with new format records */ rewind(fp); - while (fread(&usbuf, sizeof(struct pre555usersupp), 1, fp) > 0) { + while (fread(&usbuf, sizeof(struct pre555user), 1, fp) > 0) { if (strlen(usbuf.fullname) > 0) { lprintf(9, "Upgrading <%s>\n", usbuf.fullname); - memset(&newus, 0, sizeof(struct usersupp)); + memset(&newus, 0, sizeof(struct user)); newus.uid = usbuf.USuid; strcpy(newus.password, usbuf.password); @@ -133,10 +133,10 @@ void do_pre555_usersupp_upgrade(void) { /* * Back end processing function for cmd_bmbx */ -void cmd_bmbx_backend(struct quickroom *qrbuf, void *data) { +void cmd_bmbx_backend(struct room *qrbuf, void *data) { static struct RoomProcList *rplist = NULL; struct RoomProcList *ptr; - struct quickroom qr; + struct room qr; /* Lazy programming here. Call this function as a ForEachRoom backend * in order to queue up the room names, or call it with a null room @@ -188,10 +188,10 @@ void bump_mailbox_generation_numbers(void) { /* * Back end processing function for convert_bbsuid_to_minusone() */ -void cbtm_backend(struct usersupp *usbuf, void *data) { +void cbtm_backend(struct user *usbuf, void *data) { static struct UserProcList *uplist = NULL; struct UserProcList *ptr; - struct usersupp us; + struct user us; /* Lazy programming here. Call this function as a ForEachUser backend * in order to queue up the room names, or call it with a null user @@ -263,7 +263,7 @@ void check_server_upgrades(void) { return; } - if (CitControl.version < 555) do_pre555_usersupp_upgrade(); + if (CitControl.version < 555) do_pre555_user_upgrade(); if (CitControl.version < 591) bump_mailbox_generation_numbers(); if (CitControl.version < 606) initialize_c_rfc822_strict_from(); if (CitControl.version < 608) convert_bbsuid_to_minusone(); diff --git a/citadel/serv_upgrade.h b/citadel/serv_upgrade.h index ebac97e4e..c8b2d6a1a 100644 --- a/citadel/serv_upgrade.h +++ b/citadel/serv_upgrade.h @@ -4,9 +4,9 @@ */ /* - * Format of a usersupp record prior to version 5.55 + * Format of a user record prior to version 5.55 */ -struct pre555usersupp { /* User record */ +struct pre555user { /* User record */ int USuid; /* userid (==BBSUID for bbs only) */ char password[20]; /* password (for BBS-only users) */ unsigned flags; /* See US_ flags below */ diff --git a/citadel/serv_vandelay.c b/citadel/serv_vandelay.c index bf1368b61..c5a64f83e 100644 --- a/citadel/serv_vandelay.c +++ b/citadel/serv_vandelay.c @@ -50,7 +50,7 @@ char artv_tempfilename1[PATH_MAX]; char artv_tempfilename2[PATH_MAX]; FILE *artv_global_message_list; -void artv_export_users_backend(struct usersupp *usbuf, void *data) { +void artv_export_users_backend(struct user *usbuf, void *data) { cprintf("user\n"); cprintf("%d\n", usbuf->version); cprintf("%ld\n", (long)usbuf->uid); @@ -79,7 +79,7 @@ void artv_export_room_msg(long msgnum, void *userdata) { } -void artv_export_rooms_backend(struct quickroom *qrbuf, void *data) { +void artv_export_rooms_backend(struct room *qrbuf, void *data) { cprintf("room\n"); cprintf("%s\n", qrbuf->QRname); cprintf("%s\n", qrbuf->QRpasswd); @@ -98,7 +98,7 @@ void artv_export_rooms_backend(struct quickroom *qrbuf, void *data) { cprintf("%u\n", qrbuf->QRflags2); cprintf("%d\n", qrbuf->QRdefaultview); - getroom(&CC->quickroom, qrbuf->QRname); + getroom(&CC->room, qrbuf->QRname); /* format of message list export is all message numbers output * one per line terminated by a 0. */ @@ -363,7 +363,7 @@ void artv_import_control(void) { void artv_import_user(void) { char buf[SIZ]; - struct usersupp usbuf; + struct user usbuf; client_gets(buf); usbuf.version = atoi(buf); client_gets(buf); usbuf.uid = atoi(buf); @@ -384,7 +384,7 @@ void artv_import_user(void) { void artv_import_room(void) { char buf[SIZ]; - struct quickroom qrbuf; + struct room qrbuf; long msgnum; int msgcount = 0; diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 6aeab4f0a..beed02f7f 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -185,10 +185,10 @@ void cmd_igab(char *argbuf) { if (CtdlAccessCheck(ac_aide)) return; - strcpy(hold_rm, CC->quickroom.QRname); /* save current room */ + strcpy(hold_rm, CC->room.QRname); /* save current room */ - if (getroom(&CC->quickroom, ADDRESS_BOOK_ROOM) != 0) { - getroom(&CC->quickroom, hold_rm); + if (getroom(&CC->room, ADDRESS_BOOK_ROOM) != 0) { + getroom(&CC->room, hold_rm); cprintf("%d cannot get address book room\n", ERROR); return; } @@ -201,7 +201,7 @@ void cmd_igab(char *argbuf) { CtdlForEachMessage(MSGS_ALL, 0, "text/x-vcard", NULL, vcard_add_to_directory, NULL); - getroom(&CC->quickroom, hold_rm); /* return to saved room */ + getroom(&CC->room, hold_rm); /* return to saved room */ cprintf("%d Directory has been rebuilt.\n", CIT_OK); } @@ -255,14 +255,14 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) { char *ptr; int linelen; char buf[SIZ]; - struct usersupp usbuf; + struct user usbuf; long what_user; if (!CC->logged_in) return(0); /* Only do this if logged in. */ /* If this isn't a "My Citadel Config" room, don't bother. */ - if ( (CC->quickroom.QRflags && QR_MAILBOX) - && (!strcasecmp(&CC->quickroom.QRname[11], USERCONFIGROOM)) ) { + if ( (CC->room.QRflags && QR_MAILBOX) + && (!strcasecmp(&CC->room.QRname[11], USERCONFIGROOM)) ) { /* Yes, we want to do this */ } else { @@ -286,12 +286,12 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) { * delete the old one. First, figure out which user * is being re-registered... */ - what_user = atol(CC->quickroom.QRname); + what_user = atol(CC->room.QRname); - if (what_user == CC->usersupp.usernum) { + if (what_user == CC->user.usernum) { /* It's the logged in user. That was easy. */ - memcpy(&usbuf, &CC->usersupp, - sizeof(struct usersupp) ); + memcpy(&usbuf, &CC->user, + sizeof(struct user) ); } else if (getuserbynumber(&usbuf, what_user) == 0) { @@ -308,7 +308,7 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) { * want to make sure there is absolutely only one * vCard in the user's config room at all times. */ - CtdlDeleteMessages(CC->quickroom.QRname, + CtdlDeleteMessages(CC->room.QRname, 0L, "text/x-vcard"); /* Set the Extended-ID to a standardized one so the @@ -393,9 +393,9 @@ int vcard_upload_aftersave(struct CtdlMessage *msg) { set_mm_valid(); /* ...which also means we need to flag the user */ - lgetuser(&CC->usersupp, CC->curr_user); - CC->usersupp.flags |= (US_REGIS|US_NEEDVALID); - lputuser(&CC->usersupp); + lgetuser(&CC->user, CC->curr_user); + CC->user.flags |= (US_REGIS|US_NEEDVALID); + lputuser(&CC->user); return(0); } @@ -421,17 +421,17 @@ void vcard_gu_backend(long msgnum, void *userdata) { * If this user has a vcard on disk, read it into memory, otherwise allocate * and return an empty vCard. */ -struct vCard *vcard_get_user(struct usersupp *u) { +struct vCard *vcard_get_user(struct user *u) { char hold_rm[ROOMNAMELEN]; char config_rm[ROOMNAMELEN]; struct CtdlMessage *msg; struct vCard *v; - strcpy(hold_rm, CC->quickroom.QRname); /* save current room */ + strcpy(hold_rm, CC->room.QRname); /* save current room */ MailboxName(config_rm, sizeof config_rm, u, USERCONFIGROOM); - if (getroom(&CC->quickroom, config_rm) != 0) { - getroom(&CC->quickroom, hold_rm); + if (getroom(&CC->room, config_rm) != 0) { + getroom(&CC->room, hold_rm); return vcard_new(); } @@ -439,7 +439,7 @@ struct vCard *vcard_get_user(struct usersupp *u) { VC->msgnum = (-1); CtdlForEachMessage(MSGS_LAST, 1, "text/x-vcard", NULL, vcard_gu_backend, NULL); - getroom(&CC->quickroom, hold_rm); /* return to saved room */ + getroom(&CC->room, hold_rm); /* return to saved room */ if (VC->msgnum < 0L) return vcard_new(); @@ -458,7 +458,7 @@ struct vCard *vcard_get_user(struct usersupp *u) { /* * Write our config to disk */ -void vcard_write_user(struct usersupp *u, struct vCard *v) { +void vcard_write_user(struct user *u, struct vCard *v) { char temp[PATH_MAX]; FILE *fp; char *ser; @@ -517,7 +517,7 @@ void cmd_regi(char *argbuf) { return; } - my_vcard = vcard_get_user(&CC->usersupp); + my_vcard = vcard_get_user(&CC->user); strcpy(tmpaddr, ""); strcpy(tmpcity, ""); strcpy(tmpstate, ""); @@ -549,7 +549,7 @@ void cmd_regi(char *argbuf) { snprintf(tmpaddress, sizeof tmpaddress, ";;%s;%s;%s;%s;%s", tmpaddr, tmpcity, tmpstate, tmpzip, tmpcountry); vcard_set_prop(my_vcard, "adr", tmpaddress, 0); - vcard_write_user(&CC->usersupp, my_vcard); + vcard_write_user(&CC->user, my_vcard); vcard_free(my_vcard); } @@ -559,7 +559,7 @@ void cmd_regi(char *argbuf) { */ void cmd_greg(char *argbuf) { - struct usersupp usbuf; + struct user usbuf; struct vCard *v; char *s; char who[SIZ]; @@ -575,7 +575,7 @@ void cmd_greg(char *argbuf) if (!strcasecmp(who,"_SELF_")) strcpy(who,CC->curr_user); - if ((CC->usersupp.axlevel < 6) && (strcasecmp(who,CC->curr_user))) { + if ((CC->user.axlevel < 6) && (strcasecmp(who,CC->curr_user))) { cprintf("%d Higher access required.\n", ERROR+HIGHER_ACCESS_REQUIRED); return; @@ -774,7 +774,7 @@ void vcard_session_startup_hook(void) { void vcard_session_login_hook(void) { struct vCard *v; - v = vcard_get_user(&CC->usersupp); + v = vcard_get_user(&CC->user); vcard_populate_cs_inet_email(v); vcard_free(v); diff --git a/citadel/server.h b/citadel/server.h index 51573ea2c..d5090ee0e 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -67,8 +67,8 @@ enum { struct CitContext { struct CitContext *next; /* Link to next session in the list */ - struct usersupp usersupp; /* Database record buffers */ - struct quickroom quickroom; + struct user user; /* Database record buffers */ + struct room room; int state; /* thread state (see CON_ values below) */ int kill_me; /* Set to nonzero to flag for termination */ diff --git a/citadel/user_ops.c b/citadel/user_ops.c index a631c2cee..b657187f6 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -58,7 +58,7 @@ * getuser() - retrieve named user into supplied buffer. * returns 0 on success */ -int getuser(struct usersupp *usbuf, char name[]) +int getuser(struct user *usbuf, char name[]) { char lowercase_name[USERNAME_SIZE]; @@ -67,7 +67,7 @@ int getuser(struct usersupp *usbuf, char name[]) struct cdbdata *cdbus; int using_sysuser = 0; - memset(usbuf, 0, sizeof(struct usersupp)); + memset(usbuf, 0, sizeof(struct user)); #ifdef ENABLE_AUTOLOGIN if (CtdlAssociateSystemUser(sysuser_name, name) == 0) { @@ -93,8 +93,8 @@ int getuser(struct usersupp *usbuf, char name[]) return(1); } memcpy(usbuf, cdbus->ptr, - ((cdbus->len > sizeof(struct usersupp)) ? - sizeof(struct usersupp) : cdbus->len)); + ((cdbus->len > sizeof(struct user)) ? + sizeof(struct user) : cdbus->len)); cdb_free(cdbus); return (0); @@ -104,7 +104,7 @@ int getuser(struct usersupp *usbuf, char name[]) /* * lgetuser() - same as getuser() but locks the record */ -int lgetuser(struct usersupp *usbuf, char *name) +int lgetuser(struct user *usbuf, char *name) { int retcode; @@ -119,7 +119,7 @@ int lgetuser(struct usersupp *usbuf, char *name) /* * putuser() - write user buffer into the correct place on disk */ -void putuser(struct usersupp *usbuf) +void putuser(struct user *usbuf) { char lowercase_name[USERNAME_SIZE]; int a; @@ -133,7 +133,7 @@ void putuser(struct usersupp *usbuf) usbuf->version = REV_LEVEL; cdb_store(CDB_USERSUPP, lowercase_name, strlen(lowercase_name), - usbuf, sizeof(struct usersupp)); + usbuf, sizeof(struct user)); } @@ -141,7 +141,7 @@ void putuser(struct usersupp *usbuf) /* * lputuser() - same as putuser() but locks the record */ -void lputuser(struct usersupp *usbuf) +void lputuser(struct user *usbuf) { putuser(usbuf); end_critical_section(S_USERSUPP); @@ -199,8 +199,8 @@ void put_visit(struct visit *newvisit) * Define a relationship between a user and a room */ void CtdlSetRelationship(struct visit *newvisit, - struct usersupp *rel_user, - struct quickroom *rel_room) + struct user *rel_user, + struct room *rel_room) { @@ -218,8 +218,8 @@ void CtdlSetRelationship(struct visit *newvisit, * Locate a relationship between a user and a room */ void CtdlGetRelationship(struct visit *vbuf, - struct usersupp *rel_user, - struct quickroom *rel_room) + struct user *rel_user, + struct room *rel_room) { char IndexBuf[32]; @@ -256,7 +256,7 @@ void CtdlGetRelationship(struct visit *vbuf, } -void MailboxName(char *buf, size_t n, const struct usersupp *who, const char *prefix) +void MailboxName(char *buf, size_t n, const struct user *who, const char *prefix) { snprintf(buf, n, "%010ld.%s", who->usernum, prefix); } @@ -267,7 +267,7 @@ void MailboxName(char *buf, size_t n, const struct usersupp *who, const char *pr */ int is_aide(void) { - if (CC->usersupp.axlevel >= 6) + if (CC->user.axlevel >= 6) return (1); else return (0); @@ -284,8 +284,8 @@ int is_room_aide(void) return (0); } - if ((CC->usersupp.axlevel >= 6) - || (CC->quickroom.QRroomaide == CC->usersupp.usernum)) { + if ((CC->user.axlevel >= 6) + || (CC->room.QRroomaide == CC->user.usernum)) { return (1); } else { return (0); @@ -299,17 +299,17 @@ int is_room_aide(void) * WARNING: don't use this function unless you absolutely have to. It does * a sequential search and therefore is computationally expensive. */ -int getuserbynumber(struct usersupp *usbuf, long int number) +int getuserbynumber(struct user *usbuf, long int number) { struct cdbdata *cdbus; cdb_rewind(CDB_USERSUPP); while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) { - memset(usbuf, 0, sizeof(struct usersupp)); + memset(usbuf, 0, sizeof(struct user)); memcpy(usbuf, cdbus->ptr, - ((cdbus->len > sizeof(struct usersupp)) ? - sizeof(struct usersupp) : cdbus->len)); + ((cdbus->len > sizeof(struct user)) ? + sizeof(struct user) : cdbus->len)); cdb_free(cdbus); if (usbuf->usernum == number) { cdb_close_cursor(CDB_USERSUPP); @@ -359,13 +359,13 @@ int CtdlLoginExistingUser(char *trythisname) return login_already_logged_in; } - found_user = getuser(&CC->usersupp, username); + found_user = getuser(&CC->user, username); if (found_user == 0) { - if (((CC->nologin)) && (CC->usersupp.axlevel < 6)) { + if (((CC->nologin)) && (CC->user.axlevel < 6)) { return login_too_many_users; } else { - strcpy(CC->curr_user, CC->usersupp.fullname); + strcpy(CC->curr_user, CC->user.fullname); return login_ok; } } @@ -421,18 +421,18 @@ void session_startup(void) syslog(LOG_NOTICE, "session %d: user <%s> logged in", CC->cs_pid, CC->curr_user); - lgetuser(&CC->usersupp, CC->curr_user); - ++(CC->usersupp.timescalled); - CC->previous_login = CC->usersupp.lastcall; - time(&CC->usersupp.lastcall); + lgetuser(&CC->user, CC->curr_user); + ++(CC->user.timescalled); + CC->previous_login = CC->user.lastcall; + time(&CC->user.lastcall); /* If this user's name is the name of the system administrator * (as specified in setup), automatically assign access level 6. */ - if (!strcasecmp(CC->usersupp.fullname, config.c_sysadm)) { - CC->usersupp.axlevel = 6; + if (!strcasecmp(CC->user.fullname, config.c_sysadm)) { + CC->user.axlevel = 6; } - lputuser(&CC->usersupp); + lputuser(&CC->user); /* * Populate CC->cs_inet_email with a default address. This will be @@ -440,7 +440,7 @@ void session_startup(void) * the vCard module's login hook runs. */ snprintf(CC->cs_inet_email, sizeof CC->cs_inet_email, "%s@%s", - CC->usersupp.fullname, config.c_fqdn); + CC->user.fullname, config.c_fqdn); for (i=0; ics_inet_email); ++i) { if (isspace(CC->cs_inet_email[i])) { CC->cs_inet_email[i] = '_'; @@ -464,9 +464,9 @@ void session_startup(void) void logged_in_response(void) { cprintf("%d %s|%d|%ld|%ld|%u|%ld|%ld\n", - CIT_OK, CC->usersupp.fullname, CC->usersupp.axlevel, - CC->usersupp.timescalled, CC->usersupp.posted, - CC->usersupp.flags, CC->usersupp.usernum, + CIT_OK, CC->user.fullname, CC->user.axlevel, + CC->user.timescalled, CC->user.posted, + CC->user.flags, CC->user.usernum, CC->previous_login); } @@ -582,7 +582,7 @@ int CtdlTryPassword(char *password) lprintf(5, "CtdlTryPassword: no user selected\n"); return pass_no_user; } - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { lprintf(5, "CtdlTryPassword: internal error\n"); return pass_internal_error; } @@ -597,26 +597,26 @@ int CtdlTryPassword(char *password) /* A uid of BBSUID or -1 indicates that this user exists only in * Citadel, not in the underlying operating system. */ - if ( (CC->usersupp.uid == BBSUID) || (CC->usersupp.uid == (-1)) ) { + if ( (CC->user.uid == BBSUID) || (CC->user.uid == (-1)) ) { strproc(password); - strproc(CC->usersupp.password); - code = strcasecmp(CC->usersupp.password, password); + strproc(CC->user.password); + code = strcasecmp(CC->user.password, password); } /* Any other uid means we have to check the system password database */ else { - if (validpw(CC->usersupp.uid, password)) { + if (validpw(CC->user.uid, password)) { code = 0; - lgetuser(&CC->usersupp, CC->curr_user); - safestrncpy(CC->usersupp.password, password, - sizeof CC->usersupp.password); - lputuser(&CC->usersupp); + lgetuser(&CC->user, CC->curr_user); + safestrncpy(CC->user.password, password, + sizeof CC->user.password); + lputuser(&CC->user); } } #else /* ENABLE_AUTOLOGIN */ strproc(password); - strproc(CC->usersupp.password); - code = strcasecmp(CC->usersupp.password, password); + strproc(CC->user.password); + code = strcasecmp(CC->user.password, password); #endif /* ENABLE_AUTOLOGIN */ @@ -665,7 +665,7 @@ void cmd_pass(char *buf) int purge_user(char pname[]) { char filename[64]; - struct usersupp usbuf; + struct user usbuf; char lowercase_name[USERNAME_SIZE]; int a; struct CitContext *ccptr; @@ -686,7 +686,7 @@ int purge_user(char pname[]) 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) { + if (ccptr->user.usernum == usbuf.usernum) { user_is_logged_in = 1; } } @@ -729,8 +729,8 @@ int purge_user(char pname[]) */ int create_user(char *newusername, int become_user) { - struct usersupp usbuf; - struct quickroom qrbuf; + struct user usbuf; + struct room qrbuf; struct passwd *p = NULL; char username[SIZ]; char mailboxname[ROOMNAMELEN]; @@ -756,7 +756,7 @@ int create_user(char *newusername, int become_user) } /* Go ahead and initialize a new user record */ - memset(&usbuf, 0, sizeof(struct usersupp)); + memset(&usbuf, 0, sizeof(struct user)); strcpy(usbuf.fullname, username); strcpy(usbuf.password, ""); usbuf.uid = uid; @@ -802,12 +802,12 @@ int create_user(char *newusername, int become_user) if (become_user) { /* Now become the user we just created */ - memcpy(&CC->usersupp, &usbuf, sizeof(struct usersupp)); + memcpy(&CC->user, &usbuf, sizeof(struct user)); strcpy(CC->curr_user, username); CC->logged_in = 1; /* Check to make sure we're still who we think we are */ - if (getuser(&CC->usersupp, CC->curr_user)) { + if (getuser(&CC->user, CC->curr_user)) { return (ERROR + INTERNAL_ERROR); } } @@ -886,7 +886,7 @@ void cmd_setp(char *new_pw) if (CtdlAccessCheck(ac_logged_in)) { return; } - if ( (CC->usersupp.uid != BBSUID) && (CC->usersupp.uid != (-1)) ) { + if ( (CC->user.uid != BBSUID) && (CC->user.uid != (-1)) ) { cprintf("%d Not allowed. Use the 'passwd' command.\n", ERROR); return; } @@ -895,9 +895,9 @@ void cmd_setp(char *new_pw) cprintf("%d Password unchanged.\n", CIT_OK); return; } - lgetuser(&CC->usersupp, CC->curr_user); - strcpy(CC->usersupp.password, new_pw); - lputuser(&CC->usersupp); + lgetuser(&CC->user, CC->curr_user); + strcpy(CC->user.password, new_pw); + lputuser(&CC->user); cprintf("%d Password changed.\n", CIT_OK); lprintf(3, "Password changed for user <%s>\n", CC->curr_user); PerformSessionHooks(EVT_SETPASS); @@ -950,12 +950,12 @@ void cmd_getu(void) if (CtdlAccessCheck(ac_logged_in)) return; - getuser(&CC->usersupp, CC->curr_user); + getuser(&CC->user, CC->curr_user); cprintf("%d %d|%d|%d|\n", CIT_OK, - CC->usersupp.USscreenwidth, - CC->usersupp.USscreenheight, - (CC->usersupp.flags & US_USER_SET) + CC->user.USscreenwidth, + CC->user.USscreenheight, + (CC->user.flags & US_USER_SET) ); } @@ -971,14 +971,14 @@ void cmd_setu(char *new_parms) cprintf("%d Usage error.\n", ERROR); return; } - lgetuser(&CC->usersupp, CC->curr_user); - CC->usersupp.USscreenwidth = extract_int(new_parms, 0); - CC->usersupp.USscreenheight = extract_int(new_parms, 1); - CC->usersupp.flags = CC->usersupp.flags & (~US_USER_SET); - CC->usersupp.flags = CC->usersupp.flags | + lgetuser(&CC->user, CC->curr_user); + CC->user.USscreenwidth = extract_int(new_parms, 0); + CC->user.USscreenheight = extract_int(new_parms, 1); + CC->user.flags = CC->user.flags & (~US_USER_SET); + CC->user.flags = CC->user.flags | (extract_int(new_parms, 2) & US_USER_SET); - lputuser(&CC->usersupp); + lputuser(&CC->user); cprintf("%d Ok\n", CIT_OK); } @@ -995,19 +995,19 @@ void cmd_slrp(char *new_ptr) } if (!strncasecmp(new_ptr, "highest", 7)) { - newlr = CC->quickroom.QRhighest; + newlr = CC->room.QRhighest; } else { newlr = atol(new_ptr); } - lgetuser(&CC->usersupp, CC->curr_user); + lgetuser(&CC->user, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); vbuf.v_lastseen = newlr; snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", newlr); - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); - lputuser(&CC->usersupp); + lputuser(&CC->user); cprintf("%d %ld\n", CIT_OK, newlr); } @@ -1052,7 +1052,7 @@ void cmd_gtsn(char *argbuf) { void cmd_invt_kick(char *iuser, int op) /* user name */ { /* 1 = invite, 0 = kick out */ - struct usersupp USscratch; + struct user USscratch; char bbb[SIZ]; struct visit vbuf; @@ -1061,7 +1061,7 @@ void cmd_invt_kick(char *iuser, int op) * and room namespace owners */ if (is_room_aide() - || (atol(CC->quickroom.QRname) == CC->usersupp.usernum) ) { + || (atol(CC->room.QRname) == CC->user.usernum) ) { /* access granted */ } else { /* access denied */ @@ -1070,7 +1070,7 @@ void cmd_invt_kick(char *iuser, int op) return; } - if (!strncasecmp(CC->quickroom.QRname, config.c_baseroom, + if (!strncasecmp(CC->room.QRname, config.c_baseroom, ROOMNAMELEN)) { cprintf("%d Can't add/remove users from this room.\n", ERROR + NOT_HERE); @@ -1081,7 +1081,7 @@ void cmd_invt_kick(char *iuser, int op) cprintf("%d No such user.\n", ERROR); return; } - CtdlGetRelationship(&vbuf, &USscratch, &CC->quickroom); + CtdlGetRelationship(&vbuf, &USscratch, &CC->room); if (op == 1) { vbuf.v_flags = vbuf.v_flags & ~V_FORGET & ~V_LOCKOUT; @@ -1091,7 +1091,7 @@ void cmd_invt_kick(char *iuser, int op) vbuf.v_flags = vbuf.v_flags & ~V_ACCESS; vbuf.v_flags = vbuf.v_flags | V_FORGET | V_LOCKOUT; } - CtdlSetRelationship(&vbuf, &USscratch, &CC->quickroom); + CtdlSetRelationship(&vbuf, &USscratch, &CC->room); lputuser(&USscratch); @@ -1099,14 +1099,14 @@ void cmd_invt_kick(char *iuser, int op) snprintf(bbb, sizeof bbb, "%s %s %s> by %s\n", iuser, ((op == 1) ? "invited to" : "kicked out of"), - CC->quickroom.QRname, - CC->usersupp.fullname); + CC->room.QRname, + CC->user.fullname); aide_message(bbb); cprintf("%d %s %s %s.\n", CIT_OK, iuser, ((op == 1) ? "invited to" : "kicked out of"), - CC->quickroom.QRname); + CC->room.QRname); return; } @@ -1120,18 +1120,18 @@ int CtdlForgetThisRoom(void) { /* On some systems, Aides are not allowed to forget rooms */ if (is_aide() && (config.c_aide_zap == 0) - && ((CC->quickroom.QRflags & QR_MAILBOX) == 0) ) { + && ((CC->room.QRflags & QR_MAILBOX) == 0) ) { return(1); } - lgetuser(&CC->usersupp, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + lgetuser(&CC->user, CC->curr_user); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); vbuf.v_flags = vbuf.v_flags | V_FORGET; vbuf.v_flags = vbuf.v_flags & ~V_ACCESS; - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); - lputuser(&CC->usersupp); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); + lputuser(&CC->user); /* Return to the Lobby, so we don't end up in an undefined room */ usergoto(config.c_baseroom, 0, 0, NULL, NULL); @@ -1164,7 +1164,7 @@ void cmd_forg(void) void cmd_gnur(void) { struct cdbdata *cdbus; - struct usersupp usbuf; + struct user usbuf; if (CtdlAccessCheck(ac_aide)) { return; @@ -1175,15 +1175,15 @@ void cmd_gnur(void) return; } - /* There are unvalidated users. Traverse the usersupp database, + /* There are unvalidated users. Traverse the user database, * and return the first user we find that needs validation. */ cdb_rewind(CDB_USERSUPP); while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) { - memset(&usbuf, 0, sizeof(struct usersupp)); + memset(&usbuf, 0, sizeof(struct user)); memcpy(&usbuf, cdbus->ptr, - ((cdbus->len > sizeof(struct usersupp)) ? - sizeof(struct usersupp) : cdbus->len)); + ((cdbus->len > sizeof(struct user)) ? + sizeof(struct user) : cdbus->len)); cdb_free(cdbus); if ((usbuf.flags & US_NEEDVALID) && (usbuf.axlevel > 0)) { @@ -1215,7 +1215,7 @@ void cmd_vali(char *v_args) { char user[SIZ]; int newax; - struct usersupp userbuf; + struct user userbuf; extract(user, v_args, 0); newax = extract_int(v_args, 1); @@ -1249,19 +1249,19 @@ void cmd_vali(char *v_args) /* * Traverse the user file... */ -void ForEachUser(void (*CallBack) (struct usersupp * EachUser, void *out_data), +void ForEachUser(void (*CallBack) (struct user * EachUser, void *out_data), void *in_data) { - struct usersupp usbuf; + struct user usbuf; struct cdbdata *cdbus; cdb_rewind(CDB_USERSUPP); while (cdbus = cdb_next_item(CDB_USERSUPP), cdbus != NULL) { - memset(&usbuf, 0, sizeof(struct usersupp)); + memset(&usbuf, 0, sizeof(struct user)); memcpy(&usbuf, cdbus->ptr, - ((cdbus->len > sizeof(struct usersupp)) ? - sizeof(struct usersupp) : cdbus->len)); + ((cdbus->len > sizeof(struct user)) ? + sizeof(struct user) : cdbus->len)); cdb_free(cdbus); (*CallBack) (&usbuf, in_data); } @@ -1271,10 +1271,10 @@ void ForEachUser(void (*CallBack) (struct usersupp * EachUser, void *out_data), /* * List one user (this works with cmd_list) */ -void ListThisUser(struct usersupp *usbuf, void *data) +void ListThisUser(struct user *usbuf, void *data) { if (usbuf->axlevel > 0) { - if ((CC->usersupp.axlevel >= 6) + if ((CC->user.axlevel >= 6) || ((usbuf->flags & US_UNLISTED) == 0) || ((CC->internal_pgm))) { cprintf("%s|%d|%ld|%ld|%ld|%ld|", @@ -1284,7 +1284,7 @@ void ListThisUser(struct usersupp *usbuf, void *data) (long)usbuf->lastcall, usbuf->timescalled, usbuf->posted); - if (CC->usersupp.axlevel >= 6) + if (CC->user.axlevel >= 6) cprintf("%s", usbuf->password); cprintf("\n"); } @@ -1317,11 +1317,11 @@ void cmd_chek(void) return; } - getuser(&CC->usersupp, CC->curr_user); /* no lock is needed here */ - if ((REGISCALL != 0) && ((CC->usersupp.flags & US_REGIS) == 0)) + getuser(&CC->user, CC->curr_user); /* no lock is needed here */ + if ((REGISCALL != 0) && ((CC->user.flags & US_REGIS) == 0)) regis = 1; - if (CC->usersupp.axlevel >= 6) { + if (CC->user.axlevel >= 6) { get_control(); if (CitControl.MMflags & MM_VALID) vali = 1; @@ -1339,7 +1339,7 @@ void cmd_chek(void) */ void cmd_qusr(char *who) { - struct usersupp usbuf; + struct user usbuf; if (getuser(&usbuf, who) == 0) { cprintf("%d %s\n", CIT_OK, usbuf.fullname); @@ -1354,7 +1354,7 @@ void cmd_qusr(char *who) */ void cmd_agup(char *cmdbuf) { - struct usersupp usbuf; + struct user usbuf; char requested_user[SIZ]; if (CtdlAccessCheck(ac_aide)) { @@ -1386,7 +1386,7 @@ void cmd_agup(char *cmdbuf) */ void cmd_asup(char *cmdbuf) { - struct usersupp usbuf; + struct user usbuf; char requested_user[SIZ]; char notify[SIZ]; int np; @@ -1431,7 +1431,7 @@ void cmd_asup(char *cmdbuf) if (deleted) { sprintf(notify, "User <%s> deleted by %s\n", - usbuf.fullname, CC->usersupp.fullname); + usbuf.fullname, CC->user.fullname); aide_message(notify); } @@ -1454,7 +1454,7 @@ void BumpNewMailCounter(long which_user) { begin_critical_section(S_SESSION_TABLE); for (ptr = ContextList; ptr != NULL; ptr = ptr->next) { - if (ptr->usersupp.usernum == which_user) { + if (ptr->user.usernum == which_user) { ptr->newmail += 1; } } @@ -1485,16 +1485,16 @@ int InitialMailCheck() int num_newmsgs = 0; int a; char mailboxname[ROOMNAMELEN]; - struct quickroom mailbox; + struct room mailbox; struct visit vbuf; struct cdbdata *cdbfr; long *msglist = NULL; int num_msgs = 0; - MailboxName(mailboxname, sizeof mailboxname, &CC->usersupp, MAILROOM); + MailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM); if (getroom(&mailbox, mailboxname) != 0) return (0); - CtdlGetRelationship(&vbuf, &CC->usersupp, &mailbox); + CtdlGetRelationship(&vbuf, &CC->user, &mailbox); cdbfr = cdb_fetch(CDB_MSGLISTS, &mailbox.QRnumber, sizeof(long)); @@ -1533,9 +1533,9 @@ void cmd_view(char *cmdbuf) { requested_view = extract_int(cmdbuf, 0); - CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlGetRelationship(&vbuf, &CC->user, &CC->room); vbuf.v_view = requested_view; - CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom); + CtdlSetRelationship(&vbuf, &CC->user, &CC->room); cprintf("%d ok\n", CIT_OK); } diff --git a/citadel/user_ops.h b/citadel/user_ops.h index dc58ebdff..e90df8999 100644 --- a/citadel/user_ops.h +++ b/citadel/user_ops.h @@ -1,12 +1,12 @@ /* $Id$ */ int hash (char *str); -int getuser (struct usersupp *, char *); -int lgetuser (struct usersupp *, char *); -void putuser (struct usersupp *); -void lputuser (struct usersupp *); +int getuser (struct user *, char *); +int lgetuser (struct user *, char *); +void putuser (struct user *); +void lputuser (struct user *); int is_aide (void); int is_room_aide (void); -int getuserbynumber (struct usersupp *usbuf, long int number); +int getuserbynumber (struct user *usbuf, long int number); void cmd_user (char *cmdbuf); void session_startup (void); void logout (struct CitContext *who); @@ -24,9 +24,9 @@ void cmd_invt_kick (char *iuser, int op); void cmd_forg (void); void cmd_gnur (void); void cmd_vali (char *v_args); -void ForEachUser(void (*CallBack)(struct usersupp *EachUser, void *out_data), +void ForEachUser(void (*CallBack)(struct user *EachUser, void *out_data), void *in_data); -void ListThisUser(struct usersupp *usbuf, void *data); +void ListThisUser(struct user *usbuf, void *data); void cmd_list (void); void cmd_chek (void); void cmd_qusr (char *who); @@ -37,12 +37,12 @@ int NewMailCount(void); int InitialMailCheck(void); void put_visit(struct visit *newvisit); void CtdlGetRelationship(struct visit *vbuf, - struct usersupp *rel_user, - struct quickroom *rel_room); + struct user *rel_user, + struct room *rel_room); void CtdlSetRelationship(struct visit *newvisit, - struct usersupp *rel_user, - struct quickroom *rel_room); -void MailboxName(char *buf, size_t n, const struct usersupp *who, + struct user *rel_user, + struct room *rel_room); +void MailboxName(char *buf, size_t n, const struct user *who, const char *prefix); int GenerateRelationshipIndex( char *IndexBuf, long RoomID,