Began working on access control changes for blog rooms.
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 16 Aug 2011 04:03:58 +0000 (00:03 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:46:23 +0000 (21:46 +0000)
citadel/room_ops.c

index 1c68a340c585f7048355f189c54773c6498a7970..fbea0f27083633cd8218e0bc82835ef3df8b5f94 100644 (file)
@@ -163,6 +163,7 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
                 * - User is not validated
                 * - User has no net privileges and it is a shared network room
                 * - It is a read-only room
+                * - It is a blog room (in which case we only allow replies to existing messages)
                 */
                int post_allowed = 1;
                int reply_allowed = 1;
@@ -178,6 +179,9 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
                        post_allowed = 0;
                        reply_allowed = 0;
                }
+               if (roombuf->QRdefaultview == VIEW_BLOG) {
+                       post_allowed = 0;
+               }
                if (post_allowed) {
                        retval = retval | UA_POSTALLOWED | UA_REPLYALLOWED;
                }