From: Art Cancro Date: Fri, 8 Mar 2002 05:42:02 +0000 (+0000) Subject: * Patch to allow invitations and admin access to mailbox rooms. NEEDS TESTING! X-Git-Tag: v7.86~6509 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=84d26bac46321e5ea098280aed27cf6da5627cae;p=citadel.git * Patch to allow invitations and admin access to mailbox rooms. NEEDS TESTING! --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 67142b1dd..d9c7ca010 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 590.129 2002/03/08 05:42:02 ajc + * Patch to allow invitations and admin access to mailbox rooms. NEEDS TESTING! + Revision 590.128 2002/03/07 04:30:37 ajc * Force recipient only in Mail>, not in all mailbox rooms @@ -3396,4 +3399,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/room_ops.c b/citadel/room_ops.c index db224477a..56b040c7f 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -58,12 +58,7 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) if (((CC->internal_pgm)) && (roombuf->QRflags & QR_INUSE)) { return (UA_KNOWN | UA_GOTOALLOWED); } - /* For mailbox rooms, only allow access to the owner */ - if (roombuf->QRflags & QR_MAILBOX) { - if (userbuf->usernum != atol(roombuf->QRname)) { - return(0); - } - } + /* Locate any applicable user/room relationships */ CtdlGetRelationship(&vbuf, userbuf, roombuf); @@ -76,26 +71,23 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) } goto NEWMSG; } - /* For mailboxes, we skip all the access stuff (and we've - * already checked by this point that the mailbox belongs - * to the user) - */ - if (roombuf->QRflags & QR_MAILBOX) { - retval = UA_KNOWN | UA_GOTOALLOWED; - /* goto NEWMSG; allow users to zap mailboxes now */ - } + /* If this is a public room, it's accessible... */ - if ((roombuf->QRflags & QR_PRIVATE) == 0) { + if ( ((roombuf->QRflags & QR_PRIVATE) == 0) + && ((roombuf->QRflags & QR_MAILBOX) == 0) ) { retval = retval | UA_KNOWN | UA_GOTOALLOWED; } + /* If this is a preferred users only room, check access level */ if (roombuf->QRflags & QR_PREFONLY) { if (userbuf->axlevel < 5) { retval = retval & ~UA_KNOWN & ~UA_GOTOALLOWED; } } + /* For private rooms, check the generation number matchups */ - if (roombuf->QRflags & QR_PRIVATE) { + if ( (roombuf->QRflags & QR_PRIVATE) + && ((roombuf->QRflags & QR_MAILBOX) == 0) ) { /* An explicit match means the user belongs in this room */ if (vbuf.v_flags & V_ACCESS) { @@ -110,6 +102,18 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) retval = retval | UA_GOTOALLOWED; } } + + /* For mailbox rooms, also check the generation number matchups */ + if (roombuf->QRflags & QR_MAILBOX) { + if (userbuf->usernum == atol(roombuf->QRname)) { + retval = retval | UA_KNOWN | UA_GOTOALLOWED; + } + /* An explicit match means the user belongs in this room */ + if (vbuf.v_flags & V_ACCESS) { + retval = retval | UA_KNOWN | UA_GOTOALLOWED; + } + } + /* Check to see if the user has forgotten this room */ if (vbuf.v_flags & V_FORGET) { retval = retval & ~UA_KNOWN; @@ -126,7 +130,10 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) retval = retval | UA_GOTOALLOWED; } else { - retval = retval | UA_KNOWN | UA_GOTOALLOWED; + retval = retval | UA_GOTOALLOWED; + if ((roombuf->QRflags & QR_MAILBOX) == 0) { + retval = retval | UA_KNOWN; + } } }