]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
Nearly all <FORM> blocks now contain a hidden input
[citadel.git] / webcit / messages.c
index d5438d38897964b0008c092c082f845bed32fb4a..b4aea13fe3a22f14e7021b96dab57754baaec795 100644 (file)
@@ -2603,8 +2603,8 @@ DONE:
        }
 
        /** Note: wDumpContent() will output one additional </div> tag. */
+       wprintf("</div>\n");            /** end of 'content' div */
        wDumpContent(1);
-       if (addrbook != NULL) free(addrbook);
 
        /** free the summary */
        if (WC->summ != NULL) {
@@ -2612,7 +2612,7 @@ DONE:
                WC->num_summ = 0;
                WC->summ = NULL;
        }
-wprintf("</div>\n");           /** end of 'content' div */
+       if (addrbook != NULL) free(addrbook);
 }
 
 
@@ -2838,6 +2838,7 @@ void display_enter(void)
        char *display_name;
        struct wc_attachment *att;
        int recipient_required = 0;
+       int subject_required = 0;
        int recipient_bad = 0;
        int i;
        int is_anonymous = 0;
@@ -2858,6 +2859,7 @@ void display_enter(void)
        /** First test to see whether this is a room that requires recipients to be entered */
        serv_puts("ENT0 0");
        serv_getln(buf, sizeof buf);
+
        if (!strncmp(buf, "570", 3)) {          /** 570 means that we need a recipient here */
                recipient_required = 1;
        }
@@ -2867,6 +2869,11 @@ void display_enter(void)
                return;
        }
 
+       /* Is the server strongly recommending that the user enter a message subject? */
+       if ((buf[3] != '\0') && (buf[4] != '\0')) {
+               subject_required = extract_int(&buf[4], 1);
+       }
+
        /**
         * Are we perhaps in an address book view?  If so, then an "enter
         * message" command really means "add new entry."
@@ -2943,6 +2950,7 @@ void display_enter(void)
                wprintf("<input type=\"hidden\" name=\"wikipage\" value=\"%s\">\n", bstr("wikipage"));
        }
        wprintf("<input type=\"hidden\" name=\"return_to\" value=\"%s\">\n", bstr("return_to"));
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
 
        /** header bar */
 
@@ -3053,7 +3061,7 @@ void display_enter(void)
        }
 
        wprintf("<div style=\"clear: both;\"><label for=\"subject_id\" > ");
-       if (recipient_required) {
+       if (recipient_required || subject_required) {
                wprintf(_("Subject:"));
        }
        else {
@@ -3263,6 +3271,7 @@ void confirm_move_msg(void)
        wprintf("<br />\n");
 
        wprintf("<form METHOD=\"POST\" action=\"move_msg\">\n");
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgid\" VALUE=\"%s\">\n", bstr("msgid"));
 
        wprintf("<SELECT NAME=\"target_room\" SIZE=5>\n");