From: Art Cancro Date: Thu, 26 Dec 2002 04:04:48 +0000 (+0000) Subject: * Perform CHEK command when automatically establishing sessions, not just X-Git-Tag: v7.86~6067 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=430e6f04465553b99a605ff923ce6103086084e9;p=citadel.git * Perform CHEK command when automatically establishing sessions, not just when one is explicitly created. Some stuff is missing otherwise. --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 45feeaa2c..851cba233 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/auth.c b/webcit/auth.c index 937516374..814a43b68 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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(); diff --git a/webcit/event.c b/webcit/event.c index e54240db2..446cfed7b 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -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; } diff --git a/webcit/webcit.h b/webcit/webcit.h index 7e34e34c6..032ae0202 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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 */