diff --git a/doc/CHANGELOG.TXT b/doc/CHANGELOG.TXT index 4e4b8dbe..98e2f01f 100755 --- a/doc/CHANGELOG.TXT +++ b/doc/CHANGELOG.TXT @@ -9,6 +9,8 @@ Version 2.2.2, released Nobember xxth, 2002 - Made "Allow = " work in localized versions - Move whole thread when individual message is re-submitted - Do not display commands which are not allowed for the current user +- All text files (preset text, welcome page, ...) can specified with an + absolute path if they start with "/" (or "\" under Windows) Version 2.2.1, released October 15th, 2002 ========================================== diff --git a/doc/config.html b/doc/config.html index b15a6c44..e0519563 100755 --- a/doc/config.html +++ b/doc/config.html @@ -128,7 +128,11 @@ contents of the tab.
This optional HTML code gets displayed in the title of the logbook selection page. It can contain images via <img src="welcome.gif">. -These images must be in the same directory as the elodg.cfg file. +These images must be in the same directory as the elodg.cfg file. +Alternatively, an absolute path can be used if the file name starts with a +"/" (Unix) or "\" or "x:" +(Windows).

+ The following line is an example Welcome Title:

Welcome title = <img src="welcome.jpg"><p><font size=5 color=white>Welcome to our Elog</font>
@@ -145,8 +149,12 @@ used by most browsers for bookmark names.
  • Selection page = <file>
    When this option is present, a user defined file is displayed instead of the logbook -selection page. This file must be in the same directory as the elogd -file. It can be completely customized in order to contain logos etc. As a template, +selection page. This file must be in the same directory as the elogd.cfg +file. Alternatively, an absolute path can be used if the file name starts with a +"/" (Unix) or "\" or "x:" +(Windows).

    + +It can be completely customized in order to contain logos etc. As a template, the standard selection page produced by elogd can be used.

    @@ -251,6 +259,9 @@ messages of for logbook queries. Here is a simple example of such a file: The file must be present in the same directory as the elogd file. +Alternatively, an absolute path can be used if the file name starts with a +"/" (Unix) or "\" or "x:" +(Windows).

  • Start page = <command> @@ -279,6 +290,9 @@ Here is an example: The file must be present in the same directory as the elogd file. +Alternatively, an absolute path can be used if the file name starts with a +"/" (Unix) or "\" or "x:" +(Windows).

  • Message comment = <comment> @@ -371,8 +385,11 @@ example a link back to the main logbook selection page like: <center><a href="/">Main page</a></center> -Or it can contain other useful links. The file must be present in the same directory -as the elogd file. +Or it can contain other useful links. The file must be present in the same directory as the +elogd.cfg file. Alternatively, an absolute path can be used if the file +name starts with a "/" (Unix) or "\" or +"x:" (Windows). +

  • Help URL = <URL> @@ -491,6 +508,9 @@ down box by default.
    This preset value is used for the main body text. It can be a string or a file, which must be present in the same directory as the elogd.cfg file. +Alternatively, an absolute path can be used if the file name starts with a +"/" (Unix) or "\" or "x:" +(Windows).

  • Locked Attributes = <list> diff --git a/elogd.c b/elogd.c index 7d1f3aeb..4ad05680 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.95 2002/11/06 08:59:18 midas + Files can be specified with absolute path + Revision 2.94 2002/11/05 15:40:58 midas Hide non-allowed commands @@ -4678,10 +4681,16 @@ time_t now; if (!message_id && getcfg(lbs->name, "Preset text", str)) { - /* check if file */ - strcpy(file_name, cfg_dir); - strcat(file_name, str); - + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } + + /* check if file exists */ fh = open(file_name, O_RDONLY | O_BINARY); if (fh > 0) { @@ -7671,8 +7680,14 @@ MSG_LIST *msg_list; FILE *f; char file_name[256], *buf; - strcpy(file_name, cfg_dir); - strcat(file_name, str); + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } f = fopen(file_name, "r"); if (f != NULL) @@ -8048,8 +8063,14 @@ int i, j, n, missing, first, index, n_mail, suppress, message_id, resubmit_or if (getcfg(lbs->name, "Submit page", str)) { - strcpy(file_name, cfg_dir); - strcat(file_name, str); + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } send_file(file_name); return; } @@ -8992,8 +9013,14 @@ BOOL first; FILE *f; char file_name[256], *buf; - strcpy(file_name, cfg_dir); - strcat(file_name, str); + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } f = fopen(file_name, "r"); if (f != NULL) @@ -9482,8 +9509,14 @@ FILE *f; /* check for global selection page if no logbook given */ if (!logbook[0] && getcfg("global", "Selection page", str)) { - strcpy(file_name, cfg_dir); - strcat(file_name, str); + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } send_file(file_name); return; } @@ -10096,8 +10129,14 @@ FILE *f; /* check for welcome page */ if (!_cmdline[0] && getcfg(lbs->name, "Welcome page", str) && str[0]) { - strcpy(file_name, cfg_dir); - strcat(file_name, str); + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } send_file(file_name); return; }