* Added support for "transient goto" which allows entry into a private and/or
authorArt Cancro <ajc@citadel.org>
Wed, 19 Jun 2002 21:42:58 +0000 (21:42 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 19 Jun 2002 21:42:58 +0000 (21:42 +0000)
  zapped room without putting the room [back] on your known rooms list.  This
  is useful for the new administrative functions in WebCit (updating a user's
  vCard without the Aide suddenly having that user's config room on their
  list).  It's also useful for making a certain pedophile in Sacramento even
  more suspicious that someone is reading his email.

citadel/ChangeLog
citadel/imap_misc.c
citadel/room_ops.c
citadel/room_ops.h
citadel/serv_imap.c
citadel/techdoc/session.txt
citadel/user_ops.c

index 602467082fdebe7b81fede4c7a10249b01fd2ff9..31d06d7a577b9ac80acdcae4c6b4c8185ef9af95 100644 (file)
@@ -1,4 +1,12 @@
  $Log$
+ Revision 591.48  2002/06/19 21:42:57  ajc
+ * Added support for "transient goto" which allows entry into a private and/or
+   zapped room without putting the room [back] on your known rooms list.  This
+   is useful for the new administrative functions in WebCit (updating a user's
+   vCard without the Aide suddenly having that user's config room on their
+   list).  It's also useful for making a certain pedophile in Sacramento even
+   more suspicious that someone is reading his email.
+
  Revision 591.47  2002/06/18 16:34:06  error
  * room_ops.c: Fix for old room record not being deleted when renaming
    baseroom or aideroom
@@ -3743,3 +3751,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 a90f203ac537d8d43b6394d2fec818e26b2b23f2..6878fea5dcdd9bfd23208cfd3e3e3831410d9b5d 100644 (file)
@@ -285,7 +285,7 @@ void imap_append(int num_parms, char *parms[]) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->quickroom.QRname);
        }
-       usergoto(roomname, 0, &msgs, &new);
+       usergoto(roomname, 0, 0, &msgs, &new);
 
        /* 
         * Can we post here?
@@ -312,7 +312,7 @@ void imap_append(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, &msgs, &new);
+               usergoto(savedroom, 0, 0, &msgs, &new);
        }
 
        /* We don't need this buffer anymore */
index 8d83038c65d4f61a2ffd12aff66cdedfb5e6e407..3a3f32b5cc35ccd5e69ee298c5eafa5330bddb85 100644 (file)
@@ -689,7 +689,8 @@ void cmd_lzrm(char *argbuf)
  * or access control is done here -- the caller should make sure that the
  * specified room exists and is ok to access.
  */
-void usergoto(char *where, int display_result, int *retmsgs, int *retnew)
+void usergoto(char *where, int display_result, int transiently,
+               int *retmsgs, int *retnew)
 {
        int a;
        int new_messages = 0;
@@ -718,8 +719,11 @@ void usergoto(char *where, int display_result, int *retmsgs, int *retnew)
        begin_critical_section(S_USERSUPP);
        CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
 
-       /* Know the room ... but not if it's the page log room */
-       if (strcasecmp(CC->quickroom.QRname, config.c_logpages)) {
+       /* Know the room ... but not if it's the page log room, or if the
+        * caller specified that we're only entering this room transiently.
+        */
+       if ((strcasecmp(CC->quickroom.QRname, config.c_logpages))
+          && (transiently == 0) ) {
                vbuf.v_flags = vbuf.v_flags & ~V_FORGET & ~V_LOCKOUT;
                vbuf.v_flags = vbuf.v_flags | V_ACCESS;
        }
@@ -802,11 +806,13 @@ void cmd_goto(char *gargs)
        char augmented_roomname[SIZ];
        char towhere[SIZ];
        char password[SIZ];
+       int transiently = 0;
 
        if (CtdlAccessCheck(ac_logged_in)) return;
 
        extract(towhere, gargs, 0);
        extract(password, gargs, 1);
+       transiently = extract_int(gargs, 2);
 
        getuser(&CC->usersupp, CC->curr_user);
 
@@ -839,7 +845,7 @@ void cmd_goto(char *gargs)
                if (CC->internal_pgm) {
                        memcpy(&CC->quickroom, &QRscratch,
                                sizeof(struct quickroom));
-                       usergoto(NULL, 1, NULL, NULL);
+                       usergoto(NULL, 1, transiently, NULL, NULL);
                        return;
                }
 
@@ -856,7 +862,7 @@ void cmd_goto(char *gargs)
                            ((ra & UA_GOTOALLOWED))) {
                                memcpy(&CC->quickroom, &QRscratch,
                                        sizeof(struct quickroom));
-                               usergoto(NULL, 1, NULL, NULL);
+                               usergoto(NULL, 1, transiently, NULL, NULL);
                                return;
                        } else if ((QRscratch.QRflags & QR_PASSWORDED) &&
                            ((ra & UA_KNOWN) == 0) &&
@@ -877,7 +883,7 @@ void cmd_goto(char *gargs)
                        } else {
                                memcpy(&CC->quickroom, &QRscratch,
                                        sizeof(struct quickroom));
-                               usergoto(NULL, 1, NULL, NULL);
+                               usergoto(NULL, 1, transiently, NULL, NULL);
                                return;
                        }
                }
