diff --git a/elogd.c b/elogd.c index 1fb94ae9..6fa1a23a 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.92 2002/11/04 16:20:26 midas + Made 'allow = ' work in localized versions + Revision 2.91 2002/11/04 12:56:25 midas Fixed bug selecting messages in other languages @@ -377,7 +380,7 @@ \********************************************************************/ /* Version of ELOG */ -#define VERSION "2.2.1" +#define VERSION "2.2.2" #include #include @@ -1367,6 +1370,31 @@ static char old_language[256]; return orig; } +/*-------------------------------------------------------------------*/ + +/* translate back from localized string to english */ + +char *unloc(char *orig) +{ +int n; + + if (!locbuffer) + return orig; + + /* search string and return translation */ + for (n = 0; ptrans[n] ; n++) + if (strcmp(orig, ptrans[n]) == 0) + { + if (*porig[n]) + return porig[n]; + return orig; + } + + printf("Language error: string \"%s\" not found\n", orig); + + return orig; +} + /*------------------------------------------------------------------*/ /* Parameter extraction from themes file */ @@ -2668,7 +2696,8 @@ int size, status; /*------------------------------------------------------------------*/ INT el_delete_message(LOGBOOK *lbs, int message_id, BOOL delete_attachments, - char attachment[MAX_ATTACHMENTS][256], BOOL delete_bw_ref) + char attachment[MAX_ATTACHMENTS][256], BOOL delete_bw_ref, + BOOL delete_reply_to) /********************************************************************\ Routine: el_delete_message @@ -2681,6 +2710,7 @@ INT el_delete_message(LOGBOOK *lbs, int message_id, BOOL delete_attachments, BOOL delete_attachments Delete attachments if TRUE char attachment Used to return attachments (on move) BOOL delete_bw_ref If true, delete backward references + BOOL delete_reply_to If true, delete replies to this message Output: @@ -2724,7 +2754,7 @@ char message[TEXT_SIZE+1000], attachment_all[64*MAX_ATTACHMENTS]; /* file might have been edited, rebuild index */ el_build_index(lbs, TRUE); return el_delete_message(lbs, message_id, delete_attachments, - attachment, delete_bw_ref); + attachment, delete_bw_ref, delete_reply_to); } /* check for correct ID */ @@ -2835,14 +2865,14 @@ char message[TEXT_SIZE+1000], attachment_all[64*MAX_ATTACHMENTS]; lb_list[i].el_index = lbs->el_index; /* delete also replies to this message */ - if (reply_to[0]) + if (delete_reply_to && reply_to[0]) { p = reply_to; if (isdigit(*p)) do { if (atoi(p)) - el_delete_message(lbs, atoi(p), TRUE, NULL, FALSE); + el_delete_message(lbs, atoi(p), TRUE, NULL, FALSE, TRUE); while (*p && isdigit(*p)) p++; @@ -4045,7 +4075,7 @@ int i, n; } /* check for allow */ - sprintf(str, "Allow %s", command); + sprintf(str, "Allow %s", unloc(command)); if (!getcfg(lbs->name, str, users)) return TRUE; @@ -4090,7 +4120,7 @@ char str[80], date[80], attrib[MAX_N_ATTR][NAME_LENGTH], void show_elog_new(LOGBOOK *lbs, int message_id, BOOL bedit) { -int i, j, n, index, size, width, fh, length; +int i, j, n, index, size, width, height, fh, length; char str[1000], preset[1000], *p, star[80], comment[10000]; char list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer, format[256]; char date[80], attrib[MAX_N_ATTR][NAME_LENGTH], text[TEXT_SIZE], @@ -4464,6 +4494,11 @@ time_t now; if (message_id && !bedit) width += 2; + /* set textarea height */ + height = 20; + if (getcfg(lbs->name, "Message height", str)) + height = atoi(str); + rsprintf("\n"); if (getcfg(lbs->name, "Message comment", comment) && !bedit && !message_id) @@ -4474,7 +4509,7 @@ time_t now; if (!getcfg(lbs->name, "Show text", str) || atoi(str) == 1) { - rsprintf("