Version 2.6.0

SVN revision: 1548
This commit is contained in:
Stefan Ritt 2005-12-14 21:35:18 +00:00
parent 9a3517df45
commit d2d4e32d69
16 changed files with 375 additions and 233 deletions

View File

@ -1,3 +1,95 @@
Version 2.6.0, released Dec 14th, 2005
======================================
- Major new feature: Implemented ELCode tags
- Improved error handling of uploaded images
- Implemented first version of inline images in email notification
- Removed "nowrap" from attribute display in edit form
- Fixed crash on password reminder with invalid SMTP server
- Implemented absolute redirection via URL statement in logbook selection page
- Implemented proper time zone handling when sorting entries
- Show last page in list display per default if reverse sort is off
- Implemented logging level 4
- Removed help/language files from main directory and put them in resources directory
- Renamed help and language files
- Added time zone to elog entry
- Fixed problem with search highlighting and ELCode
- Fixed problem with [URL="file://...]
- Removed fixed text size in class "messagepre"
- Implemented escape character for http://, mailto:, etc.
- Added darwin specific changed from Exaos Lee
- Added Chinese language files
- Mode cookies expire after ten years
- Fixed problem with 'POST' in search text
- Modifications made on flight CA931
- Added '\' escape for smileys
- Implemented show/hide attachments in full view
- Limit summary lines to 150 characters in threaded mode
- Fixed infinite redirection with ?fail=1
- Fixed problem with extendable attributes which are fixed during edit
- Fixed bug with subtext quick filter
- Show HTML logbook comment properly
- Implemented 'Subtext' quick filter
- Fixed problem with long subjects by splitting it into separate encoded words
- Fixed login problem with protected selection pages and top groups
- Do not distinguish between invalid user name and invalid password for security reasons
- Added error output if password file cannot be written
- Implemented 'Email Format = 64' for only attachment names
- Implemented 'resolve host names'
- Added icons for 'show new/all'
- Added 'filter menu text'
- Added validity check for year in date/time attributes
- Added 'Edit page title'
- Added 'reply comment'
- Changed 'summary page title' to 'list page title'
- Changed 'rss feed' to 'alternate'
- Added $elogbook
- Made elog: links abolute for email notification
- Implemented 'change <attrib>' and 'list change <attrib>'
- Applied pointer casting patch from Recai
- Fixed {n} display with ROptions
- Added condition evaluation in list display
- Replaced tcp_hostname by listen_interface
- Added line break for thread display
- Made conditional attributes also work for email notification
- Implemented conditional attributes also for display
- Made 'list' work together with 'start page = 0?cmd=Last'
- Do not interprete ELCode inside [code]...[/code]
- Removed 'host:' for HTML/1.0
- Added 'email attributes' option
- Added '\' as escape character for HTML and ELCode tags
- Added 'title' to all icons for FireFox
- Treat attributes with <img> as HTML
- Added 'suppress default = 3'
- Added tooltip to logbook selection bar
- Added 'default encoding'
- Converted links to absolute URLs for threads
- 'Show all entries' keeps parameters from original search
- Put absolute link for CSS
- Added image insertion by JScript
- Added [*] for LIST
- Changed 'find menu' to 'list menu'
- Fixed bug with user activation and global password files
- Fixed problem with reverse sort in quick filters
- Applied patch from Emiliano with strftime workaround
- Use absolute http:// links for smileys
- Implemented last_activity, HTML email
- Switched login page to POST method
- Only use letters in randomly generated recovery password
- Fixed 'pippo-bug' of 'list display' option
- Fixed problem that encoding could not be selected on new entries
- Use orig_author for reply quoting
- Changed default font
- Remove hard wraps for textarea in non-plain mode
- Added smpt username
- Changed 'set current time' to 'insert current time'
- Added confimation dialog for removing users
- Supersede 'Display mode' by cookie
- Store list mode in cookie
- Change '(' to '\(' in quick filters for regex matching
Version 2.5.9, released May 2nd, 2005 Version 2.5.9, released May 2nd, 2005
===================================== =====================================

View File

@ -2,7 +2,6 @@
<HEAD> <HEAD>
<TITLE>ELOG - Syntax of elogd.cfg</TITLE> <TITLE>ELOG - Syntax of elogd.cfg</TITLE>
<LINK REV="made" HREF="mailto:fredpmygale.org"> <LINK REV="made" HREF="mailto:fredpmygale.org">
<META NAME="generator" CONTENT="NoteTab Light 4.86c">
<META NAME="author" CONTENT="Fred Pacquier"> <META NAME="author" CONTENT="Fred Pacquier">
<META NAME="description" CONTENT="Home of the Electronic Logbook (ELOG) package"> <META NAME="description" CONTENT="Home of the Electronic Logbook (ELOG) package">
<META NAME="keywords" CONTENT="ELOG MIDAS PSI RITT"> <META NAME="keywords" CONTENT="ELOG MIDAS PSI RITT">
@ -1791,8 +1790,8 @@ flags:<br>
</ul> </ul>
So to send email in plain text and full HTML, set &lt;n&gt; So to send email in plain text and full HTML, set &lt;n&gt;
to <b>5</b>. Most email clients have the possibility then to switch from one view to <b>5</b>. Some email clients have the possibility then to switch from one view
to the other. Default is <b>2</b> (send everything). to the other. Default is <b>2</b>.
<p> <p>
<li><b><code>Back to main = 0|1</code></b> <li><b><code>Back to main = 0|1</code></b>

View File

@ -25,7 +25,7 @@
&nbsp;[<a class="nav" href="#links">Links</a>]&nbsp; *&nbsp;</div> &nbsp;[<a class="nav" href="#links">Links</a>]&nbsp; *&nbsp;</div>
<P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt&#64;psi.ch"> <P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt&#64;psi.ch">
Stefan Ritt</a></P> Stefan Ritt</a></P>
<div class="version">Current version is : 2.5.9</div> <div class="version">Current version is : 2.6.0</div>
<hr> <hr>
<a name="whatis"> <a name="whatis">
<div class="section">&nbsp; What is ELOG ? &nbsp;</div> <div class="section">&nbsp; What is ELOG ? &nbsp;</div>

View File

@ -400,3 +400,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -402,3 +402,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -401,3 +401,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -403,3 +403,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -400,3 +400,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -337,11 +337,6 @@ Please enter minute for attribute '%s' = Bitte Minute eingeben f
Please enter second for attribute '%s' = Bitte Sekunde eingeben für Attribut '%s' Please enter second for attribute '%s' = Bitte Sekunde eingeben für Attribut '%s'
No admin user has been defined in configuration file = In der Konfigurationsdatei ist kein Benutzer mit Administrationsrechten eingetragen No admin user has been defined in configuration file = In der Konfigurationsdatei ist kein Benutzer mit Administrationsrechten eingetragen
Duplicate = Duplizieren Duplicate = Duplizieren
#
#---- please translate following items and then remove this comment ----#
#
Cannot lookup server name = Kann Server Name nicht finden Cannot lookup server name = Kann Server Name nicht finden
Cannot connect to server = Kann mit Server nicht verbinden Cannot connect to server = Kann mit Server nicht verbinden
%s wrote = %s schrieb %s wrote = %s schrieb
@ -400,3 +395,5 @@ Enter name of hyperlink = Name von Hyperlink eingeben
Enter URL of hyperlink = URL von Hyperlink eingeben Enter URL of hyperlink = URL von Hyperlink eingeben
astonished = erstaunt astonished = erstaunt
Error in regular expression "%s" = Fehler in regulärem Ausdruck "%s" Error in regular expression "%s" = Fehler in regulärem Ausdruck "%s"
File not found at URL "%s" = Datei bei URL "%s" nicht gefunden

View File

@ -398,3 +398,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -398,3 +398,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -400,3 +400,4 @@ Cannot retrieve file from URL "%s" = No puedo obtener el archivo desde la URL "%
# #
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -399,3 +399,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -399,3 +399,4 @@ Enter name of hyperlink =
Enter URL of hyperlink = Enter URL of hyperlink =
astonished = astonished =
Error in regular expression "%s" = Error in regular expression "%s" =
File not found at URL "%s" =

View File

@ -10,7 +10,7 @@
\********************************************************************/ \********************************************************************/
/* Version of ELOG */ /* Version of ELOG */
#define VERSION "2.6.0-beta5" #define VERSION "2.6.0"
char svn_revision[] = "$Id$"; char svn_revision[] = "$Id$";
/* ELOG identification */ /* ELOG identification */
@ -956,11 +956,11 @@ void strsubst(char *string, int size, char *pattern, char *subst)
memcpy(p, subst, strlen(subst)); memcpy(p, subst, strlen(subst));
} else if (strlen(pattern) > strlen(subst)) { } else if (strlen(pattern) > strlen(subst)) {
memcpy(p, subst, strlen(subst)); memcpy(p, subst, strlen(subst));
strcpy(p+strlen(subst), p+strlen(pattern)); strcpy(p + strlen(subst), p + strlen(pattern));
} else { } else {
tail = xmalloc(strlen(p)-strlen(pattern)+1); tail = xmalloc(strlen(p) - strlen(pattern) + 1);
strcpy(tail, p+strlen(pattern)); strcpy(tail, p + strlen(pattern));
s = size - ((int)p - (int)string); s = size - ((int) p - (int) string);
strlcpy(p, subst, s); strlcpy(p, subst, s);
strlcat(p, tail, s); strlcat(p, tail, s);
xfree(tail); xfree(tail);
@ -1151,7 +1151,7 @@ void base64_encode(unsigned char *s, unsigned char *d)
{ {
unsigned int t, pad; unsigned int t, pad;
pad = 3 - strlen((char *)s) % 3; pad = 3 - strlen((char *) s) % 3;
if (pad == 3) if (pad == 3)
pad = 0; pad = 0;
while (*s) { while (*s) {
@ -1612,10 +1612,13 @@ void compose_email_header(LOGBOOK * lbs, char *subject, char *from, char *to,
struct tm *ts; struct tm *ts;
i = 0; i = 0;
if (mail_encoding & 1) i++; if (mail_encoding & 1)
if (mail_encoding & 2) i++; i++;
if (mail_encoding & 4) i++; if (mail_encoding & 2)
multipart = i>1; i++;
if (mail_encoding & 4)
i++;
multipart = i > 1;
if (!getcfg("global", "charset", charset, sizeof(charset))) if (!getcfg("global", "charset", charset, sizeof(charset)))
strcpy(charset, DEFAULT_HTTP_CHARSET); strcpy(charset, DEFAULT_HTTP_CHARSET);
@ -1633,8 +1636,8 @@ void compose_email_header(LOGBOOK * lbs, char *subject, char *from, char *to,
sprintf(str, "timezone: %d, offset: %d\n", (int) timezone, (int) offset); sprintf(str, "timezone: %d, offset: %d\n", (int) timezone, (int) offset);
efputs(str); efputs(str);
} }
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "Date: %s %+03d%02d\r\n", buf, (int) (offset / 3600), snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "Date: %s %+03d%02d\r\n", buf,
(int) ((abs((int) offset) / 60) % 60)); (int) (offset / 3600), (int) ((abs((int) offset) / 60) % 60));
getcfg("global", "Language", str, sizeof(str)); getcfg("global", "Language", str, sizeof(str));
if (str[0]) if (str[0])
@ -1644,30 +1647,30 @@ void compose_email_header(LOGBOOK * lbs, char *subject, char *from, char *to,
strlcat(mail_text, to, size); strlcat(mail_text, to, size);
strlcat(mail_text, "\r\n", size); strlcat(mail_text, "\r\n", size);
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "From: %s\r\n", from); snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "From: %s\r\n", from);
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "User-Agent: Elog Version %s\r\n", VERSION); snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "User-Agent: Elog Version %s\r\n",
VERSION);
if (multipart) if (multipart)
strlcat(mail_text, "MIME-Version: 1.0\r\n", size); strlcat(mail_text, "MIME-Version: 1.0\r\n", size);
memset(subject_enc, 0, sizeof(subject_enc)); memset(subject_enc, 0, sizeof(subject_enc));
for (i=0 ; i<(int)strlen(subject) ; i++) for (i = 0; i < (int) strlen(subject); i++)
if (subject[i] > 127) if (subject[i] > 127)
break; break;
if (i<(int)strlen(subject)) { if (i < (int) strlen(subject)) {
/* subject contains local characters, so encode it using charset */ /* subject contains local characters, so encode it using charset */
for (i=0 ; i<(int)strlen(subject) ; i+=40) { for (i = 0; i < (int) strlen(subject); i += 40) {
strlcpy(buffer, subject+i, sizeof(buffer)); strlcpy(buffer, subject + i, sizeof(buffer));
buffer[40] = 0; buffer[40] = 0;
strlcat(subject_enc, "=?", sizeof(subject_enc)); strlcat(subject_enc, "=?", sizeof(subject_enc));
strlcat(subject_enc, charset, sizeof(subject_enc)); strlcat(subject_enc, charset, sizeof(subject_enc));
strlcat(subject_enc, "?B?", sizeof(subject_enc)); strlcat(subject_enc, "?B?", sizeof(subject_enc));
base64_encode((unsigned char *) buffer, base64_encode((unsigned char *) buffer, (unsigned char *) (subject_enc + strlen(subject_enc)));
(unsigned char *) (subject_enc + strlen(subject_enc)));
strlcat(subject_enc, "?=", sizeof(subject_enc)); strlcat(subject_enc, "?=", sizeof(subject_enc));
if (strlen(subject+i) < 40) if (strlen(subject + i) < 40)
break; break;
strlcat(subject_enc, "\r\n ", sizeof(subject_enc)); // another encoded-word strlcat(subject_enc, "\r\n ", sizeof(subject_enc)); // another encoded-word
@ -1675,24 +1678,24 @@ void compose_email_header(LOGBOOK * lbs, char *subject, char *from, char *to,
} else } else
strlcpy(subject_enc, subject, sizeof(subject_enc)); strlcpy(subject_enc, subject, sizeof(subject_enc));
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "Subject: %s\r\n", subject_enc); snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "Subject: %s\r\n", subject_enc);
if (url) if (url)
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "X-Elog-URL: %s\r\n", url); snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "X-Elog-URL: %s\r\n", url);
strlcat(mail_text, "X-Elog-submit-type: web|elog\r\n", size); strlcat(mail_text, "X-Elog-submit-type: web|elog\r\n", size);
if (multipart) { if (multipart) {
sprintf(multipart_boundary, "------------%04X%04X%04X", rand(), rand(), rand()); sprintf(multipart_boundary, "------------%04X%04X%04X", rand(), rand(), rand());
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: multipart/alternative;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary); "Content-Type: multipart/alternative;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary);
strlcat(mail_text, "This is a multi-part message in MIME format.\r\n", size); strlcat(mail_text, "This is a multi-part message in MIME format.\r\n", size);
} else { } else {
if (n_attachments) { if (n_attachments) {
sprintf(multipart_boundary, "------------%04X%04X%04X", rand(), rand(), rand()); sprintf(multipart_boundary, "------------%04X%04X%04X", rand(), rand(), rand());
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: multipart/mixed;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary); "Content-Type: multipart/mixed;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary);
strlcat(mail_text, "This is a multi-part message in MIME format.\r\n", size); strlcat(mail_text, "This is a multi-part message in MIME format.\r\n", size);
@ -1717,8 +1720,7 @@ int check_smtp_error(char *str, int expected, char *error, int error_size)
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, char *text, char *error, int error_size)
char *text, char *error, int error_size)
{ {
struct sockaddr_in bind_addr; struct sockaddr_in bind_addr;
struct hostent *phe; struct hostent *phe;
@ -1953,10 +1955,14 @@ void split_url(char *url, char *host, int *port, char *subdir, char *param)
{ {
char *p, str[256]; char *p, str[256];
if (host) host[0] = 0; if (host)
if (port) *port = 80; host[0] = 0;
if (subdir) subdir[0] = 0; if (port)
if (param) param[0] = 0; *port = 80;
if (subdir)
subdir[0] = 0;
if (param)
param[0] = 0;
p = url; p = url;
if (strncmp(url, "http://", 7) == 0) if (strncmp(url, "http://", 7) == 0)
@ -2241,7 +2247,7 @@ void set_condition(char *c)
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
void evaluate_conditions(LOGBOOK *lbs, char attrib[MAX_N_ATTR][NAME_LENGTH]) void evaluate_conditions(LOGBOOK * lbs, char attrib[MAX_N_ATTR][NAME_LENGTH])
{ {
char condition[256], str[256]; char condition[256], str[256];
int index, i; int index, i;
@ -2899,8 +2905,8 @@ time_t date_to_ltime(char *date)
ltime = mktime(&tms); ltime = mktime(&tms);
/* correct for difference between local time zone (used by mktime) and time zone of date */ /* correct for difference between local time zone (used by mktime) and time zone of date */
date_zone = atoi(date+26); date_zone = atoi(date + 26);
date_zone = (abs(date_zone) % 100)*60 + (date_zone)/100*3600; date_zone = (abs(date_zone) % 100) * 60 + (date_zone) / 100 * 3600;
tzset(); tzset();
local_zone = timezone; local_zone = timezone;
@ -4718,7 +4724,7 @@ void write_logfile(LOGBOOK * lbs, const char *text)
if (lbs) if (lbs)
sprintf(buf + strlen(buf), "{%s} ", lbs->name); sprintf(buf + strlen(buf), "{%s} ", lbs->name);
strlcat(buf, text, sizeof(buf)-1); strlcat(buf, text, sizeof(buf) - 1);
if (buf[strlen(buf) - 1] != '\n') if (buf[strlen(buf) - 1] != '\n')
strlcat(buf, "\n", sizeof(buf)); strlcat(buf, "\n", sizeof(buf));
@ -4775,9 +4781,9 @@ int is_html(char *s)
str[i] = toupper(s[i]); str[i] = toupper(s[i]);
str[i] = 0; str[i] = 0;
for (i=0 ; html_tags[i][0] ; i++) { for (i = 0; html_tags[i][0]; i++) {
p = strstr(str, html_tags[i]); p = strstr(str, html_tags[i]);
if (p && strchr(p, '>') && (p == str || (p > str && *(p-1) != '\\'))) { if (p && strchr(p, '>') && (p == str || (p > str && *(p - 1) != '\\'))) {
xfree(str); xfree(str);
return TRUE; return TRUE;
} }
@ -4890,7 +4896,7 @@ void rsputs(const char *str)
char *key_list[] = { "http://", "https://", "ftp://", "mailto:", "elog:", "file://", "" }; char *key_list[] = { "http://", "https://", "ftp://", "mailto:", "elog:", "file://", "" };
void rsputs2(LOGBOOK *lbs, const char *str) void rsputs2(LOGBOOK * lbs, const char *str)
{ {
int i, j, k, l, m, n; int i, j, k, l, m, n;
char *p, *pd, link[1000], link_text[1000], tmp[1000], base_url[256]; char *p, *pd, link[1000], link_text[1000], tmp[1000], base_url[256];
@ -5042,7 +5048,7 @@ void rsputs2(LOGBOOK *lbs, const char *str)
/* suppress escape character '\' in front of HTML or ELCode tag */ /* suppress escape character '\' in front of HTML or ELCode tag */
case '\\': case '\\':
if (str[i+1] != '<' && str[i+1] != '[') if (str[i + 1] != '<' && str[i + 1] != '[')
return_buffer[j++] = str[i]; return_buffer[j++] = str[i];
break; break;
@ -5186,7 +5192,8 @@ PATTERN_LIST pattern_list[] = {
{"", ""} {"", ""}
}; };
char *email_quote_table = "<table width=100%% border=1 align=\"left\" cellpadding=3><tr><td bgcolor=#486090><font color=white>%s:</font></td></tr><tr><td bgcolor=#FFFFB0>"; char *email_quote_table =
"<table width=100%% border=1 align=\"left\" cellpadding=3><tr><td bgcolor=#486090><font color=white>%s:</font></td></tr><tr><td bgcolor=#FFFFB0>";
void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str)
{ {
@ -5420,9 +5427,9 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str)
retrieve_email_from(lbs, link, NULL, NULL); retrieve_email_from(lbs, link, NULL, NULL);
p = strchr(attrib, '/'); p = strchr(attrib, '/');
if (p) if (p)
m = atoi(p+1)-1; m = atoi(p + 1) - 1;
if (strchr(link, '@')) if (strchr(link, '@'))
p = strchr(link, '@')+1; p = strchr(link, '@') + 1;
else else
p = link; p = link;
sprintf(hattrib, "cid:att%d@%s", m, p); sprintf(hattrib, "cid:att%d@%s", m, p);
@ -5430,13 +5437,13 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str)
compose_base_url(lbs, hattrib, sizeof(hattrib)); compose_base_url(lbs, hattrib, sizeof(hattrib));
if (attrib[5] == '/') { if (attrib[5] == '/') {
if (_current_message_id == 0) { if (_current_message_id == 0) {
sprintf(param, "attachment%d", atoi(attrib + 6)-1); sprintf(param, "attachment%d", atoi(attrib + 6) - 1);
if (isparam(param)) if (isparam(param))
strlcat(hattrib, getparam(param), sizeof(hattrib)); strlcat(hattrib, getparam(param), sizeof(hattrib));
} else } else
sprintf(hattrib+strlen(hattrib), "%d%s", _current_message_id, attrib + 5); sprintf(hattrib + strlen(hattrib), "%d%s", _current_message_id, attrib + 5);
} else { } else {
strlcat(hattrib, attrib+5, sizeof(hattrib)); strlcat(hattrib, attrib + 5, sizeof(hattrib));
} }
} }
} }
@ -5779,9 +5786,9 @@ void compose_base_url(LOGBOOK * lbs, char *base_url, int size)
strcpy(base_url, "http://"); strcpy(base_url, "http://");
if (elog_tcp_port == 80) if (elog_tcp_port == 80)
sprintf(base_url+strlen(base_url), "%s/", host_name); sprintf(base_url + strlen(base_url), "%s/", host_name);
else else
sprintf(base_url+strlen(base_url), "%s:%d/", host_name, elog_tcp_port); sprintf(base_url + strlen(base_url), "%s:%d/", host_name, elog_tcp_port);
if (lbs) { if (lbs) {
strlcat(base_url, lbs->name_enc, size); strlcat(base_url, lbs->name_enc, size);
strlcat(base_url, "/", size); strlcat(base_url, "/", size);
@ -6883,7 +6890,7 @@ void set_login_cookies(LOGBOOK * lbs, char *user, char *enc_pwd)
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void remove_all_login_cookies(LOGBOOK *lbs) void remove_all_login_cookies(LOGBOOK * lbs)
{ {
int i; int i;
@ -7383,11 +7390,11 @@ auto-increment tags */
return; return;
/* record location and length of ###'s */ /* record location and length of ###'s */
for (i=loc=0,len=1 ; i<(int)strlen(retstr) ; i++) { for (i = loc = 0, len = 1; i < (int) strlen(retstr); i++) {
if (retstr[i] == '#') { if (retstr[i] == '#') {
if (loc == 0) if (loc == 0)
loc = i; loc = i;
if (i>0 && retstr[i-1] == '#') if (i > 0 && retstr[i - 1] == '#')
len++; len++;
} }
} }
@ -7398,7 +7405,7 @@ auto-increment tags */
if (!message_id) { if (!message_id) {
/* start with 1 */ /* start with 1 */
sprintf(retstr+loc, "%0*d", len, 1); sprintf(retstr + loc, "%0*d", len, 1);
return; return;
} }
@ -7409,10 +7416,10 @@ auto-increment tags */
old_index = 0; old_index = 0;
else else
/* retrieve old index */ /* retrieve old index */
old_index = atoi(attrib[index]+loc); old_index = atoi(attrib[index] + loc);
/* increment index */ /* increment index */
sprintf(retstr+loc, "%0*d", len, old_index+1); sprintf(retstr + loc, "%0*d", len, old_index + 1);
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
@ -8738,7 +8745,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
attr_options[index][i], attr_options[index][i], attr_options[index][i]); attr_options[index][i], attr_options[index][i], attr_options[index][i]);
rsprintf("</td>\n"); rsprintf("</td>\n");
if ((format_flags[index] & AFF_MULTI_LINE) && attr_options[index][i+1][0]) { if ((format_flags[index] & AFF_MULTI_LINE) && attr_options[index][i + 1][0]) {
rsprintf("</tr><tr>\n"); rsprintf("</tr><tr>\n");
} }
} }
@ -9235,7 +9242,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution")); rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution"));
} else if (atoi(str) == 1) { } else if (atoi(str) == 1) {
rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n"); rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n");
rsprintf("<input type=\"checkbox\" checked name=\"shell_suppress\" id=\"shell_suppress\" value=1>"); rsprintf
("<input type=\"checkbox\" checked name=\"shell_suppress\" id=\"shell_suppress\" value=1>");
rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution")); rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution"));
} }
} else { } else {
@ -9253,7 +9261,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution")); rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution"));
} else if (atoi(str) == 1) { } else if (atoi(str) == 1) {
rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n"); rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n");
rsprintf("<input type=\"checkbox\" checked name=\"shell_suppress\" id=\"shell_suppress\" value=1>"); rsprintf
("<input type=\"checkbox\" checked name=\"shell_suppress\" id=\"shell_suppress\" value=1>");
rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution")); rsprintf("<label for=\"shell_suppress\">%s</label>\n", loc("Suppress shell execution"));
} }
} else { } else {
@ -10508,8 +10517,8 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
retrieve_email_from(lbs, mail_from, mail_from_name, NULL); retrieve_email_from(lbs, mail_from, mail_from_name, NULL);
if (activate) { if (activate) {
compose_email_header(lbs, loc("Your ELOG account has been activated"), mail_from_name, getparam("new_user_email"), compose_email_header(lbs, loc("Your ELOG account has been activated"), mail_from_name,
NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL); getparam("new_user_email"), NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL);
sprintf(mail_text, loc("Your ELOG account has been activated on host")); sprintf(mail_text, loc("Your ELOG account has been activated on host"));
sprintf(mail_text + strlen(mail_text), " %s", host_name); sprintf(mail_text + strlen(mail_text), " %s", host_name);
@ -12477,7 +12486,7 @@ int receive_message(LOGBOOK * lbs, char *url, int message_id, char *error_str, B
return -1; return -1;
} }
p += 4; p += 4;
header_size = (int)p - (int)message; header_size = (int) p - (int) message;
el_submit_attachment(lbs, attachment[i], p, size - header_size, NULL); el_submit_attachment(lbs, attachment[i], p, size - header_size, NULL);
xfree(message); xfree(message);
@ -13885,7 +13894,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
_current_message_id = message_id; _current_message_id = message_id;
compose_base_url(NULL, ref, sizeof(ref)); compose_base_url(NULL, ref, sizeof(ref));
sprintf(ref+strlen(ref), "%s/%d", lbs->name_enc, message_id); sprintf(ref + strlen(ref), "%s/%d", lbs->name_enc, message_id);
if (strieq(mode, "Summary")) { if (strieq(mode, "Summary")) {
if (number % 2 == 1) if (number % 2 == 1)
@ -13954,13 +13963,16 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
rsprintf("\n<a href=\"%s\">", ref); rsprintf("\n<a href=\"%s\">", ref);
if (attr_icon[0]) if (attr_icon[0])
rsprintf("\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">\n&nbsp;", attr_icon, attr_icon, attr_icon); rsprintf("\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">\n&nbsp;", attr_icon, attr_icon,
attr_icon);
else { else {
/* display standard icons */ /* display standard icons */
if (level == 0) if (level == 0)
rsprintf("\n<img border=0 src=\"entry.png\" alt=\"%s\" title=\"%s\">\n&nbsp;", loc("Entry"), loc("Entry")); rsprintf("\n<img border=0 src=\"entry.png\" alt=\"%s\" title=\"%s\">\n&nbsp;", loc("Entry"),
loc("Entry"));
else else
rsprintf("\n<img border=0 src=\"reply.png\" alt=\"%s\" title=\"%s\">\n&nbsp;", loc("Reply"), loc("Reply")); rsprintf("\n<img border=0 src=\"reply.png\" alt=\"%s\" title=\"%s\">\n&nbsp;", loc("Reply"),
loc("Reply"));
} }
if (highlight != message_id) if (highlight != message_id)
rsprintf("</a>\n"); rsprintf("</a>\n");
@ -13971,7 +13983,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
"entry time", date, &j); "entry time", date, &j);
strsubst_list(display, sizeof(display), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, j); strsubst_list(display, sizeof(display), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
j);
if (highlight != message_id) if (highlight != message_id)
rsprintf("\n<a href=\"%s\">\n", ref); rsprintf("\n<a href=\"%s\">\n", ref);
@ -14012,9 +14025,11 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
if (strieq(disp_attr[index], loc("ID"))) { if (strieq(disp_attr[index], loc("ID"))) {
if (strieq(mode, "Threaded")) { if (strieq(mode, "Threaded")) {
if (level == 0) if (level == 0)
rsprintf("\n<img border=0 src=\"entry.png\" alt=\"%s\" title=\"%s\">&nbsp;", loc("Entry"), loc("Entry")); rsprintf("\n<img border=0 src=\"entry.png\" alt=\"%s\" title=\"%s\">&nbsp;", loc("Entry"),
loc("Entry"));
else else
rsprintf("\n<img border=0 src=\"reply.png\" alt=\"%s\" title=\"%s\">&nbsp;", loc("Reply"), loc("Reply")); rsprintf("\n<img border=0 src=\"reply.png\" alt=\"%s\" title=\"%s\">&nbsp;", loc("Reply"),
loc("Reply"));
} else { } else {
rsprintf("<td class=\"%s\">", sclass); rsprintf("<td class=\"%s\">", sclass);
@ -14063,14 +14078,16 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
if (strieq(disp_attr[index], loc("Edit"))) { if (strieq(disp_attr[index], loc("Edit"))) {
if (!strieq(mode, "Threaded")) { if (!strieq(mode, "Threaded")) {
rsprintf("\n<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Edit")); rsprintf("\n<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Edit"));
rsprintf("\n<img src=\"edit.png\" border=0 alt=\"%s\" title=\"%s\"></a></td>\n", loc("Edit entry"), loc("Edit entry")); rsprintf("\n<img src=\"edit.png\" border=0 alt=\"%s\" title=\"%s\"></a></td>\n",
loc("Edit entry"), loc("Edit entry"));
} }
} }
if (strieq(disp_attr[index], loc("Delete"))) { if (strieq(disp_attr[index], loc("Delete"))) {
if (!strieq(mode, "Threaded")) { if (!strieq(mode, "Threaded")) {
rsprintf("\n<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Delete")); rsprintf("\n<td class=\"%s\" %s><a href=\"%s?cmd=%s\">", sclass, nowrap, ref, loc("Delete"));
rsprintf("\n<img src=\"delete.png\" border=0 alt=\"%s\" title=\"%s\"></a></td>\n", loc("Delete entry"), loc("Delete entry")); rsprintf("\n<img src=\"delete.png\" border=0 alt=\"%s\" title=\"%s\"></a></td>\n",
loc("Delete entry"), loc("Delete entry"));
} }
} }
@ -14118,8 +14135,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
else if (attr_flags[i] & AF_ICON) { else if (attr_flags[i] & AF_ICON) {
if (attrib[i][0]) if (attrib[i][0])
rsprintf("&nbsp;\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">&nbsp;", attrib[i], rsprintf("&nbsp;\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">&nbsp;",
attrib[i], attrib[i]); attrib[i], attrib[i], attrib[i]);
} }
else { else {
@ -14182,7 +14199,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
else if (attr_flags[i] & AF_ICON) { else if (attr_flags[i] & AF_ICON) {
rsprintf("<td class=\"%s\">", sclass); rsprintf("<td class=\"%s\">", sclass);
if (attrib[i][0]) if (attrib[i][0])
rsprintf("\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">", attrib[i], attrib[i], attrib[i]); rsprintf("\n<img border=0 src=\"icons/%s\" alt=\"%s\" title=\"%s\">", attrib[i],
attrib[i], attrib[i]);
rsprintf("&nbsp;</td>"); rsprintf("&nbsp;</td>");
} }
@ -14252,7 +14270,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
rsprintf("<tr><td class=\"summary\">"); rsprintf("<tr><td class=\"summary\">");
if (expand == 2) { if (expand == 2) {
for (i = i_line = line_len = 0; i < (int) sizeof(str) - 1; i++,line_len++) { for (i = i_line = line_len = 0; i < (int) sizeof(str) - 1; i++, line_len++) {
str[i] = text[i]; str[i] = text[i];
if (str[i] == '\n') { if (str[i] == '\n') {
i_line++; i_line++;
@ -14299,7 +14317,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
if (strieq(mode, "Summary") && n_line > 0 && show_text) { if (strieq(mode, "Summary") && n_line > 0 && show_text) {
rsprintf("<td class=\"summary\">"); rsprintf("<td class=\"summary\">");
for (i = i_line = line_len = 0; i < (int) sizeof(str) - 1; line_len++,i++) { for (i = i_line = line_len = 0; i < (int) sizeof(str) - 1; line_len++, i++) {
str[i] = text[i]; str[i] = text[i];
if (str[i] == '\n') { if (str[i] == '\n') {
i_line++; i_line++;
@ -14395,7 +14413,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
if (show_attachments) { if (show_attachments) {
rsprintf("<tr><td colspan=%d class=\"attachmentframe\">\n", colspan); rsprintf("<tr><td colspan=%d class=\"attachmentframe\">\n", colspan);
rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref); rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref);
rsprintf("<img src=\"%s.thumb\" alt=\"%s\" title=\"%s\"></a>\n", ref, attachment[index] + 14, attachment[index] + 14); rsprintf("<img src=\"%s.thumb\" alt=\"%s\" title=\"%s\"></a>\n", ref,
attachment[index] + 14, attachment[index] + 14);
rsprintf("</td></tr>\n\n"); rsprintf("</td></tr>\n\n");
} }
} else { } else {
@ -14406,7 +14425,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
if (show_attachments) { if (show_attachments) {
rsprintf("</td></tr><tr>"); rsprintf("</td></tr><tr>");
rsprintf("<td colspan=%d class=\"attachmentframe\">", colspan); rsprintf("<td colspan=%d class=\"attachmentframe\">", colspan);
rsprintf("<img src=\"%s\" alt=\"%s\" title=\"%s\">", ref, attachment[index] + 14, attachment[index] + 14); rsprintf("<img src=\"%s\" alt=\"%s\" title=\"%s\">", ref, attachment[index] + 14,
attachment[index] + 14);
rsprintf("</td></tr>\n"); rsprintf("</td></tr>\n");
} }
} else { } else {
@ -15015,11 +15035,13 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
ref[0] = 0; ref[0] = 0;
if (!isparam("new_entries") || atoi(getparam("new_entries")) == 0) { if (!isparam("new_entries") || atoi(getparam("new_entries")) == 0) {
build_ref(ref, sizeof(ref), "", "", "", "1"); build_ref(ref, sizeof(ref), "", "", "", "1");
rsprintf("<a href=\"%s\"><img align=\"middle\" border=\"0\" src=\"new_entry.png\" alt=\"%s\" title=\"%s\"></a>&nbsp;&nbsp;", rsprintf
("<a href=\"%s\"><img align=\"middle\" border=\"0\" src=\"new_entry.png\" alt=\"%s\" title=\"%s\"></a>&nbsp;&nbsp;",
ref, loc("Show only new entries"), loc("Show only new entries")); ref, loc("Show only new entries"), loc("Show only new entries"));
} else { } else {
build_ref(ref, sizeof(ref), "", "", "", "0"); build_ref(ref, sizeof(ref), "", "", "", "0");
rsprintf("<a href=\"%s\"><img align=\"middle\" border=\"0\" src=\"all_entry.png\" alt=\"%s\" title=\"%s\"></a>&nbsp;&nbsp;", rsprintf
("<a href=\"%s\"><img align=\"middle\" border=\"0\" src=\"all_entry.png\" alt=\"%s\" title=\"%s\"></a>&nbsp;&nbsp;",
ref, loc("Show all entries"), loc("Show all entries")); ref, loc("Show all entries"), loc("Show all entries"));
} }
@ -15504,7 +15526,8 @@ void show_rss_feed(LOGBOOK * lbs)
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
"entry time", date, &i); "entry time", date, &i);
strsubst_list(title, sizeof(title), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, i); strsubst_list(title, sizeof(title), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue,
i);
} else { } else {
title[0] = 0; title[0] = 0;
@ -16169,8 +16192,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, BOOL defa
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist,
(char (*)[NAME_LENGTH]) svalue, "entry time", date, &j); (char (*)[NAME_LENGTH]) svalue, "entry time", date, &j);
strsubst_list(str, sizeof(str), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, strsubst_list(str, sizeof(str), (char (*)[NAME_LENGTH]) slist,
j); (char (*)[NAME_LENGTH]) svalue, j);
setparam(attr_list[i], str); setparam(attr_list[i], str);
} }
@ -16326,7 +16349,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, BOOL defa
n_page = atoi(getparam("npp")); n_page = atoi(getparam("npp"));
if (default_page) if (default_page)
page_n = reverse ? 1 : (n_msg - 1)/n_page + 1; page_n = reverse ? 1 : (n_msg - 1) / n_page + 1;
if (page_n != -1) { if (page_n != -1) {
i_start = (page_n - 1) * n_page; i_start = (page_n - 1) * n_page;
@ -16887,7 +16910,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, BOOL defa
if (strcmp(getparam("sort"), disp_attr[i]) == 0) if (strcmp(getparam("sort"), disp_attr[i]) == 0)
sprintf(img, "<img align=top src=\"up.png\" alt=\"%s\" title=\"%s\">", loc("up"), loc("up")); sprintf(img, "<img align=top src=\"up.png\" alt=\"%s\" title=\"%s\">", loc("up"), loc("up"));
else if (strcmp(getparam("rsort"), disp_attr[i]) == 0) else if (strcmp(getparam("rsort"), disp_attr[i]) == 0)
sprintf(img, "<img align=top src=\"down.png\" alt=\"%s\" title=\"%s\">", loc("down"), loc("down")); sprintf(img, "<img align=top src=\"down.png\" alt=\"%s\" title=\"%s\">", loc("down"),
loc("down"));
if (strieq(disp_attr[i], "Edit") || strieq(disp_attr[i], "Delete")) if (strieq(disp_attr[i], "Edit") || strieq(disp_attr[i], "Delete"))
rsprintf("<th class=\"listtitle\">%s</th>\n", disp_attr[i]); rsprintf("<th class=\"listtitle\">%s</th>\n", disp_attr[i]);
@ -17076,8 +17100,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, BOOL defa
*/ */
highlight_searchtext(re_buf, text, text1, strieq(encoding, "plain") || highlight_searchtext(re_buf, text, text1, strieq(encoding, "plain") ||
strieq(encoding, "ELCode") || strieq(encoding, "ELCode") || !strieq(mode, "Full"));
!strieq(mode, "Full"));
strlcpy(text, text1, TEXT_SIZE); strlcpy(text, text1, TEXT_SIZE);
} }
@ -17242,8 +17265,9 @@ int has_attachments(LOGBOOK * lbs, int message_id)
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void format_email_attachments(LOGBOOK * lbs, int message_id, int attachment_type, char att_file[MAX_ATTACHMENTS][256], void format_email_attachments(LOGBOOK * lbs, int message_id, int attachment_type,
char *mail_text, int size, char *multipart_boundary, int content_id) char att_file[MAX_ATTACHMENTS][256], char *mail_text, int size,
char *multipart_boundary, int content_id)
{ {
int i, index, n_att, fh, n, is_inline; int i, index, n_att, fh, n, is_inline;
char str[256], file_name[256], buffer[256], email_from[256], *p; char str[256], file_name[256], buffer[256], email_from[256], *p;
@ -17262,10 +17286,11 @@ void format_email_attachments(LOGBOOK * lbs, int message_id, int attachment_type
if (attachment_type == 2 && !is_inline) if (attachment_type == 2 && !is_inline)
continue; continue;
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, "\r\n--%s\r\n", multipart_boundary); snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "\r\n--%s\r\n",
multipart_boundary);
/* return proper Content-Type for file type */ /* return proper Content-Type for file type */
for (i = 0; i < (int) strlen(att_file[index]) && i<(int)sizeof(str)-1; i++) for (i = 0; i < (int) strlen(att_file[index]) && i < (int) sizeof(str) - 1; i++)
str[i] = toupper(att_file[index][i]); str[i] = toupper(att_file[index][i]);
str[i] = 0; str[i] = 0;
@ -17289,15 +17314,15 @@ void format_email_attachments(LOGBOOK * lbs, int message_id, int attachment_type
if (content_id) { if (content_id) {
retrieve_email_from(lbs, email_from, NULL, NULL); retrieve_email_from(lbs, email_from, NULL, NULL);
if (strchr(email_from, '@')) if (strchr(email_from, '@'))
p = strchr(email_from, '@')+1; p = strchr(email_from, '@') + 1;
else else
p = email_from; p = email_from;
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-ID: <att%d@%s>\r\n", index, p); "Content-ID: <att%d@%s>\r\n", index, p);
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Disposition: inline; filename=\"%s\"\r\n\r\n", att_file[index] + 14); "Content-Disposition: inline; filename=\"%s\"\r\n\r\n", att_file[index] + 14);
} else } else
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Disposition: attachment; filename=\"%s\"\r\n\r\n", att_file[index] + 14); "Content-Disposition: attachment; filename=\"%s\"\r\n\r\n", att_file[index] + 14);
/* encode file */ /* encode file */
@ -17340,7 +17365,8 @@ void format_email_text(LOGBOOK * lbs, char attrib[MAX_N_ATTR][NAME_LENGTH],
strlcat(mail_text, "--", size); strlcat(mail_text, "--", size);
strlcat(mail_text, multipart_boundary, size); strlcat(mail_text, multipart_boundary, size);
strlcat(mail_text, "\r\n", size); strlcat(mail_text, "\r\n", size);
sprintf(mail_text + strlen(mail_text), "Content-Type: text/plain; charset=%s; format=flowed\r\n", charset); sprintf(mail_text + strlen(mail_text), "Content-Type: text/plain; charset=%s; format=flowed\r\n",
charset);
sprintf(mail_text + strlen(mail_text), "Content-Transfer-Encoding: 7bit\r\n\r\n"); sprintf(mail_text + strlen(mail_text), "Content-Transfer-Encoding: 7bit\r\n\r\n");
} }
@ -17451,9 +17477,9 @@ void format_email_text(LOGBOOK * lbs, char attrib[MAX_N_ATTR][NAME_LENGTH],
sprintf(mail_text + strlen(mail_text), "\r\n%s URL : %s\r\n", loc("Logbook"), url); sprintf(mail_text + strlen(mail_text), "\r\n%s URL : %s\r\n", loc("Logbook"), url);
if (flags & 64) { if (flags & 64) {
for (i=0 ; i<MAX_ATTACHMENTS && att_file[i][0] ; i++) for (i = 0; i < MAX_ATTACHMENTS && att_file[i][0]; i++)
sprintf(mail_text + strlen(mail_text), "\r\n%s %d : %s (%s/%d)\r\n", sprintf(mail_text + strlen(mail_text), "\r\n%s %d : %s (%s/%d)\r\n",
loc("Attachment"), i+1, att_file[i]+14, url, i+1); loc("Attachment"), i + 1, att_file[i] + 14, url, i + 1);
} }
if (flags & 8) { if (flags & 8) {
@ -17491,16 +17517,16 @@ void format_email_html(LOGBOOK * lbs, int message_id, char attrib[MAX_N_ATTR][NA
if (attachments_present) { if (attachments_present) {
sprintf(multipart_boundary_related, "------------%04X%04X%04X", rand(), rand(), rand()); sprintf(multipart_boundary_related, "------------%04X%04X%04X", rand(), rand(), rand());
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: multipart/related;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary_related); "Content-Type: multipart/related;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary_related);
strlcat(mail_text, "--", size); strlcat(mail_text, "--", size);
strlcat(mail_text, multipart_boundary_related, size); strlcat(mail_text, multipart_boundary_related, size);
strlcat(mail_text, "\r\n", size); strlcat(mail_text, "\r\n", size);
} }
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: text/html; charset=\"%s\"\r\n", charset); "Content-Type: text/html; charset=\"%s\"\r\n", charset);
snprintf(mail_text + strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Transfer-Encoding: 7bit\r\n\r\n"); "Content-Transfer-Encoding: 7bit\r\n\r\n");
retrieve_email_from(lbs, mail_from, mail_from_name, attrib); retrieve_email_from(lbs, mail_from, mail_from_name, attrib);
@ -17509,7 +17535,8 @@ void format_email_html(LOGBOOK * lbs, int message_id, char attrib[MAX_N_ATTR][NA
if (getcfg(lbs->name, "Email format", str, sizeof(str))) if (getcfg(lbs->name, "Email format", str, sizeof(str)))
flags = atoi(str); flags = atoi(str);
strcpy(mail_text + strlen(mail_text), "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n"); strcpy(mail_text + strlen(mail_text),
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
strcpy(mail_text + strlen(mail_text), "<html>\r\n<head>\r\n <title></title>\r\n</head>\r\n<body>\r\n"); strcpy(mail_text + strlen(mail_text), "<html>\r\n<head>\r\n <title></title>\r\n</head>\r\n<body>\r\n");
if (flags & 1) { if (flags & 1) {
@ -17617,10 +17644,11 @@ void format_email_html(LOGBOOK * lbs, int message_id, char attrib[MAX_N_ATTR][NA
} }
if (flags & 64) { if (flags & 64) {
for (i=0 ; i<MAX_ATTACHMENTS && att_file[i][0] ; i++) { for (i = 0; i < MAX_ATTACHMENTS && att_file[i][0]; i++) {
sprintf(mail_text + strlen(mail_text), sprintf(mail_text + strlen(mail_text),
"<tr><td bgcolor=\"#CCCCFF\">%s %d</td><td bgcolor=\"#DDEEBB\">", loc("Attachment"), i+1); "<tr><td bgcolor=\"#CCCCFF\">%s %d</td><td bgcolor=\"#DDEEBB\">", loc("Attachment"), i + 1);
sprintf(mail_text + strlen(mail_text), "<a href=\"%s/%d\">%s</a></td></tr>\r\n", url, i+1, att_file[i]+14); sprintf(mail_text + strlen(mail_text), "<a href=\"%s/%d\">%s</a></td></tr>\r\n", url, i + 1,
att_file[i] + 14);
} }
} }
@ -17645,7 +17673,8 @@ void format_email_html(LOGBOOK * lbs, int message_id, char attrib[MAX_N_ATTR][NA
strcpy(mail_text + strlen(mail_text), "\r\n</html></body>\r\n\r\n"); strcpy(mail_text + strlen(mail_text), "\r\n</html></body>\r\n\r\n");
if (attachments_present) { if (attachments_present) {
format_email_attachments(lbs, message_id, 2, att_file, mail_text, size, multipart_boundary_related, TRUE); format_email_attachments(lbs, message_id, 2, att_file, mail_text, size, multipart_boundary_related,
TRUE);
strlcat(mail_text, "--", size); strlcat(mail_text, "--", size);
strlcat(mail_text, multipart_boundary_related, size); strlcat(mail_text, multipart_boundary_related, size);
strlcat(mail_text, "--\r\n\r\n", size); strlcat(mail_text, "--\r\n\r\n", size);
@ -17674,16 +17703,16 @@ void format_email_html2(LOGBOOK * lbs, int message_id, char att_file[MAX_ATTACHM
if (attachments_present) { if (attachments_present) {
sprintf(multipart_boundary_related, "------------%04X%04X%04X", rand(), rand(), rand()); sprintf(multipart_boundary_related, "------------%04X%04X%04X", rand(), rand(), rand());
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: multipart/related;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary_related); "Content-Type: multipart/related;\r\n boundary=\"%s\"\r\n\r\n", multipart_boundary_related);
strlcat(mail_text, "--", size); strlcat(mail_text, "--", size);
strlcat(mail_text, multipart_boundary_related, size); strlcat(mail_text, multipart_boundary_related, size);
strlcat(mail_text, "\r\n", size); strlcat(mail_text, "\r\n", size);
} }
snprintf(mail_text+strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Type: text/html; charset=\"%s\"\r\n", charset); "Content-Type: text/html; charset=\"%s\"\r\n", charset);
snprintf(mail_text + strlen(mail_text), size-strlen(mail_text)-1, snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1,
"Content-Transfer-Encoding: 7bit\r\n\r\n"); "Content-Transfer-Encoding: 7bit\r\n\r\n");
strlen_retbuf = 0; strlen_retbuf = 0;
@ -17693,12 +17722,13 @@ void format_email_html2(LOGBOOK * lbs, int message_id, char att_file[MAX_ATTACHM
show_elog_entry(lbs, str, "email"); show_elog_entry(lbs, str, "email");
p = strstr(return_buffer, "\r\n\r\n"); p = strstr(return_buffer, "\r\n\r\n");
if (p) if (p)
strlcpy(mail_text + strlen(mail_text), p+4, size - strlen(mail_text)); strlcpy(mail_text + strlen(mail_text), p + 4, size - strlen(mail_text));
strlen_retbuf = 0; strlen_retbuf = 0;
strlcat(mail_text, "\r\n", size); strlcat(mail_text, "\r\n", size);
if (attachments_present) { if (attachments_present) {
format_email_attachments(lbs, message_id, 0, att_file, mail_text, size, multipart_boundary_related, TRUE); format_email_attachments(lbs, message_id, 0, att_file, mail_text, size, multipart_boundary_related,
TRUE);
strlcat(mail_text, "--", size); strlcat(mail_text, "--", size);
strlcat(mail_text, multipart_boundary_related, size); strlcat(mail_text, multipart_boundary_related, size);
strlcat(mail_text, "--\r\n\r\n", size); strlcat(mail_text, "--\r\n\r\n", size);
@ -17771,22 +17801,26 @@ int compose_email(LOGBOOK * lbs, char *mail_to, int message_id,
if (getcfg(lbs->name, "Omit Email to", str, sizeof(str)) && atoi(str) == 1) if (getcfg(lbs->name, "Omit Email to", str, sizeof(str)) && atoi(str) == 1)
strcpy(mail_to, "ELOG"); strcpy(mail_to, "ELOG");
compose_email_header(lbs, subject, mail_from_name, mail_to, url, mail_text, mail_text_size, mail_encoding, n_attachments, multipart_boundary); compose_email_header(lbs, subject, mail_from_name, mail_to, url, mail_text, mail_text_size, mail_encoding,
n_attachments, multipart_boundary);
if (mail_encoding & 1) if (mail_encoding & 1)
format_email_text(lbs, attrib, att_file, old_mail, url, multipart_boundary, mail_text, mail_text_size); format_email_text(lbs, attrib, att_file, old_mail, url, multipart_boundary, mail_text, mail_text_size);
if (mail_encoding & 2) if (mail_encoding & 2)
format_email_html(lbs, message_id, attrib, att_file, old_mail, encoding, url, multipart_boundary, mail_text, mail_text_size); format_email_html(lbs, message_id, attrib, att_file, old_mail, encoding, url, multipart_boundary,
mail_text, mail_text_size);
if (mail_encoding & 4) if (mail_encoding & 4)
format_email_html2(lbs, message_id, att_file, old_mail, multipart_boundary, mail_text, mail_text_size); format_email_html2(lbs, message_id, att_file, old_mail, multipart_boundary, mail_text, mail_text_size);
if (n_attachments && (flags & 16)) { if (n_attachments && (flags & 16)) {
if ((mail_encoding & 6) > 0) if ((mail_encoding & 6) > 0)
/* only non-inline attachements */ /* only non-inline attachements */
format_email_attachments(lbs, message_id, 1, att_file, mail_text, mail_text_size, multipart_boundary, FALSE); format_email_attachments(lbs, message_id, 1, att_file, mail_text, mail_text_size, multipart_boundary,
FALSE);
else else
/* all attachments */ /* all attachments */
format_email_attachments(lbs, message_id, 0, att_file, mail_text, mail_text_size, multipart_boundary, FALSE); format_email_attachments(lbs, message_id, 0, att_file, mail_text, mail_text_size, multipart_boundary,
FALSE);
} }
if (multipart_boundary[0]) { if (multipart_boundary[0]) {
@ -19165,11 +19199,14 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
} }
strlcat(file_name, "first.png", sizeof(file_name)); strlcat(file_name, "first.png", sizeof(file_name));
if (stat(file_name, &st) >= 0) { if (stat(file_name, &st) >= 0) {
rsprintf("<input type=image name=cmd_first alt=\"%s\" title=\"%s\" src=\"first.png\">\n", loc("First entry"), loc("First entry")); rsprintf("<input type=image name=cmd_first alt=\"%s\" title=\"%s\" src=\"first.png\">\n",
loc("First entry"), loc("First entry"));
rsprintf("<input type=image name=cmd_previous alt=\"%s\" title=\"%s\" src=\"previous.png\">\n", rsprintf("<input type=image name=cmd_previous alt=\"%s\" title=\"%s\" src=\"previous.png\">\n",
loc("Previous entry"), loc("Previous entry")); loc("Previous entry"), loc("Previous entry"));
rsprintf("<input type=image name=cmd_next alt=\"%s\" title=\"%s\" src=\"next.png\">\n", loc("Next entry"), loc("Next entry")); rsprintf("<input type=image name=cmd_next alt=\"%s\" title=\"%s\" src=\"next.png\">\n",
rsprintf("<input type=image name=cmd_last alt=\"%s\" title=\"%s\" src=\"last.png\">\n", loc("Last entry"), loc("Last entry")); loc("Next entry"), loc("Next entry"));
rsprintf("<input type=image name=cmd_last alt=\"%s\" title=\"%s\" src=\"last.png\">\n",
loc("Last entry"), loc("Last entry"));
} else { } else {
rsprintf("<a href=\"%d?cmd=%s\">|&lt;</a>&nbsp;\n", message_id, loc("First")); rsprintf("<a href=\"%d?cmd=%s\">|&lt;</a>&nbsp;\n", message_id, loc("First"));
rsprintf("<a href=\"%d?cmd=%s\">&lt;</a>&nbsp;\n", message_id, loc("Previous")); rsprintf("<a href=\"%d?cmd=%s\">&lt;</a>&nbsp;\n", message_id, loc("Previous"));
@ -19286,7 +19323,8 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
if (locked_by && locked_by[0]) { if (locked_by && locked_by[0]) {
sprintf(str, "%s %s", loc("Entry is currently edited by"), locked_by); sprintf(str, "%s %s", loc("Entry is currently edited by"), locked_by);
rsprintf("<tr><td nowrap colspan=2 class=\"errormsg\"><img src=\"stop.png\" alt=\"%s\" title=\"%s\">\n", rsprintf
("<tr><td nowrap colspan=2 class=\"errormsg\"><img src=\"stop.png\" alt=\"%s\" title=\"%s\">\n",
loc("stop"), loc("stop")); loc("stop"), loc("stop"));
rsprintf("%s<br>%s</td></tr>\n", str, loc("You can \"steal\" the lock by editing this entry")); rsprintf("%s<br>%s</td></tr>\n", str, loc("You can \"steal\" the lock by editing this entry"));
} }
@ -19309,14 +19347,15 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist, add_subst_time(lbs, (char (*)[NAME_LENGTH]) slist,
(char (*)[NAME_LENGTH]) svalue, "entry time", date, &j); (char (*)[NAME_LENGTH]) svalue, "entry time", date, &j);
strsubst_list(display, sizeof(display), (char (*)[NAME_LENGTH]) slist, (char (*)[NAME_LENGTH]) svalue, j); strsubst_list(display, sizeof(display), (char (*)[NAME_LENGTH]) slist,
(char (*)[NAME_LENGTH]) svalue, j);
} else } else
sprintf(display, "%d", message_id); sprintf(display, "%d", message_id);
if (email) { if (email) {
compose_base_url(lbs, str, sizeof(str)); compose_base_url(lbs, str, sizeof(str));
sprintf(str+strlen(str), "%d", message_id); sprintf(str + strlen(str), "%d", message_id);
rsprintf("%s:&nbsp;<b>%s</b>&nbsp;&nbsp;", loc("Logbook"), lbs->name); rsprintf("%s:&nbsp;<b>%s</b>&nbsp;&nbsp;", loc("Logbook"), lbs->name);
rsprintf("%s:&nbsp;<a href=\"%s\"><b>%d</b></a>", loc("Message ID"), str, message_id); rsprintf("%s:&nbsp;<a href=\"%s\"><b>%d</b></a>", loc("Message ID"), str, message_id);
} else } else
@ -19339,7 +19378,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
if (orig_tag[0]) { if (orig_tag[0]) {
compose_base_url(lbs, ref, sizeof(ref)); compose_base_url(lbs, ref, sizeof(ref));
sprintf(ref+strlen(ref), "%s", orig_tag); sprintf(ref + strlen(ref), "%s", orig_tag);
rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;%s:&nbsp;", loc("In reply to")); rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;%s:&nbsp;", loc("In reply to"));
rsprintf("<b><a href=\"%s\">%s</a></b>\n", ref, orig_tag); rsprintf("<b><a href=\"%s\">%s</a></b>\n", ref, orig_tag);
} }
@ -19349,7 +19388,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
p = strtok(reply_tag, ","); p = strtok(reply_tag, ",");
do { do {
compose_base_url(lbs, ref, sizeof(ref)); compose_base_url(lbs, ref, sizeof(ref));
sprintf(ref+strlen(ref), "%s", p); sprintf(ref + strlen(ref), "%s", p);
rsprintf("<a href=\"%s\">%s</a>\n", ref, p); rsprintf("<a href=\"%s\">%s</a>\n", ref, p);
p = strtok(NULL, ","); p = strtok(NULL, ",");
@ -19445,7 +19484,8 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
if (*getparam(lattr) == '1') if (*getparam(lattr) == '1')
rsprintf("<input type=\"checkbox\" checked name=\"%s\" value=\"1\">&nbsp;", lattr); rsprintf("<input type=\"checkbox\" checked name=\"%s\" value=\"1\">&nbsp;", lattr);
else else
rsprintf("<input alt=\"text\" title=\"text\"type=\"checkbox\" name=\"%s\" value=\"1\">&nbsp;", lattr); rsprintf("<input alt=\"text\" title=\"text\"type=\"checkbox\" name=\"%s\" value=\"1\">&nbsp;",
lattr);
} }
/* display checkbox for boolean attributes */ /* display checkbox for boolean attributes */
@ -19662,7 +19702,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
if (email) { if (email) {
retrieve_email_from(lbs, email_from, NULL, NULL); retrieve_email_from(lbs, email_from, NULL, NULL);
if (strchr(email_from, '@')) if (strchr(email_from, '@'))
p = strchr(email_from, '@')+1; p = strchr(email_from, '@') + 1;
else else
p = email_from; p = email_from;
sprintf(ref, "cid:att%d@%s", index, p); sprintf(ref, "cid:att%d@%s", index, p);
@ -19761,12 +19801,14 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
if (file_exist(thumb_name)) { if (file_exist(thumb_name)) {
rsprintf("<tr><td class=\"attachmentframe\">\n"); rsprintf("<tr><td class=\"attachmentframe\">\n");
rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref); rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref);
rsprintf("<img src=\"%s.thumb\" alt=\"%s\" title=\"%s\"></a>\n", ref, attachment[index] + 14, attachment[index] + 14); rsprintf("<img src=\"%s.thumb\" alt=\"%s\" title=\"%s\"></a>\n", ref,
attachment[index] + 14, attachment[index] + 14);
rsprintf("</td></tr>\n\n"); rsprintf("</td></tr>\n\n");
} else if (is_image(att)) { } else if (is_image(att)) {
rsprintf("<tr><td class=\"attachmentframe\">\n"); rsprintf("<tr><td class=\"attachmentframe\">\n");
rsprintf("<a name=\"att%d\"></a>\n", index + 1); rsprintf("<a name=\"att%d\"></a>\n", index + 1);
rsprintf("<img src=\"%s\" alt=\"%s\" title=\"%s\">\n", ref, attachment[index] + 14, attachment[index] + 14); rsprintf("<img src=\"%s\" alt=\"%s\" title=\"%s\">\n", ref, attachment[index] + 14,
attachment[index] + 14);
rsprintf("</td></tr>\n\n"); rsprintf("</td></tr>\n\n");
} else { } else {
if (is_ascii(file_name)) { if (is_ascii(file_name)) {
@ -20180,8 +20222,7 @@ int get_user_line(LOGBOOK * lbs, char *user, char *password, char *full_name,
/* open password file */ /* open password file */
load_password_files(); load_password_files();
return get_user_line(lbs, user, password, full_name, return get_user_line(lbs, user, password, full_name, email, email_notify, last_logout);
email, email_notify, last_logout);
} }
} }
@ -20581,7 +20622,8 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
else { else {
if (pparent != NULL) { if (pparent != NULL) {
if (getcfg_topgroup()) if (getcfg_topgroup())
rsprintf("<a href=\"%s%s/?gexp=%s\">- %s</a> ", ref, getcfg_topgroup(), pparent->name, plb->name); rsprintf("<a href=\"%s%s/?gexp=%s\">- %s</a> ", ref, getcfg_topgroup(), pparent->name,
plb->name);
else else
rsprintf("<a href=\"%s?gexp=%s\">- %s</a> ", ref, pparent->name, plb->name); rsprintf("<a href=\"%s?gexp=%s\">- %s</a> ", ref, pparent->name, plb->name);
} else { } else {
@ -20596,7 +20638,8 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
rsprintf(plb->name); rsprintf(plb->name);
else { else {
if (getcfg_topgroup()) if (getcfg_topgroup())
rsprintf("<a href=\"%s%s/?gexp=%s\">+ %s</a> ", ref, getcfg_topgroup(), plb->name, plb->name); rsprintf("<a href=\"%s%s/?gexp=%s\">+ %s</a> ", ref, getcfg_topgroup(), plb->name,
plb->name);
else else
rsprintf("<a href=\"%s?gexp=%s\">+ %s</a> ", ref, plb->name, plb->name); rsprintf("<a href=\"%s?gexp=%s\">+ %s</a> ", ref, plb->name, plb->name);
} }
@ -21003,14 +21046,16 @@ void show_calendar(LOGBOOK * lbs)
/* link to previous year */ /* link to previous year */
rsprintf("&nbsp;&nbsp;"); rsprintf("&nbsp;&nbsp;");
rsprintf("<a href=\"?i=%s&amp;m=%d&amp;y=%d\">", index, cur_mon, cur_year - 1); rsprintf("<a href=\"?i=%s&amp;m=%d&amp;y=%d\">", index, cur_mon, cur_year - 1);
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_prev.png\" alt=\"%s\" title=\"%s\"></a>", loc("Previous Year"), loc("Previous Year")); rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_prev.png\" alt=\"%s\" title=\"%s\"></a>",
loc("Previous Year"), loc("Previous Year"));
/* current year */ /* current year */
rsprintf("&nbsp;%d&nbsp;", cur_year); rsprintf("&nbsp;%d&nbsp;", cur_year);
/* link to next year */ /* link to next year */
rsprintf("<a href=\"?i=%s&amp;m=%d&amp;y=%d\">", index, cur_mon, cur_year + 1); rsprintf("<a href=\"?i=%s&amp;m=%d&amp;y=%d\">", index, cur_mon, cur_year + 1);
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_next.png\" alt=\"%s\" title=\"%s\"></a>", loc("Next Year"), loc("Next Year")); rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_next.png\" alt=\"%s\" title=\"%s\"></a>",
loc("Next Year"), loc("Next Year"));
/* go to first day of month */ /* go to first day of month */
ts->tm_mday = 1; ts->tm_mday = 1;
@ -21447,8 +21492,7 @@ void interprete(char *lbook, char *path)
/* deliver icons without password */ /* deliver icons without password */
if (chkext(path, ".gif") || chkext(path, ".jpg") || if (chkext(path, ".gif") || chkext(path, ".jpg") ||
chkext(path, ".png") || chkext(path, ".ico") || chkext(path, ".png") || chkext(path, ".ico") || chkext(path, ".htm") || chkext(path, ".css")) {
chkext(path, ".htm") || chkext(path, ".css")) {
/* check if file in resource directory */ /* check if file in resource directory */
strlcpy(str, resource_dir, sizeof(str)); strlcpy(str, resource_dir, sizeof(str));
strlcat(str, path, sizeof(str)); strlcat(str, path, sizeof(str));
@ -21726,7 +21770,7 @@ void interprete(char *lbook, char *path)
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name)); strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
strlcat(file_name, "eloghelp_", sizeof(file_name)); strlcat(file_name, "eloghelp_", sizeof(file_name));
if (getcfg("global", "Language", str, sizeof(str))) { if (getcfg("global", "Language", str, sizeof(str))) {
for (i=0 ; i<(int)strlen(str) ; i++) for (i = 0; i < (int) strlen(str); i++)
str[i] = my_tolower(str[i]); str[i] = my_tolower(str[i]);
strlcat(file_name, str, sizeof(file_name)); strlcat(file_name, str, sizeof(file_name));
} else } else
@ -21749,7 +21793,7 @@ void interprete(char *lbook, char *path)
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name)); strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
strlcat(file_name, "elcode_", sizeof(file_name)); strlcat(file_name, "elcode_", sizeof(file_name));
if (getcfg("global", "Language", str, sizeof(str))) { if (getcfg("global", "Language", str, sizeof(str))) {
for (i=0 ; i<(int)strlen(str) ; i++) for (i = 0; i < (int) strlen(str); i++)
str[i] = my_tolower(str[i]); str[i] = my_tolower(str[i]);
strlcat(file_name, str, sizeof(file_name)); strlcat(file_name, str, sizeof(file_name));
} else } else
@ -22290,11 +22334,11 @@ void decode_post(char *logbook, LOGBOOK * lbs, char *string, char *boundary, int
return; return;
} }
pbody += 4; pbody += 4;
header_size = (int)pbody - (int)buffer; header_size = (int) pbody - (int) buffer;
/* check for file found */ /* check for file found */
if (strchr(buffer, ' ')) { if (strchr(buffer, ' ')) {
status = atoi(strchr(buffer, ' ')+1); status = atoi(strchr(buffer, ' ') + 1);
if (status != 200) { if (status != 200) {
sprintf(str, loc("File not found at URL \"%s\""), file_name); sprintf(str, loc("File not found at URL \"%s\""), file_name);
show_error(str); show_error(str);