mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Fixed problems with "Fix text = 1"
SVN revision: 2254
This commit is contained in:
parent
9aaf751db1
commit
35149d289e
51
src/elogd.c
51
src/elogd.c
@ -9138,7 +9138,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
int i, j, n, index, aindex, size, width, height, fh, length, input_size, input_maxlen,
|
int i, j, n, index, aindex, size, width, height, fh, length, input_size, input_maxlen,
|
||||||
format_flags[MAX_N_ATTR], year, month, day, hour, min, sec, n_attr, n_disp_attr, n_lines,
|
format_flags[MAX_N_ATTR], year, month, day, hour, min, sec, n_attr, n_disp_attr, n_lines,
|
||||||
attr_index[MAX_N_ATTR], enc_selected, show_smileys, show_text, n_moptions, display_inline,
|
attr_index[MAX_N_ATTR], enc_selected, show_smileys, show_text, n_moptions, display_inline,
|
||||||
allowed_encoding, thumb_status, max_n_lines;
|
allowed_encoding, thumb_status, max_n_lines, fixed_text;
|
||||||
char str[2 * NAME_LENGTH], str2[NAME_LENGTH], preset[2 * NAME_LENGTH], *p, *pend, star[80],
|
char str[2 * NAME_LENGTH], str2[NAME_LENGTH], preset[2 * NAME_LENGTH], *p, *pend, star[80],
|
||||||
comment[10000], reply_string[256], list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer,
|
comment[10000], reply_string[256], list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer,
|
||||||
format[256], date[80], script_onload[256], script_onfocus[256], script_onunload[256],
|
format[256], date[80], script_onload[256], script_onfocus[256], script_onunload[256],
|
||||||
@ -9858,8 +9858,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("<script type=\"text/javascript\" src=\"../elcode.js\"></script>\n\n");
|
rsprintf("<script type=\"text/javascript\" src=\"../elcode.js\"></script>\n\n");
|
||||||
|
|
||||||
show_text = !getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1;
|
show_text = !getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1;
|
||||||
|
fixed_text = getcfg(lbs->name, "Fix text", str, sizeof(str)) && atoi(str) == 1 && bedit && message_id;
|
||||||
|
|
||||||
if (enc_selected == 2 && fckedit_exist && show_text) {
|
if (enc_selected == 2 && fckedit_exist && show_text && !fixed_text) {
|
||||||
rsprintf("<script type=\"text/javascript\" src=\"../fckeditor/fckeditor.js\"></script>\n");
|
rsprintf("<script type=\"text/javascript\" src=\"../fckeditor/fckeditor.js\"></script>\n");
|
||||||
rsprintf("<script type=\"text/javascript\">\n");
|
rsprintf("<script type=\"text/javascript\">\n");
|
||||||
/* define strings for current language */
|
/* define strings for current language */
|
||||||
@ -10699,7 +10700,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bpreview) {
|
if (bpreview && !fixed_text) {
|
||||||
_current_message_id = message_id;
|
_current_message_id = message_id;
|
||||||
rsprintf("<tr><td colspan=2 class=\"messageframe\">\n");
|
rsprintf("<tr><td colspan=2 class=\"messageframe\">\n");
|
||||||
|
|
||||||
@ -10715,7 +10716,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enc_selected == 0 && show_text) {
|
if (enc_selected == 0 && show_text && !fixed_text) {
|
||||||
rsprintf("<tr><td colspan=2 class=\"toolframe\">\n");
|
rsprintf("<tr><td colspan=2 class=\"toolframe\">\n");
|
||||||
|
|
||||||
ricon("bold", loc("Bold text CTRL+B"), "elcode(document.form1.Text, 'B','')");
|
ricon("bold", loc("Bold text CTRL+B"), "elcode(document.form1.Text, 'B','')");
|
||||||
@ -10841,7 +10842,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("</td>\n");
|
rsprintf("</td>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enc_selected == 0)
|
if (enc_selected == 0 && !fixed_text)
|
||||||
rsprintf("<td width=\"100%%\" class=\"attribvalue\">\n");
|
rsprintf("<td width=\"100%%\" class=\"attribvalue\">\n");
|
||||||
|
|
||||||
/* set textarea width */
|
/* set textarea width */
|
||||||
@ -10925,10 +10926,33 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
|
|
||||||
if (show_text) {
|
if (show_text) {
|
||||||
|
|
||||||
if (getcfg(lbs->name, "Fix text", str, sizeof(str)) && atoi(str) == 1)
|
if (fixed_text) {
|
||||||
strcpy(str, " readonly");
|
|
||||||
|
rsprintf("<input type=hidden name=\"text\" value=\"<keep>\">\n");
|
||||||
|
rsprintf("<input type=hidden name=\"encoding\" value=\"%s\">\n", encoding);
|
||||||
|
|
||||||
|
_current_message_id = message_id;
|
||||||
|
rsprintf("<tr><td colspan=2 class=\"messageframe\">\n");
|
||||||
|
|
||||||
|
if (strieq(text, "<keep>") && message_id) {
|
||||||
|
size = TEXT_SIZE;
|
||||||
|
el_retrieve(lbs, message_id, NULL, NULL, NULL, 0, text, &size, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strieq(encoding, "plain")) {
|
||||||
|
rsputs("<pre class=\"messagepre\">");
|
||||||
|
rsputs2(lbs, FALSE, text);
|
||||||
|
rsputs("</pre>");
|
||||||
|
} else if (strieq(encoding, "ELCode"))
|
||||||
|
rsputs_elcode(lbs, FALSE, text);
|
||||||
else
|
else
|
||||||
strcpy(str, "");
|
rsputs(text);
|
||||||
|
|
||||||
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
|
rsprintf("<tr><td colspan=2 width=\"100%%\" class=\"attribvalue\">\n");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if (enc_selected == 1)
|
if (enc_selected == 1)
|
||||||
/* use hard wrapping only for plain text */
|
/* use hard wrapping only for plain text */
|
||||||
@ -11169,6 +11193,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
|
|
||||||
rsprintf("<br>\n");
|
rsprintf("<br>\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Suppress email check box */
|
/* Suppress email check box */
|
||||||
if (message_id && bedit)
|
if (message_id && bedit)
|
||||||
@ -27691,7 +27716,7 @@ SSL_CTX *init_ssl(void)
|
|||||||
eprintf("Cerificate file \"%s\" not found, aborting\n", str);
|
eprintf("Cerificate file \"%s\" not found, aborting\n", str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (SSL_CTX_use_certificate_file(ctx, str, SSL_FILETYPE_PEM) < 0)
|
if (SSL_CTX_use_certificate_file(ctx, str, SSL_FILETYPE_PEM) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
strlcpy(str, resource_dir, sizeof(str));
|
strlcpy(str, resource_dir, sizeof(str));
|
||||||
@ -27700,15 +27725,17 @@ SSL_CTX *init_ssl(void)
|
|||||||
eprintf("Key file \"%s\" not found, aborting\n", str);
|
eprintf("Key file \"%s\" not found, aborting\n", str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (SSL_CTX_use_PrivateKey_file(ctx, str, SSL_FILETYPE_PEM) < 0)
|
if (SSL_CTX_use_PrivateKey_file(ctx, str, SSL_FILETYPE_PEM) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (SSL_CTX_check_private_key(ctx) < 0)
|
if (SSL_CTX_check_private_key(ctx) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
strlcpy(str, resource_dir, sizeof(str));
|
strlcpy(str, resource_dir, sizeof(str));
|
||||||
strlcat(str, "ssl/chain.crt", sizeof(str));
|
strlcat(str, "ssl/chain.crt", sizeof(str));
|
||||||
if (file_exist(str))
|
if (file_exist(str)) {
|
||||||
SSL_CTX_use_certificate_chain_file(ctx, str);
|
if (SSL_CTX_use_certificate_chain_file(ctx, str) == 0)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user