From d120028b4c45f3c26d05186c8ba488fd2feef13f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 18 Jan 2006 21:40:46 +0000 Subject: [PATCH] * fix_scrollbar_bug is now a class instead of an id. Fixes validator warnings. * Corrected bad html generated when there's only one message in a summary view. * Retain both login name and display name (fullname) in session structure. This fixes chat window authentication when connecting to a Citadel server using host based authentication. --- webcit/ChangeLog | 7 +++++ webcit/auth.c | 10 +++--- webcit/calendar.c | 2 +- webcit/calendar_view.c | 6 ++-- webcit/event.c | 2 +- webcit/floors.c | 2 +- webcit/graphics.c | 2 +- webcit/groupdav_propfind.c | 4 +-- webcit/iconbar.c | 2 +- webcit/inetconf.c | 2 +- webcit/listsub.c | 1 + webcit/mainmenu.c | 6 ++-- webcit/messages.c | 63 ++++++++++++++++---------------------- webcit/paging.c | 4 +-- webcit/preferences.c | 2 +- webcit/roomops.c | 11 ++++--- webcit/setup_wizard.c | 2 +- webcit/siteconfig.c | 2 +- webcit/static/webcit.css | 2 +- webcit/subst.c | 2 +- webcit/summary.c | 4 +-- webcit/useredit.c | 2 +- webcit/userlist.c | 4 +-- webcit/vcard_edit.c | 12 ++++---- webcit/webcit.c | 2 +- webcit/webcit.h | 1 + 26 files changed, 82 insertions(+), 77 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 89b03edb2..ad86d980c 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,5 +1,12 @@ $Id$ +Wed Jan 18 16:39:12 EST 2006 ajc +* fix_scrollbar_bug is now a class instead of an id. Fixes validator warnings. +* Corrected bad html generated when there's only one message in a summary view. +* Retain both login name and display name (fullname) in session structure. + This fixes chat window authentication when connecting to a Citadel server + using host based authentication. + Mon Jan 16 11:52:53 EST 2006 ajc * Experimental unix domain socket listener diff --git a/webcit/auth.c b/webcit/auth.c index f5ff48599..139ccda49 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -85,7 +85,8 @@ void become_logged_in(char *user, char *pass, char *serv_response) char buf[SIZ]; WC->logged_in = 1; - extract_token(WC->wc_username, &serv_response[4], 0, '|', sizeof WC->wc_username); + extract_token(WC->wc_fullname, &serv_response[4], 0, '|', sizeof WC->wc_fullname); + safestrncpy(WC->wc_username, user, sizeof WC->wc_username); safestrncpy(WC->wc_password, pass, sizeof WC->wc_password); WC->axlevel = extract_int(&serv_response[4], 1); if (WC->axlevel >= 6) { @@ -248,6 +249,7 @@ void do_logout(void) safestrncpy(WC->wc_username, "", sizeof WC->wc_username); safestrncpy(WC->wc_password, "", sizeof WC->wc_password); safestrncpy(WC->wc_roomname, "", sizeof WC->wc_roomname); + safestrncpy(WC->wc_fullname, "", sizeof WC->wc_fullname); /* Calling output_headers() this way causes the cookies to be un-set */ output_headers(1, 1, 0, 1, 0, 0); @@ -326,7 +328,7 @@ void validate(void) return; } - wprintf("
" + wprintf("
" "
\n"); wprintf("
"); @@ -396,7 +398,7 @@ void display_reg(int during_login) return; } - vcard_msgnum = locate_user_vcard(WC->wc_username, -1); + vcard_msgnum = locate_user_vcard(WC->wc_fullname, -1); if (vcard_msgnum < 0L) { if (during_login) do_welcome(); else display_main_menu(); @@ -440,7 +442,7 @@ void display_changepw(void) safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage); } - wprintf("
" + wprintf("
" "
\n"); wprintf("

"); diff --git a/webcit/calendar.c b/webcit/calendar.c index e1453d4bf..b52ce7159 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -513,7 +513,7 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) { "\n
\n" ); - wprintf("
" + wprintf("
" "
"); wprintf("
\n"); diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 5276039f1..0879948fb 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -140,7 +140,7 @@ void calendar_month_view(int year, int month, int day) { } /* Outer table (to get the background color) */ - wprintf("
" + wprintf("
" "
\n"); @@ -335,7 +335,7 @@ void calendar_day_view(int year, int month, int day) { /* Outer table (to get the background color) */ - wprintf("
" + wprintf("
" "
\n"); @@ -626,7 +626,7 @@ void do_tasks_view(void) { char buf[SIZ]; icalproperty *p; - wprintf("
" + wprintf("
" "\n\n" "
"); wprintf(_("Name of task")); diff --git a/webcit/event.c b/webcit/event.c index 39aa58ce0..15d56aeb3 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -104,7 +104,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) ); - wprintf("
" + wprintf("
" "
\n"); /************************************************************ diff --git a/webcit/floors.c b/webcit/floors.c index b67e47001..7b210821c 100644 --- a/webcit/floors.c +++ b/webcit/floors.c @@ -53,7 +53,7 @@ void display_floorconfig(char *prepend_html) return; } - wprintf("
" + wprintf("
" "\n" "
"); wprintf(_("Floor number")); diff --git a/webcit/graphics.c b/webcit/graphics.c index 6e6291975..4bc9e8e11 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -29,7 +29,7 @@ void display_graphics_upload(char *description, char *check_cmd, char *uplurl) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf("
\n"); diff --git a/webcit/groupdav_propfind.c b/webcit/groupdav_propfind.c index c6f1bbdd2..2385d9900 100644 --- a/webcit/groupdav_propfind.c +++ b/webcit/groupdav_propfind.c @@ -105,9 +105,9 @@ void groupdav_folder_list(void) { wprintf(""); wprintf("HTTP/1.1 200 OK"); wprintf(""); - wprintf(""); + wprintf(""); escputs(roomname); - wprintf(""); + wprintf(""); wprintf(""); switch(view) { diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 8d325d988..dc18455d6 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -471,7 +471,7 @@ void display_customize_iconbar(void) { "\n
\n" ); - wprintf("
" + wprintf("
" "
"); wprintf("\n"); diff --git a/webcit/inetconf.c b/webcit/inetconf.c index 3bfde9d7c..eaee1b717 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -93,7 +93,7 @@ void display_inetconf(void) wprintf("
\n"); wprintf("
\n
\n"); - wprintf("
" + wprintf("
" "
\n"); for (which=0; whichwc_fullname, ""); strcpy(WC->wc_username, ""); strcpy(WC->wc_password, ""); strcpy(WC->wc_roomname, ""); diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 9d26ef17f..15fb8a026 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -14,7 +14,7 @@ void display_main_menu(void) { output_headers(1, 1, 1, 0, 0, 0); - wprintf("
" + wprintf("
" "" "
\n"); @@ -201,7 +201,7 @@ void display_aide_menu(void) "\n
\n" ); - wprintf("
" + wprintf("
" "
"); svprintf("BOXTITLE", WCS_STRING, _("Global Configuration")); @@ -273,7 +273,7 @@ void display_generic(void) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf("
"); diff --git a/webcit/messages.c b/webcit/messages.c index 0139a9610..ea2171d15 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -250,13 +250,13 @@ void display_parsed_vcard(struct vCard *v, int full) { char firsttoken[SIZ]; int pass; - char displayname[SIZ]; + char fullname[SIZ]; char title[SIZ]; char org[SIZ]; char phone[SIZ]; char mailto[SIZ]; - strcpy(displayname, ""); + strcpy(fullname, ""); strcpy(phone, ""); strcpy(mailto, ""); strcpy(title, ""); @@ -269,9 +269,9 @@ void display_parsed_vcard(struct vCard *v, int full) { escputs(name); } else if (name = vcard_get_prop(v, "n", 1, 0, 0), name != NULL) { - strcpy(displayname, name); - vcard_n_prettyize(displayname); - escputs(displayname); + strcpy(fullname, name); + vcard_n_prettyize(fullname); + escputs(fullname); } else { wprintf(" "); @@ -321,15 +321,15 @@ void display_parsed_vcard(struct vCard *v, int full) { /* N is name, but only if there's no FN already there */ if (!strcasecmp(firsttoken, "n")) { - if (strlen(displayname) == 0) { - strcpy(displayname, thisvalue); - vcard_n_prettyize(displayname); + if (strlen(fullname) == 0) { + strcpy(fullname, thisvalue); + vcard_n_prettyize(fullname); } } /* FN (full name) is a true 'display name' field */ else if (!strcasecmp(firsttoken, "fn")) { - strcpy(displayname, thisvalue); + strcpy(fullname, thisvalue); } /* title */ @@ -348,7 +348,7 @@ void display_parsed_vcard(struct vCard *v, int full) { ""); @@ -424,7 +424,7 @@ void display_parsed_vcard(struct vCard *v, int full) { "
" "" ""); - escputs(displayname); + escputs(fullname); wprintf(""); if (strlen(title) > 0) { wprintf("
"); @@ -553,7 +553,7 @@ void read_message(long msgnum, int printable_view, char *section) { /* begin everythingamundo table */ if (!printable_view) { - wprintf("
\n"); + wprintf("
\n"); wprintf("
\n"); } @@ -1664,7 +1664,7 @@ int load_msg_ptrs(char *servcmd, int with_headers) { char buf[1024]; time_t datestamp; - char displayname[128]; + char fullname[128]; char nodename[128]; char inetaddr[128]; char subject[256]; @@ -1695,7 +1695,7 @@ int load_msg_ptrs(char *servcmd, int with_headers) if (nummsgs < maxload) { WC->msgarr[nummsgs] = extract_long(buf, 0); datestamp = extract_long(buf, 1); - extract_token(displayname, buf, 2, '|', sizeof displayname); + extract_token(fullname, buf, 2, '|', sizeof fullname); extract_token(nodename, buf, 3, '|', sizeof nodename); extract_token(inetaddr, buf, 4, '|', sizeof inetaddr); extract_token(subject, buf, 5, '|', sizeof subject); @@ -1711,8 +1711,8 @@ int load_msg_ptrs(char *servcmd, int with_headers) memset(&WC->summ[nummsgs-1], 0, sizeof(struct message_summary)); WC->summ[nummsgs-1].msgnum = WC->msgarr[nummsgs-1]; safestrncpy(WC->summ[nummsgs-1].subj, _("(no subject)"), sizeof WC->summ[nummsgs-1].subj); - if (strlen(displayname) > 0) { - safestrncpy(WC->summ[nummsgs-1].from, displayname, sizeof WC->summ[nummsgs-1].from); + if (strlen(fullname) > 0) { + safestrncpy(WC->summ[nummsgs-1].from, fullname, sizeof WC->summ[nummsgs-1].from); } if (strlen(subject) > 0) { safestrncpy(WC->summ[nummsgs-1].subj, subject, @@ -2057,7 +2057,7 @@ void readloop(char *oper) /* note that Date and Delete are now in the same column */ wprintf("
" - "
" + "
" "" "" ); @@ -2083,10 +2083,9 @@ void readloop(char *oper) wprintf("
" - "
\n" + "
\n" - "" - "
" ); } @@ -2134,8 +2133,7 @@ void readloop(char *oper) /* Set the "is_bbview" variable if it appears that we are looking at * a classic bulletin board view. */ - if (num_displayed > 1) { - if ((!is_tasks) && (!is_calendar) && (!is_addressbook) + if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_notes) && (!is_singlecard) && (!is_summary)) { is_bbview = 1; } @@ -2159,16 +2157,16 @@ void readloop(char *oper) } if (is_summary) { - wprintf("
" + wprintf("
" "
\n"); /* end of 'fix_scrollbar_bug' div */ wprintf("
"); /* end of 'message_list' div */ /* Here's the grab-it-to-resize-the-message-list widget */ wprintf("
" - "
" + "
" "
" "
\n" ); @@ -2250,19 +2248,18 @@ void readloop(char *oper) "[selectedIndex].value\">\n" ); - wprintf("\n", + wprintf("\n", (bbs_reverse ? "" : "selected"), oper ); - wprintf("\n", + wprintf("\n", (bbs_reverse ? "selected" : ""), oper ); wprintf("\n"); /* end bbview scroller */ - } } DONE: @@ -2278,12 +2275,6 @@ DONE: do_addrbook_view(addrbook, num_ab); /* Render the address book */ } - /* Put the data transfer hidden iframe in a hidden div, to make it *really* hidden */ - wprintf("
" - "
\n" - "\n" - ); - /* Note: wDumpContent() will output one additional
tag. */ wDumpContent(1); if (addrbook != NULL) free(addrbook); @@ -2531,7 +2522,7 @@ void display_enter(void) embed_room_banner(NULL, navbar_none); wprintf("
\n"); wprintf("
\n" - "
" + "
" "
"); /* First test to see whether this is a room that requires recipients to be entered */ @@ -2567,7 +2558,7 @@ void display_enter(void) now = time(NULL); fmt_date(buf, now, 0); strcat(&buf[strlen(buf)], _(" from ")); - stresc(&buf[strlen(buf)], WC->wc_username, 1, 1); + stresc(&buf[strlen(buf)], WC->wc_fullname, 1, 1); /* Don't need this anymore, it's in the input box below if (strlen(bstr("recp")) > 0) { diff --git a/webcit/paging.c b/webcit/paging.c index 2548c968b..ddc2fbbea 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -25,7 +25,7 @@ void display_page(void) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf(_("Send an instant message to: ")); @@ -373,7 +373,7 @@ void chat_recv(void) { if (strcasecmp(cl_user, WC->last_chat_user)) { wprintf(""); - if (!strcasecmp(cl_user, WC->wc_username)) { + if (!strcasecmp(cl_user, WC->wc_fullname)) { wprintf(""); } else { diff --git a/webcit/preferences.c b/webcit/preferences.c index 991a268ca..9414a1eda 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -190,7 +190,7 @@ void display_preferences(void) wprintf("\n" "
\n"); - wprintf("
" + wprintf("
" "
\n"); /* begin form */ diff --git a/webcit/roomops.c b/webcit/roomops.c index 81ac71a88..5ed5c5a3e 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -225,6 +225,9 @@ void readinfo(void) if (buf[0] == '1') { fmout("CENTER"); } + else { + wprintf(" "); + } } @@ -878,7 +881,7 @@ void display_editroom(void) /* print the tabbed dialog */ wprintf("
" - "
" + "
" "" "" "\n"); @@ -983,7 +986,7 @@ void display_editroom(void) /* end tabbed dialog */ /* begin content of whatever tab is open now */ - wprintf("
" + wprintf("
" "
 
\n" "
\n"); @@ -1835,7 +1838,7 @@ void display_entroom(void) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf("
\n"); @@ -2044,7 +2047,7 @@ void display_private(char *rname, int req_pass) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf("
\n"); diff --git a/webcit/setup_wizard.c b/webcit/setup_wizard.c index 5b389301f..bc2b2277a 100644 --- a/webcit/setup_wizard.c +++ b/webcit/setup_wizard.c @@ -37,7 +37,7 @@ void do_setup_wizard(void) wprintf("\n" "
\n"); - wprintf("
" + wprintf("
" "\n" ); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 273650c90..25c9a852e 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -51,7 +51,7 @@ void display_siteconfig(void) return; } - wprintf("
" + wprintf("
" "
"); char *tabnames[] = { diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 58f6e50b5..184b79cf2 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -170,7 +170,7 @@ body { } -#fix_scrollbar_bug { +.fix_scrollbar_bug { margin-right:1px; /* Gecko and other non-broken browsers */ width: expression('97%'); /* Only IE6 understands 'expression' - fixes weird scrollbarbug */ } diff --git a/webcit/subst.c b/webcit/subst.c index 60e96c633..c872650db 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -157,7 +157,7 @@ void print_value_of(char *keyname) { } else if (!strcasecmp(keyname, "CURRENT_USER")) { - escputs(WC->wc_username); + escputs(WC->wc_fullname); } else if (!strcasecmp(keyname, "CURRENT_ROOM")) { diff --git a/webcit/summary.c b/webcit/summary.c index 4a13e339b..2c3244fec 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -233,7 +233,7 @@ void summary_inner_div(void) { * not people I consider worthwhile, I still want them to use WebCit. */ - wprintf("
" + wprintf("
" ""); /* @@ -278,7 +278,7 @@ void summary(void) { "" ); - snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username); + snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname); escputs(title); wprintf("
\n"); wprintf(""); diff --git a/webcit/useredit.c b/webcit/useredit.c index 73328b00b..f1c872f9b 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -270,7 +270,7 @@ void display_edituser(char *supplied_username, int is_new) { wprintf("
\n"); wprintf("
\n
\n"); - wprintf("
" + wprintf("
" "
\n"); wprintf("\n" "" + wprintf("
" "" "")); @@ -121,7 +121,7 @@ void showuser(void) "\n
\n" ); - wprintf("
" + wprintf("
" "
\n"); wprintf(_("
User NameNumberAccess LevelLast LoginTotal LoginsTotal Posts
\n"); serv_printf("OIMG _userpic_|%s", who); diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index 7ff6a76aa..755dae6fc 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -38,7 +38,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { char primary_inetemail[256]; char other_inetemail[SIZ]; char extrafields[SIZ]; - char displayname[256]; + char fullname[256]; char title[256]; char org[256]; @@ -116,7 +116,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { } else if (!strcasecmp(key, "fn")) { - safestrncpy(displayname, value, sizeof displayname); + safestrncpy(fullname, value, sizeof fullname); } else if (!strcasecmp(key, "title")) { @@ -182,7 +182,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { ); wprintf("\n"); - wprintf("
" + wprintf("
" "
\n"); wprintf("" @@ -214,9 +214,9 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { wprintf(_("Display name:")); wprintf("
" - "

\n", - displayname + fullname ); wprintf(_("Title:")); @@ -375,7 +375,7 @@ void submit_vcard(void) { bstr("prefix"), bstr("suffix") ); serv_printf("title:%s", bstr("title") ); - serv_printf("fn:%s", bstr("displayname") ); + serv_printf("fn:%s", bstr("fullname") ); serv_printf("org:%s", bstr("org") ); serv_printf("adr:%s;%s;%s;%s;%s;%s;%s", bstr("pobox"), diff --git a/webcit/webcit.c b/webcit/webcit.c index 127808b09..7220a5d7e 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1374,7 +1374,7 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "editinfo")) { save_edit(_("Room info"), "EINF 1", 1); } else if (!strcasecmp(action, "display_editbio")) { - sprintf(buf, "RBIO %s", WC->wc_username); + sprintf(buf, "RBIO %s", WC->wc_fullname); display_edit(_("Your bio"), "NOOP", buf, "editbio", 3); } else if (!strcasecmp(action, "editbio")) { save_edit(_("Your bio"), "EBIO", 0); diff --git a/webcit/webcit.h b/webcit/webcit.h index 331ffb37e..78cfa7f4a 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -308,6 +308,7 @@ struct wcsession { struct wcsession *next; /* Linked list */ int wc_session; /* WebCit session ID */ char wc_username[128]; + char wc_fullname[128]; char wc_password[128]; char wc_roomname[256]; int connected; -- 2.30.2