From f64de0dc8b47e7a5eb63b79f87ecb0658918a029 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 20 Jan 2011 08:39:00 +0000 Subject: [PATCH] Fixed bug with importing CSV files containing text body SVN revision: 2360 --- src/elogd.c | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index b1803f81..bac9c3d1 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -14375,6 +14375,16 @@ void csv_import(LOGBOOK * lbs, const char *csv, const char *csvfile) show_error(str); } + /* check if text column is present */ + if (first && isparam("filltext") && atoi(getparam("filltext"))) { + for (i = 0; i < n; i++) + if (strieq(list + i * NAME_LENGTH, loc("text"))) { + filltext = TRUE; + textcol = i; + break; + } + } + /* ignore first line */ if (first && !isparam("notignore")) { first = FALSE; @@ -14405,16 +14415,6 @@ void csv_import(LOGBOOK * lbs, const char *csv, const char *csvfile) } } - /* check if text column is present */ - if (first && isparam("filltext") && atoi(getparam("filltext"))) { - for (i = 0; i < n; i++) - if (strieq(list + i * NAME_LENGTH, loc("text"))) { - filltext = TRUE; - textcol = i; - break; - } - } - /* derive attributes from first line */ if (first && isparam("head")) { @@ -26410,28 +26410,6 @@ void interprete(char *lbook, char *path) return; } - /* authorize via negotiation */ - /* - rsprintf("HTTP/1.1 401 Authorization Required\r\n"); - rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision + 13)); - rsprintf("WWW-Authenticate: NegotiateBasic realm=\"%s\"\r\n", lbs->name); - //rsprintf("WWW-Authenticate: Negotiate\r\n"); - rsprintf("Connection: close\r\n"); - rsprintf("Content-Type: text/html\r\n\r\n"); - rsprintf("\r\n"); - rsprintf("401 Authorization Required\r\n"); - rsprintf("\r\n"); - rsprintf("

Authorization Required

\r\n"); - rsprintf("This server could not verify that you\r\n"); - rsprintf("are authorized to access the document\r\n"); - rsprintf("requested. Either you supplied the wrong\r\n"); - rsprintf("credentials (e.g., bad password), or your\r\n"); - rsprintf("browser doesn't understand how to supply\r\n"); - rsprintf("the credentials required.

\r\n"); - rsprintf("\r\n"); - return; - */ - /* check for correct session ID */ if (!check_login(lbs, getparam("sid"))) return;