httpdate(httpnow, time(NULL));
if (do_httpheaders) {
- wprintf("Content-type: text/html\r\n"
+ wprintf("Content-type: text/html; charset=utf-8\r\n"
"Server: %s / %s\n"
"Connection: close\r\n",
SERVER, serv_info.serv_software
wprintf("HTTP/1.0 302 Moved Temporarily\n");
wprintf("Location: %s\r\n", whichpage);
wprintf("URI: %s\r\n", whichpage);
- wprintf("Content-type: text/html\r\n\r\n");
+ wprintf("Content-type: text/html; charset=utf-8\r\n\r\n");
wprintf("<html><body>\n");
wprintf("you really want to be <A HREF=\"%s\">here</A> now\n",
whichpage);
return;
}
- set_preference("startpage", bstr("startpage"));
+ set_preference("startpage", bstr("startpage"), 1);
output_headers(1, 1, 0, 0, 0, 0, 0);
do_template("newstartpage");
void upload_handler(char *name, char *filename, char *partnum, char *disp,
- void *content, char *cbtype, size_t length,
- char *encoding, void *userdata)
+ void *content, char *cbtype, char *cbcharset,
+ size_t length, char *encoding, void *userdata)
{
struct urlcontent *u;
+ lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n",
+ name, cbtype, length);
+
/* Form fields */
if ( (length > 0) && (strlen(cbtype) == 0) ) {
u = (struct urlcontent *) malloc(sizeof(struct urlcontent));
/*
- * If this isn't a GroupDAV session, it's an ordinary browser
- * connecting to the user interface. Only allow GET and POST
- * methods.
+ * Automatically send requests with any method other than GET or
+ * POST to the GroupDAV code as well.
*/
if ((strcasecmp(method, "GET")) && (strcasecmp(method, "POST"))) {
- wprintf("HTTP/1.1 405 Method Not Allowed\r\n");
- groupdav_common_headers();
- wprintf("Content-Length: 0\r\n\r\n");
+ groupdav_main(req, ContentType, /* do GroupDAV methods */
+ ContentLength, content+body_start);
+ if (!WC->logged_in) {
+ WC->killthis = 1; /* If not logged in, don't */
+ } /* keep the session active */
goto SKIP_ALL_THIS_CRAP;
}
} else if (!strcasecmp(action, "ungoto")) {
ungoto();
} else if (!strcasecmp(action, "dotgoto")) {
- slrp_highest();
+ if (WC->wc_view != VIEW_MAILBOX) { /* dotgoto acts like dotskip when we're in a mailbox view */
+ slrp_highest();
+ }
smart_goto(bstr("room"));
} else if (!strcasecmp(action, "dotskip")) {
smart_goto(bstr("room"));
} else if (!strcasecmp(action, "editpic")) {
do_graphics_upload("UIMG 1|_userpic_");
} else if (!strcasecmp(action, "display_editroompic")) {
- display_graphics_upload("the graphic for this room",
+ display_graphics_upload("the icon for this room",
"UIMG 0|_roompic_",
"/editroompic");
} else if (!strcasecmp(action, "editroompic")) {
} else if (!strcasecmp(action, "display_editfloorpic")) {
sprintf(buf, "UIMG 0|_floorpic_|%s",
bstr("which_floor"));
- display_graphics_upload("the graphic for this floor",
+ display_graphics_upload("the icon for this floor",
buf,
"/editfloorpic");
} else if (!strcasecmp(action, "editfloorpic")) {
save_inetconf();
} else if (!strcasecmp(action, "setup_wizard")) {
do_setup_wizard();
+ } else if (!strcasecmp(action, "display_preferences")) {
+ display_preferences();
+ } else if (!strcasecmp(action, "set_preferences")) {
+ set_preferences();
} else if (!strcasecmp(action, "diagnostics")) {
output_headers(1, 1, 1, 0, 0, 0, 0);