From 067bec8c58c7e61d8a91d8c68b725b49549df6a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 25 Nov 2008 23:15:33 +0000 Subject: [PATCH] * add missing hint to -Z * standart escape-ability for message quoting * remove unneded remaining code * escape everything in the textarea --- webcit/messages.c | 330 +------------------ webcit/msg_renderers.c | 7 +- webcit/static/t/edit_message.html | 43 +-- webcit/static/t/view_message_replyquote.html | 27 +- webcit/webserver.c | 2 +- 5 files changed, 50 insertions(+), 359 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index 3b05176a7..03eaad55d 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1988,7 +1988,6 @@ void post_message(void) void display_enter(void) { char buf[SIZ]; - StrBuf *ebuf; long now; const StrBuf *display_name = NULL; /////wc_attachment *att; @@ -1996,8 +1995,8 @@ void display_enter(void) int subject_required = 0; int recipient_bad = 0; int is_anonymous = 0; - long existing_page = (-1L); - struct wcsession *WCC = WC; + + struct wcsession *WCC = WC; now = time(NULL); @@ -2060,16 +2059,7 @@ void display_enter(void) * Otherwise proceed normally. * Do a custom room banner with no navbar... */ - output_headers(1, 1, 2, 0, 0, 0); -/* - wprintf("
\n"); - embed_room_banner(NULL, navbar_none); - wprintf("
\n"); - wprintf("
\n" - "
"); -*/ - /* Now check our actual recipients if there are any */ if (recipient_required) { const StrBuf *Recp = NULL; const StrBuf *Cc = NULL; @@ -2112,326 +2102,20 @@ void display_enter(void) } else if (buf[0] != '2') { /** Any other error means that we cannot continue */ wprintf("%s
\n", &buf[4]);/// -> important message - goto DONE; + return; } } svputlong("RCPTREQUIRED", recipient_required); svputlong("SUBJREQUIRED", recipient_required || subject_required); - DoTemplate(HKEY("edit_message"), NULL, NULL, CTX_NONE); - address_book_popup(); - wDumpContent(1); + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + DoTemplate(HKEY("edit_message"), NULL, NULL, CTX_NONE); + end_burst(); return; - - - /** If we got this far, we can display the message entry screen. */ - - /* begin message entry screen */ - wprintf("
\n"); - wprintf("\n", now); - if (WCC->wc_view == VIEW_WIKI) { - wprintf("\n", bstr("wikipage")); - } - wprintf("\n", bstr("return_to")); - wprintf("\n", WCC->nonce); - wprintf("wc_roomname); - wprintf("\">\n"); - wprintf("\n"); - - /** submit or cancel buttons */ - wprintf("

"); - wprintf(" " - "\n", _("Cancel")); - wprintf("

"); - - /** header bar */ - - wprintf(""); - wprintf(" "); /** header bar */ - webcit_fmt_date(buf, now, 0); - wprintf("%s", buf); - wprintf("\n"); /** header bar */ - - wprintf(""); - wprintf(""); - wprintf(""); - - wprintf(""); - - if (recipient_required) { - char *ccraw; - char *copy; - size_t len; - wprintf("" - ""); - - wprintf("" - ""); - - wprintf("" - ""); - - /** Initialize the autocomplete ajax helpers (found in wclib.js) */ - wprintf(" \n" - ); - - } - - wprintf("" - ""); - - wprintf("
"); - - /* Allow the user to select any of his valid screen names */ - - wprintf("\n"); - - /* If this is an email (not a post), allow the user to select any of his - * valid email addresses. - */ - if (recipient_required) { - serv_puts("GVEA"); - serv_getln(buf, sizeof buf); - if (buf[0] == '1') { - wprintf("\n"); - } - } - - wprintf(_(" in ")); - escputs(WCC->wc_roomname); - - wprintf("
"); - wprintf("
"); - wprintf("
"); - - /** Pop open an address book -- begin **/ - wprintf( - "" - "" - " %s", - _("To:"), _("CC:"), _("BCC:"), - _("Contacts"), _("Contacts") - ); - /** Pop open an address book -- end **/ - - wprintf("
"); - wprintf("
"); - wprintf("
"); - wprintf("
"); - wprintf("
" - "\n"); - wprintf("
\n"); - - wprintf("\n"); - - /** Make sure we only insert our signature once */ - /** We don't care if it was there or not before, it needs to be there now. */ - wprintf("\n"); - - /** - * The following template embeds the TinyMCE richedit control, and automatically - * transforms the textarea into a richedit textarea. - */ - do_template("richedit", NULL); - - /** Enumerate any attachments which are already in place... */ - wprintf("
"); - wprintf(_("Attachments:")); - wprintf(" "); - wprintf(""); - - /** Now offer the ability to attach additional files... */ - wprintf("   "); - wprintf(_("Attach file:")); - wprintf(" \n  " - "\n", _("Add")); - wprintf("
"); /* End of "attachment buttons" div */ - - - wprintf("
"); - - wprintf("
\n"); - wprintf("
\n"); /* end of "fix_scrollbar_bug" div */ - - /* NOTE: address_book_popup() will close the "content" div. Don't close it here. */ -DONE: address_book_popup(); - wDumpContent(1); } - /** * \brief delete a message */ diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index ae4cf267b..2f72a5754 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -529,8 +529,13 @@ int Conditional_MAIL_MIME_ATTACH(WCTemplateToken *Tokens, void *Context, int Con void tmplput_QUOTED_MAIL_BODY(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) { long MsgNum; + StrBuf *Buf; + MsgNum = LBstr(Tokens->Params[0]->Start, Tokens->Params[0]->len); - read_message(Target, HKEY("view_message_replyquote"), MsgNum, 0, NULL); + Buf = NewStrBuf(); + read_message(Buf, HKEY("view_message_replyquote"), MsgNum, 0, NULL); + StrBufAppendTemplate(Target, nArgs, Tokens, Context, ContextType, Buf, 1); + FreeStrBuf(&Buf); } void tmplput_MAIL_BODY(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) diff --git a/webcit/static/t/edit_message.html b/webcit/static/t/edit_message.html index f522b843e..00f809a4b 100644 --- a/webcit/static/t/edit_message.html +++ b/webcit/static/t/edit_message.html @@ -19,7 +19,6 @@

- -
@@ -70,10 +69,6 @@
+ +
diff --git a/webcit/static/t/view_message_replyquote.html b/webcit/static/t/view_message_replyquote.html index dc07d15d5..2bbb28570 100644 --- a/webcit/static/t/view_message_replyquote.html +++ b/webcit/static/t/view_message_replyquote.html @@ -1,15 +1,14 @@ -
-
- - - - *** - -

-
- -
- -
- +
+
+ + + <> + *** + +

+
+ +
+ +
diff --git a/webcit/webserver.c b/webcit/webserver.c index 28bab53c1..4b8a28c9b 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -790,7 +790,7 @@ int main(int argc, char **argv) "[-i ip_addr] [-p http_port] " "[-t tracefile] [-c] [-f] " "[-T Templatedebuglevel] " - "[-d] " + "[-d] [-Z] " #ifdef HAVE_OPENSSL "[-s] " #endif -- 2.39.2