mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Changed indentation
SVN revision: 764
This commit is contained in:
parent
0d39b39c4c
commit
3b72352ce2
306
src/elogd.c
306
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.248 2004/02/16 15:05:56 midas
|
||||||
|
Changed indentation
|
||||||
|
|
||||||
Revision 1.247 2004/02/16 15:04:32 midas
|
Revision 1.247 2004/02/16 15:04:32 midas
|
||||||
Fixed compiler warnings
|
Fixed compiler warnings
|
||||||
|
|
||||||
@ -559,23 +562,40 @@ struct {
|
|||||||
char type[32];
|
char type[32];
|
||||||
} filetype[] = {
|
} filetype[] = {
|
||||||
|
|
||||||
{".CSS", "text/css"},
|
{
|
||||||
{".JPG", "image/jpeg"},
|
".CSS", "text/css"},
|
||||||
{".JPEG", "image/jpeg"},
|
{
|
||||||
{".GIF", "image/gif"},
|
".JPG", "image/jpeg"},
|
||||||
{".PNG", "image/png"},
|
{
|
||||||
{".PS", "application/postscript"},
|
".JPEG", "image/jpeg"},
|
||||||
{".EPS", "application/postscript"},
|
{
|
||||||
{".HTML", "text/html"},
|
".GIF", "image/gif"},
|
||||||
{".HTM", "text/html"},
|
{
|
||||||
{".XLS", "application/x-msexcel"},
|
".PNG", "image/png"},
|
||||||
{".DOC", "application/msword"},
|
{
|
||||||
{".PDF", "application/pdf"},
|
".PS", "application/postscript"},
|
||||||
{".JS", "application/x-javascript"},
|
{
|
||||||
{".TXT", "text/plain"},
|
".EPS", "application/postscript"},
|
||||||
{".ASC", "text/plain"},
|
{
|
||||||
{".ZIP", "application/x-zip-compressed"},
|
".HTML", "text/html"},
|
||||||
{"",""},};
|
{
|
||||||
|
".HTM", "text/html"},
|
||||||
|
{
|
||||||
|
".XLS", "application/x-msexcel"},
|
||||||
|
{
|
||||||
|
".DOC", "application/msword"},
|
||||||
|
{
|
||||||
|
".PDF", "application/pdf"},
|
||||||
|
{
|
||||||
|
".JS", "application/x-javascript"},
|
||||||
|
{
|
||||||
|
".TXT", "text/plain"},
|
||||||
|
{
|
||||||
|
".ASC", "text/plain"},
|
||||||
|
{
|
||||||
|
".ZIP", "application/x-zip-compressed"},
|
||||||
|
{
|
||||||
|
"", ""},};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int message_id;
|
int message_id;
|
||||||
@ -3457,9 +3477,10 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
time_t now, ltime;
|
time_t now, ltime;
|
||||||
char *message, *p, *buffer;
|
char *message, *p, *buffer;
|
||||||
char attachment_all[64 * MAX_ATTACHMENTS];
|
char attachment_all[64 * MAX_ATTACHMENTS];
|
||||||
|
|
||||||
tail_size = orig_size = 0;
|
tail_size = orig_size = 0;
|
||||||
buffer = NULL;
|
|
||||||
|
buffer = NULL;
|
||||||
message = malloc(TEXT_SIZE + 100);
|
message = malloc(TEXT_SIZE + 100);
|
||||||
assert(message);
|
assert(message);
|
||||||
|
|
||||||
@ -3485,7 +3506,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
}
|
}
|
||||||
|
|
||||||
lseek(fh, lbs->el_index[index].offset, SEEK_SET);
|
lseek(fh, lbs->el_index[index].offset, SEEK_SET);
|
||||||
i = read(fh, message, TEXT_SIZE+100);
|
i = read(fh, message, TEXT_SIZE + 100);
|
||||||
message[i] = 0;
|
message[i] = 0;
|
||||||
|
|
||||||
/* check for valid message */
|
/* check for valid message */
|
||||||
@ -3643,8 +3664,8 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
sprintf(message + strlen(message), "Locked by: %s\n", locked_by);
|
sprintf(message + strlen(message), "Locked by: %s\n", locked_by);
|
||||||
|
|
||||||
sprintf(message + strlen(message), "========================================\n");
|
sprintf(message + strlen(message), "========================================\n");
|
||||||
strlcat(message, text, TEXT_SIZE+100);
|
strlcat(message, text, TEXT_SIZE + 100);
|
||||||
strlcat(message, "\n", TEXT_SIZE+100);
|
strlcat(message, "\n", TEXT_SIZE + 100);
|
||||||
|
|
||||||
write(fh, message, strlen(message));
|
write(fh, message, strlen(message));
|
||||||
|
|
||||||
@ -3665,8 +3686,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
|
|
||||||
for (j = i + 1;
|
for (j = i + 1;
|
||||||
j < *lbs->n_el_index
|
j < *lbs->n_el_index
|
||||||
&& strieq(lbs->el_index[i].file_name, lbs->el_index[j].file_name);
|
&& strieq(lbs->el_index[i].file_name, lbs->el_index[j].file_name); j++)
|
||||||
j++)
|
|
||||||
lbs->el_index[j].offset += delta;
|
lbs->el_index[j].offset += delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3688,7 +3708,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
reply_id = atoi(in_reply_to);
|
reply_id = atoi(in_reply_to);
|
||||||
|
|
||||||
/* retrieve original message */
|
/* retrieve original message */
|
||||||
size = TEXT_SIZE+100;
|
size = TEXT_SIZE + 100;
|
||||||
el_retrieve(lbs, reply_id, date, attr_list, attr, n_attr, message, &size,
|
el_retrieve(lbs, reply_id, date, attr_list, attr, n_attr, message, &size,
|
||||||
in_reply_to, reply_to, att, enc, lock);
|
in_reply_to, reply_to, att, enc, lock);
|
||||||
|
|
||||||
@ -3710,12 +3730,12 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit,
|
|||||||
void remove_reference(LOGBOOK * lbs, int message_id, int remove_id, BOOL reply_to_flag)
|
void remove_reference(LOGBOOK * lbs, int message_id, int remove_id, BOOL reply_to_flag)
|
||||||
{
|
{
|
||||||
char date[80], attr[MAX_N_ATTR][NAME_LENGTH], enc[80], in_reply_to[80],
|
char date[80], attr[MAX_N_ATTR][NAME_LENGTH], enc[80], in_reply_to[80],
|
||||||
reply_to[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], lock[256],
|
reply_to[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], lock[256],
|
||||||
*p, *ps, *message;
|
*p, *ps, *message;
|
||||||
int size, status;
|
int size, status;
|
||||||
|
|
||||||
/* retrieve original message */
|
/* retrieve original message */
|
||||||
size = TEXT_SIZE+1000;
|
size = TEXT_SIZE + 1000;
|
||||||
message = malloc(size);
|
message = malloc(size);
|
||||||
status =
|
status =
|
||||||
el_retrieve(lbs, message_id, date, attr_list, attr, lbs->n_attr, message, &size,
|
el_retrieve(lbs, message_id, date, attr_list, attr, lbs->n_attr, message, &size,
|
||||||
@ -3876,8 +3896,8 @@ INT el_delete_message(LOGBOOK * lbs, int message_id,
|
|||||||
/* buffer tail of logfile */
|
/* buffer tail of logfile */
|
||||||
lseek(fh, 0, SEEK_END);
|
lseek(fh, 0, SEEK_END);
|
||||||
tail_size = TELL(fh) - (lbs->el_index[index].offset + size);
|
tail_size = TELL(fh) - (lbs->el_index[index].offset + size);
|
||||||
|
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
if (tail_size > 0) {
|
if (tail_size > 0) {
|
||||||
buffer = malloc(tail_size);
|
buffer = malloc(tail_size);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
@ -3922,8 +3942,7 @@ INT el_delete_message(LOGBOOK * lbs, int message_id,
|
|||||||
|
|
||||||
/* correct all offsets after deleted message */
|
/* correct all offsets after deleted message */
|
||||||
for (i = 0; i < *lbs->n_el_index; i++)
|
for (i = 0; i < *lbs->n_el_index; i++)
|
||||||
if (strieq(lbs->el_index[i].file_name, str) &&
|
if (strieq(lbs->el_index[i].file_name, str) && lbs->el_index[i].offset > old_offset)
|
||||||
lbs->el_index[i].offset > old_offset)
|
|
||||||
lbs->el_index[i].offset -= size;
|
lbs->el_index[i].offset -= size;
|
||||||
|
|
||||||
/* if other logbook has same index, update pointers */
|
/* if other logbook has same index, update pointers */
|
||||||
@ -4324,7 +4343,7 @@ void rsputs2(const char *str)
|
|||||||
j += 4;
|
j += 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* the translation for the search highliting */
|
/* the translation for the search highliting */
|
||||||
case '\001':
|
case '\001':
|
||||||
strcat(return_buffer, "<");
|
strcat(return_buffer, "<");
|
||||||
j++;
|
j++;
|
||||||
@ -4757,7 +4776,8 @@ int scan_attributes(char *logbook, char *condition)
|
|||||||
/* scan configuration file for attributes and fill attr_list, attr_options
|
/* scan configuration file for attributes and fill attr_list, attr_options
|
||||||
and attr_flags arrays */
|
and attr_flags arrays */
|
||||||
{
|
{
|
||||||
char list[10000], str[NAME_LENGTH], type[NAME_LENGTH], tmp_list[MAX_N_ATTR][NAME_LENGTH];
|
char list[10000], str[NAME_LENGTH], type[NAME_LENGTH],
|
||||||
|
tmp_list[MAX_N_ATTR][NAME_LENGTH];
|
||||||
int i, j, n, m;
|
int i, j, n, m;
|
||||||
|
|
||||||
if (getcfg_cond(logbook, condition, "Attributes", list)) {
|
if (getcfg_cond(logbook, condition, "Attributes", list)) {
|
||||||
@ -4837,7 +4857,7 @@ and attr_flags arrays */
|
|||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
if (strieq(attr_list[j], tmp_list[i]))
|
if (strieq(attr_list[j], tmp_list[i]))
|
||||||
attr_flags[j] |= AF_EXTENDABLE;
|
attr_flags[j] |= AF_EXTENDABLE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
@ -5561,7 +5581,7 @@ void strencode(char *text)
|
|||||||
rsprintf(" ");
|
rsprintf(" ");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* the translation for the search highliting */
|
/* the translation for the search highliting */
|
||||||
case '\001':
|
case '\001':
|
||||||
rsprintf("<");
|
rsprintf("<");
|
||||||
break;
|
break;
|
||||||
@ -5606,7 +5626,7 @@ void strencode2(char *b, char *text)
|
|||||||
strcat(b, """);
|
strcat(b, """);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf(b+strlen(b), "%c", text[i]);
|
sprintf(b + strlen(b), "%c", text[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5948,7 +5968,7 @@ void show_date_selector(int day, int month, int year, char *index)
|
|||||||
|
|
||||||
rsprintf("<option value=\"\">\n");
|
rsprintf("<option value=\"\">\n");
|
||||||
for (i = 0; i < 12; i++)
|
for (i = 0; i < 12; i++)
|
||||||
if (i+1 == month)
|
if (i + 1 == month)
|
||||||
rsprintf("<option selected value=\"%d\">%s\n", i + 1, month_name(i));
|
rsprintf("<option selected value=\"%d\">%s\n", i + 1, month_name(i));
|
||||||
else
|
else
|
||||||
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
rsprintf("<option value=\"%d\">%s\n", i + 1, month_name(i));
|
||||||
@ -5957,15 +5977,16 @@ void show_date_selector(int day, int month, int year, char *index)
|
|||||||
rsprintf("<select name=\"d%s\">", index);
|
rsprintf("<select name=\"d%s\">", index);
|
||||||
rsprintf("<option selected value=\"\">\n");
|
rsprintf("<option selected value=\"\">\n");
|
||||||
for (i = 0; i < 31; i++)
|
for (i = 0; i < 31; i++)
|
||||||
if (i+1 == day)
|
if (i + 1 == day)
|
||||||
rsprintf("<option selected value=%d>%d\n", i + 1, i + 1);
|
rsprintf("<option selected value=%d>%d\n", i + 1, i + 1);
|
||||||
else
|
else
|
||||||
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
rsprintf("<option value=%d>%d\n", i + 1, i + 1);
|
||||||
rsprintf("</select>\n");
|
rsprintf("</select>\n");
|
||||||
|
|
||||||
if (year)
|
if (year)
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%s\" value=\"%d\">",
|
rsprintf
|
||||||
loc("Year"), index, year);
|
(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%s\" value=\"%d\">",
|
||||||
|
loc("Year"), index, year);
|
||||||
else
|
else
|
||||||
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%s\">",
|
rsprintf(" %s: <input type=\"text\" size=5 maxlength=5 name=\"y%s\">",
|
||||||
loc("Year"), index);
|
loc("Year"), index);
|
||||||
@ -5988,7 +6009,7 @@ void show_date_selector(int day, int month, int year, char *index)
|
|||||||
rsprintf("} \n");
|
rsprintf("} \n");
|
||||||
rsprintf("//-->\n");
|
rsprintf("//-->\n");
|
||||||
rsprintf("</script>\n");
|
rsprintf("</script>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -6064,7 +6085,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
ts.tm_hour = 12;
|
ts.tm_hour = 12;
|
||||||
|
|
||||||
ltime = mktime(&ts);
|
ltime = mktime(&ts);
|
||||||
sprintf(attrib[i], "%d", (int)ltime);
|
sprintf(attrib[i], "%d", (int) ltime);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
strlcpy(attrib[i], getparam(ua), NAME_LENGTH);
|
strlcpy(attrib[i], getparam(ua), NAME_LENGTH);
|
||||||
@ -6474,7 +6495,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n", str,
|
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n", str,
|
||||||
attr_options[index][i]);
|
attr_options[index][i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strencode2(str, attrib[index]);
|
strencode2(str, attrib[index]);
|
||||||
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\"></td></tr>\n",
|
rsprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\"></td></tr>\n",
|
||||||
ua, str);
|
ua, str);
|
||||||
@ -6488,8 +6509,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
if (attrib[index][0]) {
|
if (attrib[index][0]) {
|
||||||
ltime = atoi(attrib[index]);
|
ltime = atoi(attrib[index]);
|
||||||
pts = localtime(<ime);
|
pts = localtime(<ime);
|
||||||
year = pts->tm_year+1900;
|
year = pts->tm_year + 1900;
|
||||||
month = pts->tm_mon+1;
|
month = pts->tm_mon + 1;
|
||||||
day = pts->tm_mday;
|
day = pts->tm_mday;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6504,8 +6525,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("<td class=\"attribvalue\">");
|
rsprintf("<td class=\"attribvalue\">");
|
||||||
|
|
||||||
strencode2(str, attrib[index]);
|
strencode2(str, attrib[index]);
|
||||||
rsprintf("<input type=\"text\" size=%d maxlength=%d name=\"%s\" value=\"%s\">\n",
|
rsprintf
|
||||||
input_size, input_maxlen, ua, str);
|
("<input type=\"text\" size=%d maxlength=%d name=\"%s\" value=\"%s\">\n",
|
||||||
|
input_size, input_maxlen, ua, str);
|
||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
}
|
}
|
||||||
@ -7121,12 +7143,13 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
/* table for two-column items */
|
/* table for two-column items */
|
||||||
rsprintf("<table width=\"100%%\" cellspacing=0>\n");
|
rsprintf("<table width=\"100%%\" cellspacing=0>\n");
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>", loc("Entry date"));
|
rsprintf("<tr><td class=\"attribname\" nowrap width=\"10%%\">%s:</td>",
|
||||||
|
loc("Entry date"));
|
||||||
rsprintf("<td class=\"attribvalue\"><table width=\"100%%\" cellspacing=0 border=0>\n");
|
rsprintf("<td class=\"attribvalue\"><table width=\"100%%\" cellspacing=0 border=0>\n");
|
||||||
rsprintf("<tr><td width=\"1%%\">%s:<td>", loc("Start"));
|
rsprintf("<tr><td width=\"1%%\">%s:<td>", loc("Start"));
|
||||||
|
|
||||||
show_date_selector(0, 0, 0, "a");
|
show_date_selector(0, 0, 0, "a");
|
||||||
|
|
||||||
rsprintf(" / %s: ", loc("Show last"));
|
rsprintf(" / %s: ", loc("Show last"));
|
||||||
|
|
||||||
rsprintf("<select name=last>\n");
|
rsprintf("<select name=last>\n");
|
||||||
@ -7153,7 +7176,7 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
if (attr_options[i][0][0] == 0) {
|
if (attr_options[i][0][0] == 0) {
|
||||||
|
|
||||||
if (attr_flags[i] & AF_DATE) {
|
if (attr_flags[i] & AF_DATE) {
|
||||||
|
|
||||||
rsprintf("<table width=\"100%%\" cellspacing=0 border=0>\n");
|
rsprintf("<table width=\"100%%\" cellspacing=0 border=0>\n");
|
||||||
rsprintf("<tr><td width=\"1%%\">%s:<td>", loc("Start"));
|
rsprintf("<tr><td width=\"1%%\">%s:<td>", loc("Start"));
|
||||||
sprintf(str, "%da", i);
|
sprintf(str, "%da", i);
|
||||||
@ -7166,7 +7189,7 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
rsprintf("</td></tr></table>\n");
|
rsprintf("</td></tr></table>\n");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
rsprintf("<input type=\"text\" size=\"30\" maxlength=\"80\" name=\"%s\">\n",
|
rsprintf("<input type=\"text\" size=\"30\" maxlength=\"80\" name=\"%s\">\n",
|
||||||
attr_list[i]);
|
attr_list[i]);
|
||||||
rsprintf("<i>%s</i>\n", loc("(case insensitive substring)"));
|
rsprintf("<i>%s</i>\n", loc("(case insensitive substring)"));
|
||||||
@ -7214,11 +7237,13 @@ void show_find_form(LOGBOOK * lbs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"attribname\">%s:</td>", loc("Text"));
|
rsprintf("<tr><td class=\"attribname\">%s:</td>", loc("Text"));
|
||||||
rsprintf("<td class=\"attribvalue\"><input type=\"text\" size=\"30\" maxlength=\"80\" name=\"subtext\">\n");
|
rsprintf
|
||||||
|
("<td class=\"attribvalue\"><input type=\"text\" size=\"30\" maxlength=\"80\" name=\"subtext\">\n");
|
||||||
rsprintf("<i>%s</i></td></tr>\n", loc("(case insensitive substring)"));
|
rsprintf("<i>%s</i></td></tr>\n", loc("(case insensitive substring)"));
|
||||||
|
|
||||||
rsprintf("<tr><td><td class=\"attribvalue\"><input type=checkbox name=sall value=1>%s</td></tr>\n",
|
rsprintf
|
||||||
loc("Search text also in attributes"));
|
("<tr><td><td class=\"attribvalue\"><input type=checkbox name=sall value=1>%s</td></tr>\n",
|
||||||
|
loc("Search text also in attributes"));
|
||||||
|
|
||||||
rsprintf("</table></td></tr></table>\n");
|
rsprintf("</table></td></tr></table>\n");
|
||||||
show_bottom_text(lbs);
|
show_bottom_text(lbs);
|
||||||
@ -7492,7 +7517,8 @@ int save_admin_config(char *section, char *buffer, char *error)
|
|||||||
|
|
||||||
/* save tail */
|
/* save tail */
|
||||||
buf2 = NULL;
|
buf2 = NULL;
|
||||||
if (p2) {
|
|
||||||
|
if (p2) {
|
||||||
buf2 = malloc(strlen(p2) + 1);
|
buf2 = malloc(strlen(p2) + 1);
|
||||||
assert(buf2);
|
assert(buf2);
|
||||||
strlcpy(buf2, p2, strlen(p2) + 1);
|
strlcpy(buf2, p2, strlen(p2) + 1);
|
||||||
@ -9698,8 +9724,8 @@ void synchronize_logbook(LOGBOOK * lbs, BOOL bcron)
|
|||||||
|
|
||||||
if (_logging_level > 1)
|
if (_logging_level > 1)
|
||||||
logf(lbs, "MIRROR send entry #%d", message_id);
|
logf(lbs, "MIRROR send entry #%d", message_id);
|
||||||
|
|
||||||
remote_id = 0;
|
remote_id = 0;
|
||||||
if (!getcfg(lbs->name, "Mirror simulate", str) || atoi(str) == 0)
|
if (!getcfg(lbs->name, "Mirror simulate", str) || atoi(str) == 0)
|
||||||
remote_id = submit_message(lbs, list[index], message_id, error_str);
|
remote_id = submit_message(lbs, list[index], message_id, error_str);
|
||||||
all_identical = FALSE;
|
all_identical = FALSE;
|
||||||
@ -10190,8 +10216,9 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
else
|
else
|
||||||
strftime(str, sizeof(str), format, pts);
|
strftime(str, sizeof(str), format, pts);
|
||||||
|
|
||||||
rsprintf("<td class=\"%s\"><a href=\"%s\">%s</a></td>\n", sclass, ref, str);
|
rsprintf("<td class=\"%s\"><a href=\"%s\">%s</a></td>\n", sclass,
|
||||||
|
ref, str);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (attr_flags[i] & AF_ICON) {
|
else if (attr_flags[i] & AF_ICON) {
|
||||||
@ -10220,7 +10247,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 = 0; i < (int)sizeof(str) - 1; i++) {
|
for (i = i_line = 0; i < (int) sizeof(str) - 1; i++) {
|
||||||
str[i] = text[i];
|
str[i] = text[i];
|
||||||
if (str[i] == '\n')
|
if (str[i] == '\n')
|
||||||
i_line++;
|
i_line++;
|
||||||
@ -10249,7 +10276,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode,
|
|||||||
|
|
||||||
if ((strieq(mode, "Summary") && n_line > 0)) {
|
if ((strieq(mode, "Summary") && n_line > 0)) {
|
||||||
rsprintf("<td class=\"summary\">");
|
rsprintf("<td class=\"summary\">");
|
||||||
for (i = i_line = 0; i < (int)sizeof(str) - 1; i++) {
|
for (i = i_line = 0; i < (int) sizeof(str) - 1; i++) {
|
||||||
str[i] = text[i];
|
str[i] = text[i];
|
||||||
if (str[i] == '\n')
|
if (str[i] == '\n')
|
||||||
i_line++;
|
i_line++;
|
||||||
@ -10710,8 +10737,7 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
|
|||||||
else if (command[0]) {
|
else if (command[0]) {
|
||||||
n = strbreak(menu_str, menu_item, MAX_N_LIST);
|
n = strbreak(menu_str, menu_item, MAX_N_LIST);
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (strieq(command, menu_item[i]) ||
|
if (strieq(command, menu_item[i]) || strieq(command, loc(menu_item[i])))
|
||||||
strieq(command, loc(menu_item[i])))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i == n) {
|
if (i == n) {
|
||||||
@ -10753,11 +10779,12 @@ void build_ref(char *ref, int size, char *mode, char *expand)
|
|||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands, BOOL threaded)
|
void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
||||||
|
BOOL threaded)
|
||||||
{
|
{
|
||||||
int cur_exp, n, i, j, index;
|
int cur_exp, n, i, j, index;
|
||||||
char ref[256], str[NAME_LENGTH], comment[NAME_LENGTH],
|
char ref[256], str[NAME_LENGTH], comment[NAME_LENGTH],
|
||||||
list[MAX_N_LIST][NAME_LENGTH], option[NAME_LENGTH];
|
list[MAX_N_LIST][NAME_LENGTH], option[NAME_LENGTH];
|
||||||
|
|
||||||
rsprintf("<tr><td class=\"menuframe\">\n");
|
rsprintf("<tr><td class=\"menuframe\">\n");
|
||||||
rsprintf("<table width=\"100%%\" border=0 cellpadding=0 cellspacing=0>\n");
|
rsprintf("<table width=\"100%%\" border=0 cellpadding=0 cellspacing=0>\n");
|
||||||
@ -10841,9 +10868,12 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
|||||||
rsprintf("<option %s value=1>%s\n", i == 1 ? "selected" : "", loc("Day"));
|
rsprintf("<option %s value=1>%s\n", i == 1 ? "selected" : "", loc("Day"));
|
||||||
rsprintf("<option %s value=7>%s\n", i == 7 ? "selected" : "", loc("Week"));
|
rsprintf("<option %s value=7>%s\n", i == 7 ? "selected" : "", loc("Week"));
|
||||||
rsprintf("<option %s value=31>%s\n", i == 31 ? "selected" : "", loc("Month"));
|
rsprintf("<option %s value=31>%s\n", i == 31 ? "selected" : "", loc("Month"));
|
||||||
rsprintf("<option %s value=92>3 %s\n", i == 92 ? "selected" : "", loc("Months"));
|
rsprintf("<option %s value=92>3 %s\n", i == 92 ? "selected" : "",
|
||||||
rsprintf("<option %s value=182>6 %s\n", i == 182 ? "selected" : "", loc("Months"));
|
loc("Months"));
|
||||||
rsprintf("<option %s value=364>%s\n", i == 364 ? "selected" : "", loc("Year"));
|
rsprintf("<option %s value=182>6 %s\n", i == 182 ? "selected" : "",
|
||||||
|
loc("Months"));
|
||||||
|
rsprintf("<option %s value=364>%s\n", i == 364 ? "selected" : "",
|
||||||
|
loc("Year"));
|
||||||
|
|
||||||
rsprintf("</select>\n");
|
rsprintf("</select>\n");
|
||||||
} else {
|
} else {
|
||||||
@ -10854,7 +10884,7 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (attr_options[i][0][0] == 0) {
|
if (attr_options[i][0][0] == 0) {
|
||||||
|
|
||||||
if (attr_flags[i] & AF_DATE) {
|
if (attr_flags[i] & AF_DATE) {
|
||||||
|
|
||||||
rsprintf("<select name=\"%s\" onChange=\"document.form1.submit()\">\n",
|
rsprintf("<select name=\"%s\" onChange=\"document.form1.submit()\">\n",
|
||||||
@ -10863,26 +10893,38 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
|||||||
rsprintf("<option value=\"_all_\">%s\n", loc("All entries"));
|
rsprintf("<option value=\"_all_\">%s\n", loc("All entries"));
|
||||||
i = atoi(getparam(list[index]));
|
i = atoi(getparam(list[index]));
|
||||||
|
|
||||||
rsprintf("<option %s value=364>%s %s\n", i == 364 ? "selected" : "", loc("Next"), loc("Year"));
|
rsprintf("<option %s value=364>%s %s\n", i == 364 ? "selected" : "",
|
||||||
rsprintf("<option %s value=182>%s 6 %s\n", i == 182 ? "selected" : "", loc("Next"), loc("Months"));
|
loc("Next"), loc("Year"));
|
||||||
rsprintf("<option %s value=92>%s 3 %s\n", i == 92 ? "selected" : "", loc("Next"), loc("Months"));
|
rsprintf("<option %s value=182>%s 6 %s\n", i == 182 ? "selected" : "",
|
||||||
rsprintf("<option %s value=31>%s %s\n", i == 31 ? "selected" : "", loc("Next"), loc("Month"));
|
loc("Next"), loc("Months"));
|
||||||
rsprintf("<option %s value=7>%s %s\n", i == 7 ? "selected" : "", loc("Next"), loc("Week"));
|
rsprintf("<option %s value=92>%s 3 %s\n", i == 92 ? "selected" : "",
|
||||||
rsprintf("<option %s value=1>%s %s\n", i == 1 ? "selected" : "", loc("Next"), loc("Day"));
|
loc("Next"), loc("Months"));
|
||||||
|
rsprintf("<option %s value=31>%s %s\n", i == 31 ? "selected" : "",
|
||||||
|
loc("Next"), loc("Month"));
|
||||||
|
rsprintf("<option %s value=7>%s %s\n", i == 7 ? "selected" : "",
|
||||||
|
loc("Next"), loc("Week"));
|
||||||
|
rsprintf("<option %s value=1>%s %s\n", i == 1 ? "selected" : "",
|
||||||
|
loc("Next"), loc("Day"));
|
||||||
|
|
||||||
rsprintf("<option %s value=-1>%s %s\n", i == -1 ? "selected" : "", loc("Last"), loc("Day"));
|
rsprintf("<option %s value=-1>%s %s\n", i == -1 ? "selected" : "",
|
||||||
rsprintf("<option %s value=-7>%s %s\n", i == -7 ? "selected" : "", loc("Last"), loc("Week"));
|
loc("Last"), loc("Day"));
|
||||||
rsprintf("<option %s value=-31>%s %s\n", i == -31 ? "selected" : "", loc("Last"), loc("Month"));
|
rsprintf("<option %s value=-7>%s %s\n", i == -7 ? "selected" : "",
|
||||||
rsprintf("<option %s value=-92>%s 3 %s\n", i == -92 ? "selected" : "", loc("Last"), loc("Months"));
|
loc("Last"), loc("Week"));
|
||||||
rsprintf("<option %s value=-182>%s 6 %s\n", i == -182 ? "selected" : "", loc("Last"), loc("Months"));
|
rsprintf("<option %s value=-31>%s %s\n", i == -31 ? "selected" : "",
|
||||||
rsprintf("<option %s value=-364>%s %s\n", i == -364 ? "selected" : "", loc("Last"), loc("Year"));
|
loc("Last"), loc("Month"));
|
||||||
|
rsprintf("<option %s value=-92>%s 3 %s\n", i == -92 ? "selected" : "",
|
||||||
|
loc("Last"), loc("Months"));
|
||||||
|
rsprintf("<option %s value=-182>%s 6 %s\n", i == -182 ? "selected" : "",
|
||||||
|
loc("Last"), loc("Months"));
|
||||||
|
rsprintf("<option %s value=-364>%s %s\n", i == -364 ? "selected" : "",
|
||||||
|
loc("Last"), loc("Year"));
|
||||||
|
|
||||||
rsprintf("</select>\n");
|
rsprintf("</select>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
rsprintf("<input type=text onChange=\"document.form1.submit()\"");
|
rsprintf("<input type=text onChange=\"document.form1.submit()\"");
|
||||||
rsprintf(" name=\"%s\" value=\"%s\">\n",
|
rsprintf(" name=\"%s\" value=\"%s\">\n",
|
||||||
list[index], getparam(list[index]));
|
list[index], getparam(list[index]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -11114,9 +11156,9 @@ time_t retrieve_date(char *index, BOOL bstart)
|
|||||||
current_month = tms.tm_mon + 1;
|
current_month = tms.tm_mon + 1;
|
||||||
current_day = tms.tm_mday;
|
current_day = tms.tm_mday;
|
||||||
|
|
||||||
if (!*getparam(pm) && !*getparam(py) && !*getparam(pd))
|
if (!*getparam(pm) && !*getparam(py) && !*getparam(pd))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* if year not given, use current year */
|
/* if year not given, use current year */
|
||||||
if (!*getparam(py))
|
if (!*getparam(py))
|
||||||
year = current_year;
|
year = current_year;
|
||||||
@ -11137,7 +11179,7 @@ time_t retrieve_date(char *index, BOOL bstart)
|
|||||||
if (*getparam(pd))
|
if (*getparam(pd))
|
||||||
day = atoi(getparam(pd));
|
day = atoi(getparam(pd));
|
||||||
else {
|
else {
|
||||||
/* if day not given, use 1 if start date*/
|
/* if day not given, use 1 if start date */
|
||||||
if (bstart)
|
if (bstart)
|
||||||
day = 1;
|
day = 1;
|
||||||
else {
|
else {
|
||||||
@ -11224,7 +11266,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* redirect "go" command */
|
/* redirect "go" command */
|
||||||
if (isparam("lastcmd")) { //## and not copy to / move to / delete ...
|
if (isparam("lastcmd")) { //## and not copy to / move to / delete ...
|
||||||
|
|
||||||
strlcpy(str, getparam("lastcmd"), sizeof(str));
|
strlcpy(str, getparam("lastcmd"), sizeof(str));
|
||||||
url_decode(str);
|
url_decode(str);
|
||||||
@ -11268,7 +11310,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printable = atoi(getparam("Printable"));
|
printable = atoi(getparam("Printable"));
|
||||||
|
|
||||||
/* in printable mode, display all pages */
|
/* in printable mode, display all pages */
|
||||||
if (printable)
|
if (printable)
|
||||||
page_n = -1;
|
page_n = -1;
|
||||||
@ -11319,10 +11361,10 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
current_day = ptms->tm_mday;
|
current_day = ptms->tm_mday;
|
||||||
|
|
||||||
ltime_end = ltime_start = 0;
|
ltime_end = ltime_start = 0;
|
||||||
|
|
||||||
d1 = m1 = y1 = d2 = m2 = y2 = 0;
|
d1 = m1 = y1 = d2 = m2 = y2 = 0;
|
||||||
|
|
||||||
if (!past_n && !last_n) {
|
if (!past_n && !last_n) {
|
||||||
|
|
||||||
ltime_start = retrieve_date("a", TRUE);
|
ltime_start = retrieve_date("a", TRUE);
|
||||||
if (ltime_start < 0)
|
if (ltime_start < 0)
|
||||||
@ -11406,7 +11448,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
for (j = 0; j < *lbs_cur->n_el_index; j++) {
|
for (j = 0; j < *lbs_cur->n_el_index; j++) {
|
||||||
msg_list[n].lbs = lbs_cur;
|
msg_list[n].lbs = lbs_cur;
|
||||||
msg_list[n].index = j;
|
msg_list[n].index = j;
|
||||||
sprintf(msg_list[n].string, "%010d", (int)lbs_cur->el_index[j].file_time);
|
sprintf(msg_list[n].string, "%010d", (int) lbs_cur->el_index[j].file_time);
|
||||||
msg_list[n].in_reply_to = lbs_cur->el_index[j].in_reply_to;
|
msg_list[n].in_reply_to = lbs_cur->el_index[j].in_reply_to;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
@ -11522,12 +11564,12 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
|
|
||||||
/* negative i: last [i] days */
|
/* negative i: last [i] days */
|
||||||
if (ltime < 0)
|
if (ltime < 0)
|
||||||
if (atoi(attrib[i]) < now + ltime*3600*24 || atoi(attrib[i]) > now)
|
if (atoi(attrib[i]) < now + ltime * 3600 * 24 || atoi(attrib[i]) > now)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* positive i: next [i] days */
|
/* positive i: next [i] days */
|
||||||
if (ltime > 0)
|
if (ltime > 0)
|
||||||
if (atoi(attrib[i]) > now + ltime*3600*24 || atoi(attrib[i]) < now)
|
if (atoi(attrib[i]) > now + ltime * 3600 * 24 || atoi(attrib[i]) < now)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -11559,7 +11601,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
|
|
||||||
/* apply filter for AF_DATE attributes */
|
/* apply filter for AF_DATE attributes */
|
||||||
if (filtering)
|
if (filtering)
|
||||||
for (i = 0; i < lbs->n_attr; i++)
|
for (i = 0; i < lbs->n_attr; i++)
|
||||||
if (attr_flags[i] & AF_DATE) {
|
if (attr_flags[i] & AF_DATE) {
|
||||||
|
|
||||||
sprintf(str, "%da", i);
|
sprintf(str, "%da", i);
|
||||||
@ -11568,7 +11610,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
msg_list[index].lbs = NULL;
|
msg_list[index].lbs = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(str, "%db", i);
|
sprintf(str, "%db", i);
|
||||||
ltime = retrieve_date(str, FALSE);
|
ltime = retrieve_date(str, FALSE);
|
||||||
if (ltime > 0 && atoi(attrib[i]) > ltime) {
|
if (ltime > 0 && atoi(attrib[i]) > ltime) {
|
||||||
@ -11576,7 +11618,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*getparam("subtext")) {
|
if (*getparam("subtext")) {
|
||||||
strcpy(str, getparam("subtext"));
|
strcpy(str, getparam("subtext"));
|
||||||
for (i = 0; i < (int) strlen(str); i++)
|
for (i = 0; i < (int) strlen(str); i++)
|
||||||
@ -11696,8 +11738,8 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
qsort(msg_list, n_msg, sizeof(MSG_LIST), reverse ? msg_compare_reverse : msg_compare);
|
qsort(msg_list, n_msg, sizeof(MSG_LIST), reverse ? msg_compare_reverse : msg_compare);
|
||||||
|
|
||||||
/*---- number of messages per page ----*/
|
/*---- number of messages per page ----*/
|
||||||
|
|
||||||
n_attr_disp = n_line = 0;
|
n_attr_disp = n_line = 0;
|
||||||
n_page = 1000000;
|
n_page = 1000000;
|
||||||
i_start = 0;
|
i_start = 0;
|
||||||
i_stop = n_msg - 1;
|
i_stop = n_msg - 1;
|
||||||
@ -11908,7 +11950,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n)
|
|||||||
|| *getparam("subtext");
|
|| *getparam("subtext");
|
||||||
|
|
||||||
for (i = 0; i < lbs->n_attr; i++)
|
for (i = 0; i < lbs->n_attr; i++)
|
||||||
if (*getparam(attr_list[i]) && (attr_flags[i] & AF_DATE) == 0)
|
if (*getparam(attr_list[i]) && (attr_flags[i] & AF_DATE) == 0)
|
||||||
disp_filter = TRUE;
|
disp_filter = TRUE;
|
||||||
|
|
||||||
for (i = 0; i < lbs->n_attr; i++)
|
for (i = 0; i < lbs->n_attr; i++)
|
||||||
@ -12532,8 +12574,8 @@ int add_attribute_option(LOGBOOK * lbs, char *attrname, char *attrvalue)
|
|||||||
if (*(p2 - 1) == '\r')
|
if (*(p2 - 1) == '\r')
|
||||||
p2--;
|
p2--;
|
||||||
|
|
||||||
/* save tail */
|
/* save tail */
|
||||||
buf2 = NULL;
|
buf2 = NULL;
|
||||||
if (p2) {
|
if (p2) {
|
||||||
buf2 = malloc(strlen(p2) + 1);
|
buf2 = malloc(strlen(p2) + 1);
|
||||||
assert(buf2);
|
assert(buf2);
|
||||||
@ -13379,8 +13421,7 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
/* check for locked attributes */
|
/* check for locked attributes */
|
||||||
for (i = 0; i < lbs->n_attr; i++) {
|
for (i = 0; i < lbs->n_attr; i++) {
|
||||||
sprintf(lattr, "l%s", attr_list[i]);
|
sprintf(lattr, "l%s", attr_list[i]);
|
||||||
if (*getparam(lattr) == '1'
|
if (*getparam(lattr) == '1' && !strieq(getparam(attr_list[i]), attrib[i]))
|
||||||
&& !strieq(getparam(attr_list[i]), attrib[i]))
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i < lbs->n_attr)
|
if (i < lbs->n_attr)
|
||||||
@ -13427,8 +13468,8 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
|
|
||||||
if (message_id == 0)
|
if (message_id == 0)
|
||||||
message_id = el_search_message(lbs, EL_LAST, 0, FALSE);
|
message_id = el_search_message(lbs, EL_LAST, 0, FALSE);
|
||||||
|
|
||||||
status = 0;
|
status = 0;
|
||||||
if (message_id) {
|
if (message_id) {
|
||||||
size = sizeof(text);
|
size = sizeof(text);
|
||||||
status =
|
status =
|
||||||
@ -13828,7 +13869,8 @@ void show_elog_message(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
else
|
else
|
||||||
strftime(str, sizeof(str), format, pts);
|
strftime(str, sizeof(str), format, pts);
|
||||||
|
|
||||||
rsprintf("%s:</td><td class=\"%s\">%s </td>\n", attr_list[i], class_value, str);
|
rsprintf("%s:</td><td class=\"%s\">%s </td>\n", attr_list[i], class_value,
|
||||||
|
str);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rsprintf("%s:</td><td class=\"%s\">\n", attr_list[i], class_value);
|
rsprintf("%s:</td><td class=\"%s\">\n", attr_list[i], class_value);
|
||||||
@ -14372,8 +14414,7 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
|
|||||||
expand = 0;
|
expand = 0;
|
||||||
if (isparam("gexp")) {
|
if (isparam("gexp")) {
|
||||||
if (strieq(plb->name, getparam("gexp")) ||
|
if (strieq(plb->name, getparam("gexp")) ||
|
||||||
node_contains(plb, getparam("gexp")) ||
|
node_contains(plb, getparam("gexp")) || strieq(getparam("gexp"), "all"))
|
||||||
strieq(getparam("gexp"), "all"))
|
|
||||||
expand = 1;
|
expand = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14735,16 +14776,16 @@ void show_calendar(LOGBOOK * lbs)
|
|||||||
/* link to previous year */
|
/* link to previous year */
|
||||||
rsprintf(" ");
|
rsprintf(" ");
|
||||||
rsprintf("<a href=\"?i=%s&m=%d&y=%d\">", index, cur_mon, cur_year - 1);
|
rsprintf("<a href=\"?i=%s&m=%d&y=%d\">", index, cur_mon, cur_year - 1);
|
||||||
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_prev.gif\" alt=\"%s\"></a>",
|
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_prev.gif\" alt=\"%s\"></a>",
|
||||||
loc("Previous Year"));
|
loc("Previous Year"));
|
||||||
|
|
||||||
/* current year */
|
/* current year */
|
||||||
rsprintf(" %d ", cur_year);
|
rsprintf(" %d ", cur_year);
|
||||||
|
|
||||||
/* link to next year */
|
/* link to next year */
|
||||||
rsprintf("<a href=\"?i=%s&m=%d&y=%d\">", index, cur_mon, cur_year + 1);
|
rsprintf("<a href=\"?i=%s&m=%d&y=%d\">", index, cur_mon, cur_year + 1);
|
||||||
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_next.gif\" alt=\"%s\"></a>",
|
rsprintf("<img border=0 align=\"absmiddle\" src=\"cal_next.gif\" alt=\"%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;
|
||||||
@ -15470,7 +15511,7 @@ void interprete(char *lbook, char *path)
|
|||||||
} else
|
} else
|
||||||
strlcpy(section, lbs->name, sizeof(section));
|
strlcpy(section, lbs->name, sizeof(section));
|
||||||
|
|
||||||
if (!save_admin_config(section, _mtext, str)) { /* save cfg file */
|
if (!save_admin_config(section, _mtext, str)) { /* save cfg file */
|
||||||
show_error(str);
|
show_error(str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -15869,7 +15910,8 @@ void ctrlc_handler(int sig)
|
|||||||
|
|
||||||
void hup_handler(int sig)
|
void hup_handler(int sig)
|
||||||
{
|
{
|
||||||
_hup = TRUE;
|
|
||||||
|
_hup = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
@ -15895,8 +15937,8 @@ void server_loop(int tcp_port, int daemon)
|
|||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
char *net_buffer = NULL;
|
char *net_buffer = NULL;
|
||||||
int net_buffer_size;
|
int net_buffer_size;
|
||||||
|
|
||||||
i_conn = content_length = 0;
|
i_conn = content_length = 0;
|
||||||
net_buffer_size = 100000;
|
net_buffer_size = 100000;
|
||||||
net_buffer = malloc(net_buffer_size);
|
net_buffer = malloc(net_buffer_size);
|
||||||
return_buffer_size = 100000;
|
return_buffer_size = 100000;
|
||||||
@ -16465,22 +16507,20 @@ void server_loop(int tcp_port, int daemon)
|
|||||||
n = strbreak(list, host_list, MAX_N_LIST);
|
n = strbreak(list, host_list, MAX_N_LIST);
|
||||||
/* check if current connection matches anyone on the list */
|
/* check if current connection matches anyone on the list */
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
if (strieq(rem_host, host_list[i]) ||
|
if (strieq(rem_host, host_list[i]) || strieq(rem_host_ip, host_list[i])
|
||||||
strieq(rem_host_ip, host_list[i])
|
|
||||||
|| strieq(host_list[i], "all")) {
|
|| strieq(host_list[i], "all")) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf
|
printf
|
||||||
("Remote host \"%s\" matches \"%s\" in \"Hosts deny\". Access denied.\n",
|
("Remote host \"%s\" matches \"%s\" in \"Hosts deny\". Access denied.\n",
|
||||||
strieq(rem_host_ip,
|
strieq(rem_host_ip,
|
||||||
host_list[i]) ? rem_host_ip : rem_host,
|
host_list[i]) ? rem_host_ip : rem_host, host_list[i]);
|
||||||
host_list[i]);
|
|
||||||
authorized = 0;
|
authorized = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (host_list[i][0] == '.') {
|
if (host_list[i][0] == '.') {
|
||||||
if (strlen(rem_host) > strlen(host_list[i]) &&
|
if (strlen(rem_host) > strlen(host_list[i]) &&
|
||||||
strieq(host_list[i],
|
strieq(host_list[i],
|
||||||
rem_host + strlen(rem_host) - strlen(host_list[i]))) {
|
rem_host + strlen(rem_host) - strlen(host_list[i]))) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf
|
printf
|
||||||
("Remote host \"%s\" matches \"%s\" in \"Hosts deny\". Access denied.\n",
|
("Remote host \"%s\" matches \"%s\" in \"Hosts deny\". Access denied.\n",
|
||||||
@ -16512,22 +16552,20 @@ void server_loop(int tcp_port, int daemon)
|
|||||||
n = strbreak(list, host_list, MAX_N_LIST);
|
n = strbreak(list, host_list, MAX_N_LIST);
|
||||||
/* check if current connection matches anyone on the list */
|
/* check if current connection matches anyone on the list */
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
if (strieq(rem_host, host_list[i]) ||
|
if (strieq(rem_host, host_list[i]) || strieq(rem_host_ip, host_list[i])
|
||||||
strieq(rem_host_ip, host_list[i])
|
|
||||||
|| strieq(host_list[i], "all")) {
|
|| strieq(host_list[i], "all")) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf
|
printf
|
||||||
("Remote host \"%s\" matches \"%s\" in \"Hosts allow\". Access granted.\n",
|
("Remote host \"%s\" matches \"%s\" in \"Hosts allow\". Access granted.\n",
|
||||||
strieq(rem_host_ip,
|
strieq(rem_host_ip,
|
||||||
host_list[i]) ? rem_host_ip : rem_host,
|
host_list[i]) ? rem_host_ip : rem_host, host_list[i]);
|
||||||
host_list[i]);
|
|
||||||
authorized = 1;
|
authorized = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (host_list[i][0] == '.') {
|
if (host_list[i][0] == '.') {
|
||||||
if (strlen(rem_host) > strlen(host_list[i]) &&
|
if (strlen(rem_host) > strlen(host_list[i]) &&
|
||||||
strieq(host_list[i],
|
strieq(host_list[i],
|
||||||
rem_host + strlen(rem_host) - strlen(host_list[i]))) {
|
rem_host + strlen(rem_host) - strlen(host_list[i]))) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf
|
printf
|
||||||
("Remote host \"%s\" matches \"%s\" in \"Hosts allow\". Access granted.\n",
|
("Remote host \"%s\" matches \"%s\" in \"Hosts allow\". Access granted.\n",
|
||||||
@ -16641,10 +16679,10 @@ void server_loop(int tcp_port, int daemon)
|
|||||||
if (return_length != -1) {
|
if (return_length != -1) {
|
||||||
if (return_length == 0)
|
if (return_length == 0)
|
||||||
return_length = strlen_retbuf;
|
return_length = strlen_retbuf;
|
||||||
if ((keep_alive
|
if ((keep_alive && strstr(return_buffer, "Content-Length") == NULL)
|
||||||
&& strstr(return_buffer, "Content-Length") == NULL)
|
|
||||||
|| strstr(return_buffer, "Content-Length") >
|
|| strstr(return_buffer, "Content-Length") >
|
||||||
strstr(return_buffer, "\r\n\r\n")) {
|
strstr(return_buffer,
|
||||||
|
"\r\n\r\n")) {
|
||||||
/*---- add content-length ----*/
|
/*---- add content-length ----*/
|
||||||
|
|
||||||
p = strstr(return_buffer, "\r\n\r\n");
|
p = strstr(return_buffer, "\r\n\r\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user