diff --git a/src/elogd.c b/src/elogd.c index aad0ac71..c39dbcfb 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.653 2005/05/10 07:17:48 ritt + Store list mode in cookie + Revision 1.652 2005/05/09 11:08:36 ritt Fixed compiler warning @@ -6546,7 +6549,7 @@ and attr_flags arrays */ /*------------------------------------------------------------------*/ -void show_http_header(BOOL expires) +void show_http_header(LOGBOOK *lbs, BOOL expires, char *cookie) { char str[256]; @@ -6558,6 +6561,21 @@ void show_http_header(BOOL expires) else rsprintf("Content-Type: text/html;charset=%s\r\n", DEFAULT_HTTP_CHARSET); + if (cookie && cookie[0]) { + rsprintf("Set-Cookie: %s;", cookie); + + if (getcfg(lbs->name, "URL", str, sizeof(str))) { + extract_path(str); + url_encode(str, sizeof(str)); + if (str[0]) + rsprintf(" path=/%s/%s;", str, lbs->name_enc); + else + rsprintf(" path=/%s;", lbs->name_enc); + } else + rsprintf(" path=/%s;", lbs->name_enc); + rsprintf("\r\n"); + } + if (use_keepalive) { rsprintf("Connection: Keep-Alive\r\n"); rsprintf("Keep-Alive: timeout=60, max=10\r\n"); @@ -6592,11 +6610,11 @@ void show_plain_header(int size, char *file_name) rsprintf("\r\n"); } -void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, BOOL rss_feed) +void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, BOOL rss_feed, char *cookie) { char css[256], str[256]; - show_http_header(expires); + show_http_header(lbs, expires, cookie); /* DOCTYPE */ rsprintf("\n"); @@ -6628,9 +6646,9 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, rsprintf("\n"); } -void show_standard_header(LOGBOOK * lbs, BOOL expires, char *title, char *path, BOOL rss_feed) +void show_standard_header(LOGBOOK * lbs, BOOL expires, char *title, char *path, BOOL rss_feed, char *cookie) { - show_html_header(lbs, expires, title, TRUE, rss_feed); + show_html_header(lbs, expires, title, TRUE, rss_feed, cookie); rsprintf("
\n"); @@ -6648,7 +6666,7 @@ void show_upgrade_page(LOGBOOK * lbs) { char str[1000]; - show_html_header(lbs, FALSE, "ELOG Upgrade Information", TRUE, FALSE); + show_html_header(lbs, FALSE, "ELOG Upgrade Information", TRUE, FALSE, NULL); rsprintf("\n"); @@ -7160,7 +7178,7 @@ void show_bottom_text(LOGBOOK * lbs) void show_error(char *error) { /* header */ - show_html_header(NULL, FALSE, "ELOG error", TRUE, FALSE); + show_html_header(NULL, FALSE, "ELOG error", TRUE, FALSE, NULL); rsprintf("