* Perform CHEK command when automatically establishing sessions, not just
authorArt Cancro <ajc@citadel.org>
Thu, 26 Dec 2002 04:04:48 +0000 (04:04 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 26 Dec 2002 04:04:48 +0000 (04:04 +0000)
  when one is explicitly created.  Some stuff is missing otherwise.

webcit/ChangeLog
webcit/auth.c
webcit/event.c
webcit/webcit.h

index 45feeaa2c479b0895590f33dc518f3ed17e3d684..851cba233ad06c85e3fd0c7ff488353da45d6136 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 400.71  2002/12/26 04:04:48  ajc
+* Perform CHEK command when automatically establishing sessions, not just
+  when one is explicitly created.  Some stuff is missing otherwise.
+
 Revision 400.70  2002/12/25 23:18:06  ajc
 * Be more strategic about when to call ical_dezonify()
   (This may be the last set of fixes.  I hope so.)
@@ -1198,3 +1202,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 93751637477e8bf9d19663958675c4c62a882473..814a43b6896205639627fb835d0c1c9001828e8a 100644 (file)
@@ -73,6 +73,8 @@ void display_login(char *mesg)
  */
 void become_logged_in(char *user, char *pass, char *serv_response)
 {
+       char buf[SIZ];
+
        WC->logged_in = 1;
        extract(WC->wc_username, &serv_response[4], 0);
        strcpy(WC->wc_password, pass);
@@ -80,15 +82,23 @@ void become_logged_in(char *user, char *pass, char *serv_response)
        if (WC->axlevel >= 6) {
                WC->is_aide = 1;
        }
+
        load_preferences();
+
+       serv_puts("CHEK");
+       serv_gets(buf);
+       if (buf[0] == '2') {
+               WC->new_mail = extract_int(&buf[4], 0);
+               WC->need_regi = extract_int(&buf[4], 1);
+               WC->need_vali = extract_int(&buf[4], 2);
+               extract(WC->cs_inet_email, &buf[4], 3);
+       }
 }
 
 
 void do_login(void)
 {
        char buf[SIZ];
-       int need_regi = 0;
-
 
        if (!strcasecmp(bstr("action"), "Exit")) {
                do_logout();
@@ -125,15 +135,7 @@ void do_login(void)
                }
        }
        if (WC->logged_in) {
-               serv_puts("CHEK");
-               serv_gets(buf);
-               if (buf[0] == '2') {
-                       WC->new_mail = extract_int(&buf[4], 0);
-                       need_regi = extract_int(&buf[4], 1);
-                       WC->need_vali = extract_int(&buf[4], 2);
-                       extract(WC->cs_inet_email, &buf[4], 3);
-               }
-               if (need_regi) {
+               if (WC->need_regi) {
                        display_reg(1);
                } else {
                        do_welcome();
index e54240db2096d0a59ceb2a68fa30a374268ea4fe..446cfed7b832e1378543d9bc3711f29adffc6bca 100644 (file)
@@ -239,8 +239,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                if (!strncasecmp(organizer_string, "MAILTO:", 7)) {
                        strcpy(organizer_string, &organizer_string[7]);
                        striplt(organizer_string);
+                       lprintf(9, "ISME %s\n", organizer_string);
                        serv_printf("ISME %s", organizer_string);
                        serv_gets(buf);
+                       lprintf(9, "%s\n", buf);
                        if (buf[0] == '2') {
                                organizer_is_me = 1;
                        }
index 7e34e34c67db9bf370204833fecd7b7f6ead8ed2..032ae020218df3bea0d3531033314b226366f370 100644 (file)
@@ -159,7 +159,8 @@ struct wcsession {
        char *upload;
        int new_mail;
        int remember_new_mail;
-       int need_vali;
+       int need_regi;                  /* This user needs to register. */
+       int need_vali;                  /* New users require validation. */
        char cs_inet_email[SIZ];        /* User's preferred Internet addr. */
         pthread_mutex_t SessionMutex;  /* mutex for exclusive access */
         time_t lastreq;                        /* Timestamp of most recent HTTP */