Files can be specified with absolute path

SVN revision: 279
This commit is contained in:
2002-11-06 08:59:19 +00:00
parent 362fe3041c
commit 88fdcd3c65
3 changed files with 80 additions and 19 deletions
+2
View File
@@ -9,6 +9,8 @@ Version 2.2.2, released Nobember xxth, 2002
- Made "Allow <command> = <user>" 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
==========================================
+25 -5
View File
@@ -128,7 +128,11 @@ contents of the tab.
<br>
This optional HTML code gets displayed in the title of the logbook selection
page. It can contain images via <b><code>&lt;img src="welcome.gif"&gt;</code></b>.
These images must be in the same directory as the elodg.cfg file.
These images must be in the same directory as the <b><code>elodg.cfg</b></code> file.
Alternatively, an absolute path can be used if the file name starts with a
<b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>"x:"</code></b>
(Windows).<br><br>
The following line is an example Welcome Title:<br>
<br>
<pre>Welcome title = &lt;img src="welcome.jpg"&gt;&lt;p&gt;&lt;font size=5 color=white&gt;Welcome to our Elog&lt;/font&gt;</pre>
@@ -145,8 +149,12 @@ used by most browsers for bookmark names.
<LI><b><code>Selection page = &lt;file&gt;</code></b>
<br>
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 <code><b>elogd</b></code>
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 <code><b>elogd.cfg</b></code>
file. Alternatively, an absolute path can be used if the file name starts with a
<b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>"x:"</code></b>
(Windows).<br><br>
It can be completely customized in order to contain logos etc. As a template,
the standard selection page produced by <code><b>elogd</b></code> can be used.
<p>
@@ -251,6 +259,9 @@ messages of for logbook queries. Here is a simple example of such a file:
</pre>
The file must be present in the same directory as the <code><b>elogd</b></code> file.
Alternatively, an absolute path can be used if the file name starts with a
<b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>"x:"</code></b>
(Windows).
<p>
<LI><b><code>Start page = &lt;command&gt;</code></b>
@@ -279,6 +290,9 @@ Here is an example:
</pre>
The file must be present in the same directory as the <code><b>elogd</b></code> file.
Alternatively, an absolute path can be used if the file name starts with a
<b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>"x:"</code></b>
(Windows).
<p>
<li><b><code>Message comment = &lt;comment&gt;</code></b>
@@ -371,8 +385,11 @@ example a link back to the main logbook selection page like:
&lt;center&gt;&lt;a href="/"&gt;Main page&lt;/a&gt;&lt;/center&gt;
</pre>
Or it can contain other useful links. The file must be present in the same directory
as the <code><b>elogd</b></code> file.
Or it can contain other useful links. The file must be present in the same directory as the
<code><b>elogd.cfg</b></code> file. Alternatively, an absolute path can be used if the file
name starts with a <b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>
"x:"</code></b> (Windows).
<p>
<li><b><code>Help URL = &lt;URL&gt;</code></b>
@@ -491,6 +508,9 @@ down box by default.
<br>
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 <code><b>elogd.cfg</b></code> file.
Alternatively, an absolute path can be used if the file name starts with a
<b><code>"/"</code></b> (Unix) or <b><code>"\"</code></b> or <b><code>"x:"</code></b>
(Windows).
<p>
<LI><b><code>Locked Attributes = &lt;list&gt;</code></b>
+53 -14
View File
@@ -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;
}