else if (!strcasecmp(firsttoken, "email")) {
if (!IsEmptyStr(mailto)) strcat(mailto, "<br />");
+ long len;
strcat(mailto,
"<a href=\"display_enter"
"?force_room=_MAIL_?recp=");
urlesc(&mailto[strlen(mailto)], ">");
strcat(mailto, "\">");
- stresc(&mailto[strlen(mailto)], thisvalue, 1, 1);
+ len = strlen(mailto);
+ stresc(mailto+len, SIZ - len, thisvalue, 1, 1);
strcat(mailto, "</A>");
}
else if (!strcasecmp(firsttoken, "tel")) {
char mime_partnum[256];
char mime_name[256];
char mime_filename[256];
+ char escaped_mime_filename[256];
char mime_content_type[256];
char mime_charset[256];
char mime_disposition[256];
attach_links = realloc(attach_links,
(num_attach_links*sizeof(struct attach_link)));
safestrncpy(attach_links[num_attach_links-1].partnum, mime_partnum, 32);
+ urlesc(escaped_mime_filename, mime_filename);
snprintf(attach_links[num_attach_links-1].html, 1024,
"<img src=\"static/diskette_24x.gif\" "
"border=0 align=middle>\n"
" ]<br />\n",
mime_filename,
mime_content_type, mime_length,
- msgnum, mime_partnum, mime_filename,
+ msgnum, mime_partnum, escaped_mime_filename,
msgnum, mime_partnum,
_("View"),
- msgnum, mime_partnum, mime_filename,
+ msgnum, mime_partnum, escaped_mime_filename,
_("Download")
);
}
/** Boring old 80-column fixed format text gets handled this way... */
else if ( (!strcasecmp(mime_content_type, "text/plain"))
|| (!strcasecmp(mime_content_type, "text")) ) {
+ buf [0] = '\0';
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
int len;
len = strlen(buf);
- if (buf[len-1] == '\n') buf[--len] = 0;
- if (buf[len-1] == '\r') buf[--len] = 0;
+ if ((len > 0) && buf[len-1] == '\n') buf[--len] = 0;
+ if ((len > 0) && buf[len-1] == '\r') buf[--len] = 0;
#ifdef HAVE_ICONV
if (ic != (iconv_t)(-1) ) {
* \param tabbuf the tabbuffer to add name to
* \param name the name to add to the tabbuffer
*/
-void nametab(char *tabbuf, char *name) {
- stresc(tabbuf, name, 0, 0);
+void nametab(char *tabbuf, long len, char *name) {
+ stresc(tabbuf, len, name, 0, 0);
tabbuf[0] = toupper(tabbuf[0]);
tabbuf[1] = tolower(tabbuf[1]);
tabbuf[2] = tolower(tabbuf[2]);
tabfirst = i * NAMESPERPAGE;
tablast = tabfirst + NAMESPERPAGE - 1;
if (tablast > (num_ab - 1)) tablast = (num_ab - 1);
- nametab(tabfirst_label, addrbook[tabfirst].ab_name);
- nametab(tablast_label, addrbook[tablast].ab_name);
+ nametab(tabfirst_label, 64, addrbook[tabfirst].ab_name);
+ nametab(tablast_label, 64, addrbook[tablast].ab_name);
sprintf(this_tablabel, "%s - %s", tabfirst_label, tablast_label);
tablabels[i] = strdup(this_tablabel);
}
);
}
+
+ /**
+ * Set the "is_bbview" variable if it appears that we are looking at
+ * a classic bulletin board view.
+ */
+ if ((!is_tasks) && (!is_calendar) && (!is_addressbook)
+ && (!is_notes) && (!is_singlecard) && (!is_summary)) {
+ is_bbview = 1;
+ }
+
+ /**
+ * If we're not currently looking at ALL requested
+ * messages, then display the selector bar
+ */
+ if (is_bbview) {
+ /** begin bbview scroller */
+ wprintf("<form name=\"msgomatictop\" class=\"selector_top\" >");
+ wprintf(_("Reading #"), lowest_displayed, highest_displayed);
+
+ wprintf("<select name=\"whichones\" size=\"1\" "
+ "OnChange=\"location.href=msgomatictop.whichones.options"
+ "[selectedIndex].value\">\n");
+
+ if (bbs_reverse) {
+ for (b=nummsgs-1; b>=0; b = b - maxmsgs) {
+ hi = b + 1;
+ lo = b - maxmsgs + 2;
+ if (lo < 1) lo = 1;
+ wprintf("<option %s value="
+ "\"%s"
+ "?startmsg=%ld"
+ "?maxmsgs=%d"
+ "?summary=%d\">"
+ "%d-%d</option> \n",
+ ((WC->msgarr[lo-1] == startmsg) ? "selected" : ""),
+ oper,
+ WC->msgarr[lo-1],
+ maxmsgs,
+ is_summary,
+ hi, lo);
+ }
+ }
+ else {
+ for (b=0; b<nummsgs; b = b + maxmsgs) {
+ lo = b + 1;
+ hi = b + maxmsgs + 1;
+ if (hi > nummsgs) hi = nummsgs;
+ wprintf("<option %s value="
+ "\"%s"
+ "?startmsg=%ld"
+ "?maxmsgs=%d"
+ "?summary=%d\">"
+ "%d-%d</option> \n",
+ ((WC->msgarr[b] == startmsg) ? "selected" : ""),
+ oper,
+ WC->msgarr[lo-1],
+ maxmsgs,
+ is_summary,
+ lo, hi);
+ }
+ }
+
+ wprintf("<option value=\"%s?startmsg=%ld"
+ "?maxmsgs=9999999?summary=%d\">",
+ oper,
+ WC->msgarr[0], is_summary);
+ wprintf(_("All"));
+ wprintf("</option>");
+ wprintf("</select> ");
+ wprintf(_("of %d messages."), nummsgs);
+
+ /** forward/reverse */
+ wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
+ "OnChange=\"location.href='%s?sortby=forward'\"",
+ (bbs_reverse ? "" : "checked"),
+ oper
+ );
+ wprintf(">");
+ wprintf(_("oldest to newest"));
+ wprintf(" ");
+
+ wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
+ "OnChange=\"location.href='%s?sortby=reverse'\"",
+ (bbs_reverse ? "checked" : ""),
+ oper
+ );
+ wprintf(">");
+ wprintf(_("newest to oldest"));
+ wprintf("\n");
+
+ wprintf("</select></form>\n");
+ /** end bbview scroller */
+ }
+
+
+
for (a = 0; a < nummsgs; ++a) {
if ((WC->msgarr[a] >= startmsg) && (num_displayed < maxmsgs)) {
}
}
- /**
- * Set the "is_bbview" variable if it appears that we are looking at
- * a classic bulletin board view.
- */
- if ((!is_tasks) && (!is_calendar) && (!is_addressbook)
- && (!is_notes) && (!is_singlecard) && (!is_summary)) {
- is_bbview = 1;
- }
/** Output loop */
if (displayed_msgs != NULL) {
*/
if (is_bbview) {
/** begin bbview scroller */
- wprintf("<form name=\"msgomatic\">");
+ wprintf("<form name=\"msgomatic\" class=\"selector_bottom\" >");
wprintf(_("Reading #"), lowest_displayed, highest_displayed);
wprintf("<select name=\"whichones\" size=\"1\" "
}
wprintf("<option value=\"%s?startmsg=%ld"
- "?maxmsgs=9999999?summary=%d\">"
- "ALL"
- "</option> ",
+ "?maxmsgs=9999999?summary=%d\">",
oper,
WC->msgarr[0], is_summary);
-
+ wprintf(_("All"));
+ wprintf("</option>");
wprintf("</select> ");
wprintf(_("of %d messages."), nummsgs);
/** forward/reverse */
- wprintf(" <select name=\"direction\" size=\"1\" "
- "OnChange=\"location.href=msgomatic.direction.options"
- "[selectedIndex].value\">\n"
- );
-
- wprintf("<option %s value=\"%s?sortby=forward\">oldest to newest</option>\n",
- (bbs_reverse ? "" : "selected"),
+ wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
+ "OnChange=\"location.href='%s?sortby=forward'\"",
+ (bbs_reverse ? "" : "checked"),
oper
);
-
- wprintf("<option %s value=\"%s?sortby=reverse\">newest to oldest</option>\n",
- (bbs_reverse ? "selected" : ""),
+ wprintf(">");
+ wprintf(_("oldest to newest"));
+ wprintf(" ");
+ wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
+ "OnChange=\"location.href='%s?sortby=reverse'\"",
+ (bbs_reverse ? "checked" : ""),
oper
);
-
- wprintf("</select></form>\n");
+ wprintf(">");
+ wprintf(_("newest to oldest"));
+ wprintf("\n");
+
+ wprintf("</form>\n");
/** end bbview scroller */
}
struct wc_attachment *att;
char *encoded;
size_t encoded_length;
+ size_t encoded_strlen;
/** RFC2045 requires this, and some clients look for it... */
serv_puts("MIME-Version: 1.0");
encoded_length = ((att->length * 150) / 100);
encoded = malloc(encoded_length);
if (encoded == NULL) break;
- CtdlEncodeBase64(encoded, att->data, att->length, 1);
+ encoded_strlen = CtdlEncodeBase64(&encoded, att->data, att->length, &encoded_length, 1);
serv_printf("--%s", boundary);
serv_printf("Content-type: %s", att->content_type);
"filename=\"%s\"", att->filename);
serv_puts("Content-transfer-encoding: base64");
serv_puts("");
- serv_write(encoded, strlen(encoded));
+ serv_write(encoded, encoded_strlen);
serv_puts("");
serv_puts("");
free(encoded);
do_template("richedit");
/** Enumerate any attachments which are already in place... */
- wprintf("<div><img src=\"static/diskette_24x.gif\" class=\"imgedit\" ");
+ wprintf("<div class=\"attachment buttons\"><img src=\"static/diskette_24x.gif\" class=\"imgedit\" > ");
wprintf(_("Attachments:"));
wprintf(" ");
wprintf("<select name=\"which_attachment\" size=1>");
/** Now offer the ability to attach additional files... */
wprintf(" ");
wprintf(_("Attach file:"));
- wprintf(" <input name=\"attachfile\" "
+ wprintf(" <input name=\"attachfile\" class=\"attachfile\" "
"size=16 type=\"file\">\n "
"<input type=\"submit\" name=\"attach_button\" value=\"%s\">\n", _("Add"));
wprintf("</div>");
output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
- wprintf("<TABLE WIDTH=100%% BORDER=0><TR><TD>");
- wprintf("<SPAN CLASS=\"titlebar\">");
+ wprintf("<h1>");
wprintf(_("Confirm move of message"));
- wprintf("</SPAN>\n");
- wprintf("</TD></TR></TABLE>\n");
- wprintf("</div>\n<div id=\"content\">\n");
+ wprintf("</h1>");
+ wprintf("</div>\n");
+
+ wprintf("<div id=\"content\" class=\"service\">\n");
wprintf("<CENTER>");