}
/* If this is a public room, it's accessible... */
- if ( ((roombuf->QRflags & QR_PRIVATE) == 0)
- && ((roombuf->QRflags & QR_MAILBOX) == 0) ) {
+ if ( ((roombuf->QRflags & QR_PRIVATE) == 0)
+ && ((roombuf->QRflags & QR_MAILBOX) == 0)
+ ) {
retval = retval | UA_KNOWN | UA_GOTOALLOWED;
}
}
/* For private rooms, check the generation number matchups */
- if ( (roombuf->QRflags & QR_PRIVATE)
- && ((roombuf->QRflags & QR_MAILBOX) == 0) ) {
+ 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) {
/* Otherwise, check if this is a guess-name or passworded
* room. If it is, a goto may at least be attempted
*/
- else if ((roombuf->QRflags & QR_PRIVATE)
- || (roombuf->QRflags & QR_PASSWORDED)) {
+ else if ( (roombuf->QRflags & QR_PRIVATE)
+ || (roombuf->QRflags & QR_PASSWORDED)
+ ) {
retval = retval & ~UA_KNOWN;
retval = retval | UA_GOTOALLOWED;
}
* - 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;
post_allowed = 0;
reply_allowed = 0;
}
+ if (roombuf->QRdefaultview == VIEW_BLOG) {
+ post_allowed = 0;
+ }
if (post_allowed) {
retval = retval | UA_POSTALLOWED | UA_REPLYALLOWED;
}
/* Check to see if the user has forgotten this room */
if (vbuf.v_flags & V_FORGET) {
retval = retval & ~UA_KNOWN;
- if ( ( ((roombuf->QRflags & QR_PRIVATE) == 0)
- && ((roombuf->QRflags & QR_MAILBOX) == 0) )
- || ( (roombuf->QRflags & QR_MAILBOX)
- && (atol(roombuf->QRname) == CC->user.usernum))) {
+ if ( ( ((roombuf->QRflags & QR_PRIVATE) == 0)
+ && ((roombuf->QRflags & QR_MAILBOX) == 0)
+ ) || ( (roombuf->QRflags & QR_MAILBOX)
+ && (atol(roombuf->QRname) == CC->user.usernum))
+ ) {
retval = retval | UA_ZAPPED;
}
}
+
/* If user is explicitly locked out of this room, deny everything */
if (vbuf.v_flags & V_LOCKOUT) {
retval = retval & ~UA_KNOWN & ~UA_GOTOALLOWED & ~UA_POSTALLOWED & ~UA_REPLYALLOWED;
}
/* Aides get access to all private rooms */
- if ( (userbuf->axlevel >= AxAideU)
- && ((roombuf->QRflags & QR_MAILBOX) == 0) ) {
+ if ( (userbuf->axlevel >= AxAideU)
+ && ((roombuf->QRflags & QR_MAILBOX) == 0)
+ ) {
if (vbuf.v_flags & V_FORGET) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED | UA_REPLYALLOWED;
}
/* Aides can gain access to mailboxes as well, but they don't show
* by default.
*/
- if ( (userbuf->axlevel >= AxAideU)
- && (roombuf->QRflags & QR_MAILBOX) ) {
+ if ( (userbuf->axlevel >= AxAideU)
+ && (roombuf->QRflags & QR_MAILBOX)
+ ) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED | UA_REPLYALLOWED;
}
/* Aides and Room Aides have admin privileges */
- if ( (userbuf->axlevel >= AxAideU)
- || (userbuf->usernum == roombuf->QRroomaide)
- ) {
+ if ( (userbuf->axlevel >= AxAideU)
+ || (userbuf->usernum == roombuf->QRroomaide)
+ ) {
retval = retval | UA_ADMINALLOWED | UA_DELETEALLOWED | UA_POSTALLOWED | UA_REPLYALLOWED;
}
mkdir(buf, 0755);
}
snprintf(buf, sizeof buf, "The room \"%s\" has been edited by %s.\n",
- CC->room.QRname, CC->curr_user);
+ CC->room.QRname,
+ (CC->logged_in ? CC->curr_user : "an administrator")
+ );
CtdlAideMessage(buf, "Room modification Message");
cprintf("%d Ok\n", CIT_OK);
}
/* tell the world what we did */
snprintf(msg, sizeof msg, "The room \"%s\" has been deleted by %s.\n",
- deleted_room_name, CC->curr_user);
+ deleted_room_name,
+ (CC->logged_in ? CC->curr_user : "an administrator")
+ );
CtdlAideMessage(msg, "Room Purger Message");
cprintf("%d '%s' deleted.\n", CIT_OK, deleted_room_name);
} else {
}
/* If the room is private, and the system administrator has elected
- * to automatically grant room aide privileges, do so now; otherwise,
- * set the room aide to undefined.
+ * to automatically grant room aide privileges, do so now.
*/
if ((qrbuf.QRflags & QR_PRIVATE) && (CREATAIDE == 1)) {
qrbuf.QRroomaide = CC->user.usernum;
- } else {
+ }
+ /* Blog owners automatically become room aides of their blogs.
+ * (In the future we will offer a site-wide configuration setting to suppress this behavior.)
+ */
+ else if (new_room_view == VIEW_BLOG) {
+ qrbuf.QRroomaide = CC->user.usernum;
+ }
+ /* Otherwise, set the room aide to undefined.
+ */
+ else {
qrbuf.QRroomaide = (-1L);
}
snprintf(notification_message, 1024,
"A new room called \"%s\" has been created by %s%s%s%s%s%s\n",
new_room_name,
- CC->user.fullname,
+ (CC->logged_in ? CC->curr_user : "an administrator"),
((newflags & QR_MAILBOX) ? " [personal]" : ""),
((newflags & QR_PRIVATE) ? " [private]" : ""),
((newflags & QR_GUESSNAME) ? " [hidden]" : ""),