From 8eacce58cbc89e62b60fbdd0d3e1c5238f2bef1a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 17 Feb 2005 04:48:26 +0000 Subject: [PATCH] * After setup is complete, tell them how to log in. * Don't allow the creation of accounts with blank passwords. * Don't allow users to change to a blank password. * Fixed the positioning of a few more screens that accidentally got partially hidden underneath the iconbar. * Boldfaced the "Password changed." and other prompts. * Removed the unreadable blue-on-blue links in the calendar day view. They're redundant anyway, now: "Add new calendar event" and "month view" are both in the banner bar. * "New messages / All messages" are now "Read new messages / Read all messages" * "Save message" button is now "Post message" for public room posts, and "Send message" for email. * "Message has been posted" is now "Message has been sent" for email. * Swapped positions of "Add users" and "Edit users" boxes. * vCard editor: "Other Internet email addresses" is now "aliases" * Renamed the "Users" button to "Who is online?" --- webcit/ChangeLog | 20 +++++++++++- webcit/auth.c | 71 +++++++++++++++++++++++++++++++---------- webcit/calendar_view.c | 11 +------ webcit/floors.c | 37 +++++++++++---------- webcit/iconbar.c | 4 +-- webcit/messages.c | 17 +++++++--- webcit/paging.c | 29 +++++++++++++---- webcit/roomops.c | 45 +++++++++++++++----------- webcit/setup.c | 14 +++++--- webcit/static/head.html | 11 ++++--- webcit/useredit.c | 31 +++++++++--------- webcit/userlist.c | 21 ++++++++---- webcit/vcard_edit.c | 2 +- webcit/webcit.c | 1 - 14 files changed, 206 insertions(+), 108 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index a726751bb..dfb63079f 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,23 @@ $Log$ +Revision 602.3 2005/02/17 04:48:26 ajc +* After setup is complete, tell them how to log in. +* Don't allow the creation of accounts with blank passwords. +* Don't allow users to change to a blank password. +* Fixed the positioning of a few more screens that accidentally got + partially hidden underneath the iconbar. +* Boldfaced the "Password changed." and other prompts. +* Removed the unreadable blue-on-blue links in the calendar day + view. They're redundant anyway, now: "Add new calendar event" and + "month view" are both in the banner bar. +* "New messages / All messages" are now "Read new messages / Read all + messages" +* "Save message" button is now "Post message" for public room posts, + and "Send message" for email. +* "Message has been posted" is now "Message has been sent" for email. +* Swapped positions of "Add users" and "Edit users" boxes. +* vCard editor: "Other Internet email addresses" is now "aliases" +* Renamed the "Users" button to "Who is online?" + Revision 602.2 2005/02/16 05:40:31 ajc * More display fixes @@ -2365,4 +2384,3 @@ 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 fef785e07..9c57a6e67 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -125,6 +125,10 @@ void do_login(void) } } if (!strcasecmp(bstr("action"), "New User")) { + if (strlen(bstr("pass")) == 0) { + display_login("Blank passwords are not allowed."); + return; + } serv_printf("NEWU %s", bstr("name")); serv_gets(buf); if (buf[0] == '2') { @@ -219,8 +223,14 @@ void validate(void) char buf[SIZ]; int a; - output_headers(1, 1, 0, 0, 0, 0, 0); - + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Validate new users" + "
\n" + "
\n
\n" + ); + strcpy(buf, bstr("user")); if (strlen(buf) > 0) if (strlen(bstr("axlevel")) > 0) { @@ -239,8 +249,7 @@ void validate(void) return; } - wprintf("
"); - do_template("beginbox_nt"); + wprintf("
\n"); wprintf("
"); strcpy(user, &buf[4]); @@ -286,8 +295,7 @@ void validate(void) wprintf("
\n"); wprintf("
\n"); - do_template("endbox"); - wprintf("\n"); + wprintf("
\n"); wDumpContent(1); } @@ -334,10 +342,24 @@ void display_changepw(void) { char buf[SIZ]; - output_headers(1, 1, 0, 0, 0, 0, 0); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Change your password" + "
\n" + "
\n
\n" + ); + + if (strlen(WC->ImportantMessage) > 0) { + do_template("beginbox_nt"); + wprintf("" + "%s
\n", WC->ImportantMessage); + do_template("endbox"); + strcpy(WC->ImportantMessage, ""); + } + + wprintf("
\n"); - svprintf("BOXTITLE", WCS_STRING, "Change your password"); - do_template("beginbox"); wprintf("

"); serv_puts("MESG changepw"); serv_gets(buf); @@ -345,7 +367,7 @@ void display_changepw(void) fmout(NULL, "CENTER"); } - wprintf("
\n"); + wprintf("\n"); wprintf("
" "" @@ -353,12 +375,13 @@ void display_changepw(void) wprintf("\n"); wprintf("\n"); wprintf("\n"); + wprintf("
Enter it again to confirm:

\n"); - wprintf("\n" + wprintf("" " " - "\n"); - wprintf("
\n"); - do_template("endbox"); + "\n"); + wprintf("
\n"); + wprintf("
\n"); wDumpContent(1); } @@ -376,17 +399,31 @@ void changepw(void) display_main_menu(); return; } + strcpy(newpass1, bstr("newpass1")); strcpy(newpass2, bstr("newpass2")); if (strcasecmp(newpass1, newpass2)) { strcpy(WC->ImportantMessage, "They don't match. Password was not changed."); - display_main_menu(); + display_changepw(); + return; + } + + if (strlen(newpass1) == 0) { + strcpy(WC->ImportantMessage, + "Blank passwords are not allowed."); + display_changepw(); return; } + serv_printf("SETP %s", newpass1); serv_gets(buf); - strcpy(WC->ImportantMessage, &buf[4]); - display_main_menu(); + sprintf(WC->ImportantMessage, "%s", &buf[4]); + if (buf[0] == '2') { + display_main_menu(); + } + else { + display_changepw(); + } } diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 93a7d4059..da14cde2c 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -425,16 +425,7 @@ void calendar_day_view(int year, int month, int day) { wprintf("\n"); /* End todays-date-with-left-and-right-arrows */ - wprintf("

" - " " - "Add new calendar event" - "

\n", - year, month, day - ); - - wprintf("" - "Back to month view\n", year, month); + /* In the future we might want to put a month-o-matic here */ wprintf("
\n"); diff --git a/webcit/floors.c b/webcit/floors.c index 075942447..31cd1c810 100644 --- a/webcit/floors.c +++ b/webcit/floors.c @@ -43,29 +43,32 @@ void display_floorconfig(char *prepend_html) char floorname[SIZ]; int refcount; - output_headers(1, 1, 2, 0, 0, 0, 0); - + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Add/change/delete floors" + "
\n" + "
\n
\n" + ); + if (prepend_html != NULL) { + wprintf("
"); client_write(prepend_html, strlen(prepend_html)); + wprintf("

\n"); } - serv_printf("LFLR"); /* FIXME put a real test here */ + serv_printf("LFLR"); serv_gets(buf); if (buf[0] != '1') { - wprintf("
\n"); wprintf("
"); wprintf("Error\n"); wprintf("
\n"); - wprintf("
\n
\n"); wprintf("%s
\n", &buf[4]); wDumpContent(1); return; } - svprintf("BOXTITLE", WCS_STRING, "Floor configuration"); - do_template("beginbox"); - - wprintf("\n" + wprintf("
\n" "" "" "\n" @@ -114,8 +117,7 @@ void display_floorconfig(char *prepend_html) "" "\n"); - wprintf("
Floor numberFloor nameNumber of rooms
 
\n"); - do_template("endbox"); + wprintf("
\n"); wDumpContent(1); } @@ -132,11 +134,10 @@ void delete_floor(void) { serv_gets(buf); if (buf[0] == '2') { - sprintf(message, "Floor has been deleted." - "

\n"); + sprintf(message, "Floor has been deleted."); } else { - sprintf(message, "%s>
", &buf[4]); + sprintf(message, "%s", &buf[4]); } display_floorconfig(message); @@ -153,7 +154,11 @@ void create_floor(void) { serv_printf("CFLR %s|1", floorname); serv_gets(buf); - sprintf(message, "%s>
", &buf[4]); + if (buf[0] == '2') { + sprintf(message, "New floor has been created."); + } else { + sprintf(message, "%s", &buf[4]); + } display_floorconfig(message); } @@ -171,7 +176,7 @@ void rename_floor(void) { serv_printf("EFLR %d|%s", floornum, floorname); serv_gets(buf); - sprintf(message, "%s>
", &buf[4]); + sprintf(message, "%s", &buf[4]); display_floorconfig(message); } diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 293e62d44..0fd151a93 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -216,7 +216,7 @@ void do_iconbar(void) { "SRC=\"/static/users-icon.gif\">"); } if (ib_displayas != IB_PICONLY) { - wprintf("Users"); + wprintf("Who is online?"); } wprintf("\n"); } @@ -487,7 +487,7 @@ void display_customize_iconbar(void) { "\" \"" "" - "Users
" + "Who is online?
" "Clicking this icon displays a list of all users " "currently logged in." "\n", diff --git a/webcit/messages.c b/webcit/messages.c index 4bb7057f0..41a976cca 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1487,8 +1487,12 @@ void post_message(void) serv_gets(buf); if (buf[0] == '4') { post_mime_to_server(); - sprintf(WC->ImportantMessage, - "Message has been posted.\n"); + if (strlen(bstr("recp")) > 0) { + sprintf(WC->ImportantMessage, "Message has been sent.\n"); + } + else { + sprintf(WC->ImportantMessage, "Message has been posted.\n"); + } dont_post = atol(bstr("postseq")); } else { sprintf(WC->ImportantMessage, @@ -1602,8 +1606,13 @@ void display_enter(void) " " ); - wprintf("" - " " + wprintf(" 0) { + wprintf("Send message"); + } else { + wprintf("Post message"); + } + wprintf("\"> " "\n"); /* begin richedit box */ diff --git a/webcit/paging.c b/webcit/paging.c index 5357250da..757921b4c 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -36,10 +36,19 @@ void display_page(void) strcpy(recp, bstr("recp")); - output_headers(1, 1, 0, 0, 0, 0, 0); - - svprintf("BOXTITLE", WCS_STRING, "Page: %s", recp); - do_template("beginbox"); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Send instant message" + "
\n" + "
\n
\n" + ); + + wprintf("
\n"); + + wprintf("Send an instant message to: "); + escputs(recp); + wprintf("
\n"); wprintf("
\n"); @@ -64,7 +73,7 @@ void display_page(void) wprintf("
\n"); wprintf("\n"); - do_template("endbox"); + wprintf("
\n"); wDumpContent(1); } @@ -78,8 +87,14 @@ void page_user(void) char buf[SIZ]; char closewin[SIZ]; - output_headers(1, 1, 0, 0, 0, 0, 0); - + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Add or edit an event" + "
\n" + "
\n
\n" + ); + strcpy(recp, bstr("recp")); strcpy(sc, bstr("sc")); strcpy(closewin, bstr("closewin")); diff --git a/webcit/roomops.c b/webcit/roomops.c index 2d628e265..56e8fe65f 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -386,7 +386,7 @@ void embed_room_banner(char *got, int navbar_style) { "" "" "" - "New messages" + "Read new messages" "\n" ); } @@ -453,7 +453,7 @@ void embed_room_banner(char *got, int navbar_style) { "" "" - "All messages" + "Read all messages" "\n" ); break; @@ -489,7 +489,8 @@ void embed_room_banner(char *got, int navbar_style) { if (navbar_style == navbar_default) wprintf( "" - "" + "" "Skip this room" "" "\n" @@ -497,7 +498,8 @@ void embed_room_banner(char *got, int navbar_style) { if (navbar_style == navbar_default) wprintf( "" - "" + "" "Goto next room" "" "\n" @@ -1664,9 +1666,16 @@ void display_entroom(void) display_main_menu(); return; } - output_headers(1, 1, 0, 0, 0, 0, 0); - svprintf("BOXTITLE", WCS_STRING, "Create a new room"); - do_template("beginbox"); + + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n" + "
" + "Create a new room" + "
\n" + "
\n
\n" + ); + + wprintf("
\n"); wprintf("
\n"); @@ -1685,6 +1694,16 @@ void display_entroom(void) } wprintf("\n"); + wprintf("
  • Default view for room: "); + wprintf("\n"); + wprintf("
  • Type of room:
      \n"); wprintf("
    • Personal (mailbox for you only)\n"); wprintf("
    \n"); - wprintf("
  • Default view for room: "); /* FOO */ - wprintf("\n"); - wprintf("
    \n"); wprintf(""); wprintf(" "); @@ -1725,7 +1734,7 @@ void display_entroom(void) if (buf[0] == '1') { fmout(NULL, "CENTER"); } - do_template("endbox"); + wprintf("
  • \n"); wDumpContent(1); } diff --git a/webcit/setup.c b/webcit/setup.c index e139514ec..8b6cb3828 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -39,7 +39,7 @@ int setup_type; char setup_directory[SIZ]; char init_entry[SIZ]; int using_web_installer = 0; - +char suggested_url[SIZ]; /* * Set an entry in inittab to the desired state @@ -466,6 +466,7 @@ void check_inittab_entry(void) #endif char hostname[128]; char portname[128]; + struct utsname my_utsname; /* Determine the fully qualified path name of webserver */ snprintf(looking_for, sizeof looking_for, "%s/webserver", setup_directory); @@ -490,6 +491,8 @@ void check_inittab_entry(void) "select another port."); sprintf(http_port, "2000"); set_value(question, http_port); + uname(&my_utsname); + sprintf(suggested_url, "http://%s:%s/", my_utsname.nodename, http_port); #ifdef HAVE_OPENSSL snprintf(question, sizeof question, @@ -591,8 +594,9 @@ int discover_ui(void) int main(int argc, char *argv[]) { int a; - char aaa[128]; + char aaa[256]; int info_only = 0; + strcpy(suggested_url, "http://:/"); /* set an invalid setup type */ setup_type = (-1); @@ -670,8 +674,10 @@ int main(int argc, char *argv[]) if (a == 0) start_the_service(); sleep(1); } - important_message("Setup finished", - "Setup is finished. You may now log in."); + sprintf(aaa, + "Setup is finished. You may now log in.\n" + "Point your web browser at %s\n", suggested_url); + important_message("Setup finished", aaa); } else { important_message("Setup finished", diff --git a/webcit/static/head.html b/webcit/static/head.html index 9423c13a2..e4753ffc5 100644 --- a/webcit/static/head.html +++ b/webcit/static/head.html @@ -32,7 +32,7 @@ body { left:0px; width: 15%; height:100%; - background: #ffffff; + background: #eeeecc; } * html #iconbar { @@ -99,7 +99,7 @@ body { width: 100%; padding: 0 0 1em 0; margin-bottom: 1em; - background-color: #ffffff; + background-color: #eeeecc; color: #aaaaaa; font-size: 8pt; } @@ -124,7 +124,7 @@ body { #button li a { display: block; - background-color: #FFFFFF; + background-color: #eeeecc; color: #000000; text-decoration: none; width: 100%; @@ -135,8 +135,8 @@ html>body #button li a { } #button li a:hover { - background-color: #aaaaaa; - color: #fff; + background-color: #ddddff; + color: #000000; } a:link { @@ -292,6 +292,7 @@ var sub { .errormsg { color: #AA0000; background: none; + font-weight: bold; font-style: italic; } diff --git a/webcit/useredit.c b/webcit/useredit.c index 46fb4d28a..a1927f0d0 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -52,6 +52,22 @@ void select_user_to_edit(char *message, char *preselect) wprintf("
    \n"); + svprintf("BOXTITLE", WCS_STRING, "Add users"); + do_template("beginbox"); + + wprintf("To create a new user account, enter the desired " + "user name in the box below and click 'Create'.

    "); + + wprintf("
    \n"); + wprintf("New user: "); + wprintf("
    \n" + "" + "
    \n"); + + do_template("endbox"); + + wprintf("
    "); + svprintf("BOXTITLE", WCS_STRING, "Edit or Delete users"); do_template("beginbox"); @@ -84,21 +100,6 @@ void select_user_to_edit(char *message, char *preselect) wprintf("\n"); do_template("endbox"); - wprintf(""); - - svprintf("BOXTITLE", WCS_STRING, "Add users"); - do_template("beginbox"); - - wprintf("To create a new user account, enter the desired " - "user name in the box below and click 'Create'.

    "); - - wprintf("
    \n"); - wprintf("New user: "); - wprintf("
    \n" - "" - "
    \n"); - - do_template("endbox"); wprintf("
    \n"); wDumpContent(1); diff --git a/webcit/userlist.c b/webcit/userlist.c index a0ddc8e22..4578f0481 100644 --- a/webcit/userlist.c +++ b/webcit/userlist.c @@ -124,12 +124,18 @@ void showuser(void) char buf[SIZ]; int have_pic; - output_headers(1, 1, 0, 0, 0, 0, 0); + strcpy(who, bstr("who")); + + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
    \n" + "
    " + "User profile" + "
    \n" + "
    \n
    \n" + ); - svprintf("BOXTITLE", WCS_STRING, "User profile"); - do_template("beginbox"); + wprintf("
    \n"); - strcpy(who, bstr("who")); serv_printf("OIMG _userpic_|%s", who); serv_gets(buf); if (buf[0] == '2') { @@ -157,9 +163,10 @@ void showuser(void) wprintf("\">" "" "  " - "Click here to page this user (send an instant message)" - "\n"); + "Click here to send an instant message to "); + escputs(who); + wprintf("\n"); - do_template("endbox"); + wprintf("
    \n"); wDumpContent(1); } diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index f8be5b9a1..d28bd47c2 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -256,7 +256,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { escputs(primary_inetemail); wprintf("\">
    " "" - "Other Internet e-mail addresses
    " + "Internet e-mail aliases
    " "
    \n"); diff --git a/webcit/webcit.c b/webcit/webcit.c index b96104fdd..807c84b66 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -419,7 +419,6 @@ void output_headers( int do_httpheaders, /* 1 = output HTTP headers if (do_room_banner == 1) { wprintf("
    \n"); - if (strlen(WC->ImportantMessage) > 0) { do_template("beginbox_nt"); wprintf("" -- 2.39.2