* When sending a page that results in the receiver's Sent/Received Pages>
authorArt Cancro <ajc@citadel.org>
Tue, 30 Apr 2002 03:13:59 +0000 (03:13 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 30 Apr 2002 03:13:59 +0000 (03:13 +0000)
  room to be created, don't automatically grant the sender access to that room.
* Added a parameter to create_room() to implement the above

13 files changed:
citadel/ChangeLog
citadel/citserver.c
citadel/control.c
citadel/msgbase.c
citadel/room_ops.c
citadel/room_ops.h
citadel/serv_chat.c
citadel/serv_expire.c
citadel/serv_ical.c
citadel/serv_imap.c
citadel/serv_smtp.c
citadel/serv_vcard.c
citadel/user_ops.c

index 0d383e4f0a03715b0c3b22ac88dc1db683fe362e..02f205e3aa0753cb7959db1178964075c5641a5e 100644 (file)
@@ -1,4 +1,9 @@
  $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
 
@@ -3623,3 +3628,4 @@ 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 c96ab9f571085a42190261fb220a9d65935ae46d..023d34a5f7d936a7ff373e411e2181690132bc49 100644 (file)
@@ -83,10 +83,10 @@ void master_startup(void) {
        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);
index 84dd97b682c2008376a817a0b8bfc303bddcac6d..62b0ac2885bf8d12f245e656c9ed44a8901f42c5 100644 (file)
@@ -300,7 +300,7 @@ void cmd_conf(char *argbuf) {
                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")) {
index 30756616240e92d11ed1d2c51329b7e2bf23b572..c7683b0649510672f36ae16d811e7cf87a643233 100644 (file)
@@ -2905,7 +2905,7 @@ void CtdlWriteObject(char *req_room,              /* Room to stuff it in */
        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.
index f694c348179c34bfec5d8f6da08477f5660f0d38..0eb87ba0e24db174cb56b99c371c0663f2928c84 100644 (file)
@@ -1444,7 +1444,8 @@ unsigned create_room(char *new_room_name,
                     int new_room_type,
                     char *new_room_pass,
                     int new_room_floor,
-                    int really_create)
+                    int really_create,
+                    int avoid_access)
 {
 
        struct quickroom qrbuf;
@@ -1509,13 +1510,17 @@ unsigned create_room(char *new_room_name,
        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);
@@ -1586,7 +1591,7 @@ void cmd_cre8(char *args)
 
        /* 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);
@@ -1601,7 +1606,7 @@ void cmd_cre8(char *args)
        /* 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);
index 2ef7dae4fce4031d8644324462aa502d59db559a..5626facd67739b556db696fdf0c3912c48e53601 100644 (file)
@@ -36,7 +36,8 @@ unsigned create_room(char *new_room_name,
                        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);
index 17d62ce4c7bf06e5b71df82a9c559df094702590..99732cf553bea5c0945bd067add43c3fb8c9b8ba 100644 (file)
@@ -586,12 +586,12 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
                /* 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);
                }
 
@@ -601,7 +601,7 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
                 * 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);
index 6a38c326e56e53035638657ada8bcfda8cd6ea9d..c65fee436587cc1d947dd25535db3611936daf85 100644 (file)
@@ -364,7 +364,7 @@ void do_user_purge(struct usersupp *us, void *data) {
        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);
         */
index d7e48856e41df362e1eb7536554fa0ac70ac8525..ccaacf3430660a53d052dbf6eb133b5ed873f922 100644 (file)
@@ -48,7 +48,7 @@ void ical_create_room(void)
        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");
index 49c04c18d6e49a9f6f3b3a8d306c368338699736..fea7360e5c8a40f7b42faaec1164fc6161e56f1b 100644 (file)
@@ -638,7 +638,7 @@ void imap_create(int num_parms, char *parms[]) {
        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]);
@@ -985,7 +985,7 @@ void imap_rename(int num_parms, char *parms[]) {
         * (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... */
index 06f5c3678d94301280cc735bd46b6442dd1b3707..b809a54ded360cf7bc483159784c78675b13eac5 100644 (file)
@@ -1365,7 +1365,7 @@ char *Dynamic_Module_Init(void)
                                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$";
index 06fd0e7ace278afa274ab1358c4f0a65452f425c..4c78a62c8bad83f8f2ec216728fdff98b70f3452 100644 (file)
@@ -800,6 +800,6 @@ char *Dynamic_Module_Init(void)
        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$";
 }
index f5d6bd0069ea3099b7d9840b3da3568c172f5fdb..046e60e04487fca899746a6159ab74e5fc49fb0c 100644 (file)
@@ -410,7 +410,7 @@ void session_startup(void)
        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);
@@ -737,9 +737,9 @@ int create_user(char *newusername, int become_user)
 
        /* 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