@@ -1469,7 +1475,7 @@ void cmd_kill(char *argbuf)
        if (kill_ok) {
                strcpy(deleted_room_name, CC->quickroom.QRname);
                delete_room(&CC->quickroom);    /* Do the dirty work */
-               usergoto(config.c_baseroom, 0, NULL, NULL); /* Return to the Lobby */
+               usergoto(config.c_baseroom, 0, 0, NULL, NULL); /* Return to the Lobby */
 
                /* tell the world what we did */
                snprintf(aaa, sizeof aaa, "%s> killed by %s\n",
index 5626facd67739b556db696fdf0c3912c48e53601..5bf9634637331646361e2bf3eb9009ee6c570170 100644 (file)
@@ -22,7 +22,8 @@ void cmd_lkra (char *argbuf);
 void cmd_lkrn (char *argbuf);
 void cmd_lkro (char *argbuf);
 void cmd_lzrm (char *argbuf);
-void usergoto (char *where, int display_result, int *msgs, int *new);
+void usergoto (char *where, int display_result, int transiently,
+                       int *msgs, int *new);
 void cmd_goto (char *gargs);
 void cmd_whok (void);
 void cmd_rdir (void);
index ec3c6609f0d8ad8b6bcc1516f485289909fd3ca8..e0ac5c03e555bdb91b3865c53dc3ddf34512f0ca 100644 (file)
@@ -412,7 +412,7 @@ void imap_select(int num_parms, char *parms[]) {
         * the number of messages and number of new messages.
         */
        memcpy(&CC->quickroom, &QRscratch, sizeof(struct quickroom));
-       usergoto(NULL, 0, &msgs, &new);
+       usergoto(NULL, 0, 0, &msgs, &new);
        IMAP->selected = 1;
 
        if (!strcasecmp(parms[1], "EXAMINE")) {
@@ -728,7 +728,7 @@ void imap_status(int num_parms, char *parms[]) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->quickroom.QRname);
        }
-       usergoto(roomname, 0, &msgs, &new);
+       usergoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * Tell the client what it wants to know.  In fact, tell it *more* than
@@ -749,7 +749,7 @@ void imap_status(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, &msgs, &new);
+               usergoto(savedroom, 0, 0, &msgs, &new);
        }
 
        /*
@@ -785,14 +785,14 @@ void imap_subscribe(int num_parms, char *parms[]) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->quickroom.QRname);
        }
-       usergoto(roomname, 0, &msgs, &new);
+       usergoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * If another folder is selected, go back to that room so we can resume
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, &msgs, &new);
+               usergoto(savedroom, 0, 0, &msgs, &new);
        }
 
        cprintf("%s OK SUBSCRIBE completed\r\n", parms[0]);
@@ -822,7 +822,7 @@ void imap_unsubscribe(int num_parms, char *parms[]) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->quickroom.QRname);
        }
-       usergoto(roomname, 0, &msgs, &new);
+       usergoto(roomname, 0, 0, &msgs, &new);
 
        /* 
         * Now make the API call to zap the room
@@ -840,7 +840,7 @@ void imap_unsubscribe(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, &msgs, &new);
+               usergoto(savedroom, 0, 0, &msgs, &new);
        }
 }
 
@@ -871,7 +871,7 @@ void imap_delete(int num_parms, char *parms[]) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->quickroom.QRname);
        }
-       usergoto(roomname, 0, &msgs, &new);
+       usergoto(roomname, 0, 0, &msgs, &new);
 
        /*
         * Now delete the room.
@@ -889,7 +889,7 @@ void imap_delete(int num_parms, char *parms[]) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               usergoto(savedroom, 0, &msgs, &new);
+               usergoto(savedroom, 0, 0, &msgs, &new);
        }
 }
 
index 24dcd739ce33fbfb598094589fd14ce0f7174f56..f9edbfc8e81ac9eeba457fd1105c170cadb0aa61 100644 (file)
@@ -357,6 +357,12 @@ it completes.  For passworded rooms, access will be denied if the password
 is not supplied or is incorrect, or the command will complete successfully
 if the password is correct.
  
+ The third (and also) optional parameter is a "transient" flag.  Normally,
+when a user enters a private and/or zapped room, the room is added to the
+user's known rooms list.  If the transient flag is set to non-zero, this is
+called a "transient goto" which causes the user to enter the room without
+adding the room to the known rooms list.
  The possible result codes are:
   
  OK    - The command completed successfully.  User is now in the room.
index e631efb794bd67646685311bd524b55eee346086..7b16a062b9e66518801f3f1a209f85c6abeb9d26 100644 (file)
@@ -410,7 +410,7 @@ void session_startup(void)
        create_room(SENTITEMS, 4, "", 0, 1, 0);
 
        /* Enter the lobby */
-       usergoto(config.c_baseroom, 0, NULL, NULL);
+       usergoto(config.c_baseroom, 0, 0, NULL, NULL);
 
        /* Record this login in the Citadel log */
        rec_log(CL_LOGIN, CC->curr_user);
@@ -1079,7 +1079,7 @@ int CtdlForgetThisRoom(void) {
        lputuser(&CC->usersupp);
 
        /* Return to the Lobby, so we don't end up in an undefined room */
-       usergoto(config.c_baseroom, 0, NULL, NULL);
+       usergoto(config.c_baseroom, 0, 0, NULL, NULL);
        return(0);
 
 }