room to be created, don't automatically grant the sender access to that room.
* Added a parameter to create_room() to implement the above
$Log$
+ Revision 591.16 2002/04/30 03:13:59 ajc
+ * When sending a page that results in the receiver's Sent/Received Pages>
+ room to be created, don't automatically grant the sender access to that room.
+ * Added a parameter to create_room() to implement the above
+
Revision 591.15 2002/04/23 13:38:08 ajc
* Minor docs update
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
check_ref_counts();
lprintf(7, "Creating base rooms (if necessary)\n");
- create_room(BASEROOM, 0, "", 0, 1);
- create_room(AIDEROOM, 3, "", 0, 1);
- create_room(SYSCONFIGROOM, 3, "", 0, 1);
- create_room(config.c_twitroom, 0, "", 0, 1);
+ create_room(BASEROOM, 0, "", 0, 1, 0);
+ create_room(AIDEROOM, 3, "", 0, 1, 0);
+ create_room(SYSCONFIGROOM, 3, "", 0, 1, 0);
+ create_room(config.c_twitroom, 0, "", 0, 1, 0);
lprintf(7, "Seeding the pseudo-random number generator...\n");
gettimeofday(&tv, NULL);
aide_message(buf);
if (strlen(config.c_logpages) > 0)
- create_room(config.c_logpages, 3, "", 0, 1);
+ create_room(config.c_logpages, 3, "", 0, 1, 1);
}
else if (!strcasecmp(cmd, "GETSYS")) {
if (getroom(&qrbuf, roomname) != 0) {
create_room(roomname,
( (is_mailbox != NULL) ? 5 : 3 ),
- "", 0, 1);
+ "", 0, 1, 0);
}
/* If the caller specified this object as unique, delete all
* other objects of this type that are currently in the room.
int new_room_type,
char *new_room_pass,
int new_room_floor,
- int really_create)
+ int really_create,
+ int avoid_access)
{
struct quickroom qrbuf;
flbuf.f_ref_count = flbuf.f_ref_count + 1;
lputfloor(&flbuf, (int) qrbuf.QRfloor);
- /* be sure not to kick the creator out of the room! */
- lgetuser(&CC->usersupp, CC->curr_user);
- CtdlGetRelationship(&vbuf, &CC->usersupp, &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);
+ /* Grant the creator access to the room unless the avoid_access
+ * parameter was specified.
+ */
+ if (avoid_access == 0) {
+ lgetuser(&CC->usersupp, CC->curr_user);
+ CtdlGetRelationship(&vbuf, &CC->usersupp, &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);
+ }
/* resume our happy day */
return (qrbuf.QRflags);
/* Check to make sure the requested room name doesn't already exist */
newflags = create_room(new_room_name,
- new_room_type, new_room_pass, new_room_floor, 0);
+ new_room_type, new_room_pass, new_room_floor, 0, 0);
if (newflags == 0) {
cprintf("%d '%s' already exists.\n",
ERROR + ALREADY_EXISTS, new_room_name);
/* If we reach this point, the room needs to be created. */
newflags = create_room(new_room_name,
- new_room_type, new_room_pass, new_room_floor, 1);
+ new_room_type, new_room_pass, new_room_floor, 1, 0);
/* post a message in Aide> describing the new room */
safestrncpy(aaa, new_room_name, sizeof aaa);
int new_room_type,
char *new_room_pass,
int new_room_floor,
- int really_create);
+ int really_create,
+ int avoid_access);
void cmd_cre8 (char *args);
void cmd_einf (char *ok);
void cmd_lflr (void);
/* Save a copy of the message in the sender's log room,
* creating the room if necessary.
*/
- create_room(PAGELOGROOM, 4, "", 0, 1);
+ create_room(PAGELOGROOM, 4, "", 0, 1, 0);
msgnum = CtdlSubmitMsg(logmsg, NULL, PAGELOGROOM);
/* Now save a copy in the global log room, if configured */
if (strlen(config.c_logpages) > 0) {
- create_room(config.c_logpages, 3, "", 0, 1);
+ create_room(config.c_logpages, 3, "", 0, 1, 1);
CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0);
}
* but we've already supplied the namespace prefix.
*/
while (sl != NULL) {
- create_room(sl->roomname, 5, "", 0, 1);
+ create_room(sl->roomname, 5, "", 0, 1, 1);
CtdlSaveMsgPointerInRoom(sl->roomname, msgnum, 0);
sptr = sl->next;
phree(sl);
struct quickroom qrbuf;
char mailboxname[ROOMNAMELEN];
MailboxName(mailboxname, us, MAILROOM);
- create_room(mailboxname, 4, "", 0, 1);
+ create_room(mailboxname, 4, "", 0, 1, 1);
if (getroom(&qrbuf, mailboxname) != 0) return;
lprintf(9, "Got %s\n", qrbuf.QRname);
*/
struct quickroom qr;
/* Create the room if it doesn't already exist */
- create_room(USERCALENDARROOM, 4, "", 0, 1);
+ create_room(USERCALENDARROOM, 4, "", 0, 1, 0);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (lgetroom(&qr, USERCALENDARROOM)) {
lprintf(3, "Couldn't get the user calendar room!\n");
lprintf(7, "Create new room <%s> on floor <%d> with type <%d>\n",
roomname, floornum, newroomtype);
- ret = create_room(roomname, newroomtype, "", floornum, 1);
+ ret = create_room(roomname, newroomtype, "", floornum, 1, 0);
if (ret == 0) {
cprintf("%s NO Mailbox already exists, or create failed\r\n",
parms[0]);
* (already did that) and create a new inbox.
*/
if (!strcasecmp(parms[2], "INBOX")) {
- create_room(MAILROOM, 4, "", 0, 1);
+ create_room(MAILROOM, 4, "", 0, 1, 0);
}
/* Otherwise, do the subfolders. Build a list of rooms to rename... */
smtp_greeting,
smtp_command_loop);
- create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1);
+ create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0);
CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
return "$Id$";
CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
CtdlRegisterNetprocHook(vcard_extract_from_network);
- create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1);
+ create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0);
return "$Id$";
}
PerformSessionHooks(EVT_LOGIN);
/* Create any personal rooms required by the system */
- create_room(SENTITEMS, 4, "", 0, 1);
+ create_room(SENTITEMS, 4, "", 0, 1, 0);
/* Enter the lobby */
usergoto(BASEROOM, 0, NULL, NULL);
/* give the user a private mailbox and a configuration room */
MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
- create_room(mailboxname, 5, "", 0, 1);
+ create_room(mailboxname, 5, "", 0, 1, 1);
MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
- create_room(mailboxname, 5, "", 0, 1);
+ create_room(mailboxname, 5, "", 0, 1, 1);
/* Everything below this line can be bypassed if administratively
creating a user, instead of doing self-service account creation