* Patch to allow invitations and admin access to mailbox rooms. NEEDS TESTING!
authorArt Cancro <ajc@citadel.org>
Fri, 8 Mar 2002 05:42:02 +0000 (05:42 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 8 Mar 2002 05:42:02 +0000 (05:42 +0000)
citadel/ChangeLog
citadel/room_ops.c

index 67142b1dd35fb0de872fb0c70523f51bb9bddad4..d9c7ca01064772aebabb06e9001ddf97a101c244 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index db224477ae2a4ba901c635146d38cd355ff61887..56b040c7f3874e94f5d75906158e841d6226917c 100644 (file)
@@ -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;
+                       }
                }
        }