mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Implemented "bottom text login"
SVN revision: 1688
This commit is contained in:
parent
db3f0a98cc
commit
e9f641086f
@ -833,6 +833,12 @@ present in the resource directory. Alternatively, an absolute path can be used
|
|||||||
if the file name starts with a <b><code>"/"</code></b> (Unix) or <b><code>
|
if the file name starts with a <b><code>"/"</code></b> (Unix) or <b><code>
|
||||||
"\"</code></b> or <b><code>"x:"</code></b> (Windows).
|
"\"</code></b> or <b><code>"x:"</code></b> (Windows).
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>Bottom text login = <file> | <string></code></b><br>
|
||||||
|
The same as <b><code>Bottom text</code></b> but for the login page. This
|
||||||
|
allows to display a different text at the bottom of the login page. It
|
||||||
|
can also be used to execute some JavaScript.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Help URL = <URL></code></b><br>
|
<b><code>Help URL = <URL></code></b><br>
|
||||||
This URL is used for the Help button. By default, the file
|
This URL is used for the Help button. By default, the file
|
||||||
|
|||||||
@ -118,6 +118,10 @@ email.
|
|||||||
time to time.</td>
|
time to time.</td>
|
||||||
<td>1</td>
|
<td>1</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<td>"Incremental" options. Have fixed set of global options, and in each logbook
|
||||||
|
add or remove some of those with <b>+Options = ...</b> or <b>-Options = ...</b></td>
|
||||||
|
<td>1</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
|
|||||||
54
src/elogd.c
54
src/elogd.c
@ -7365,6 +7365,56 @@ void show_bottom_text(LOGBOOK * lbs)
|
|||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void show_bottom_text_login(LOGBOOK * lbs)
|
||||||
|
{
|
||||||
|
char str[NAME_LENGTH], slist[20][NAME_LENGTH], svalue[20][NAME_LENGTH];
|
||||||
|
int i, size;
|
||||||
|
|
||||||
|
if (getcfg(lbs->name, "bottom text login", str, sizeof(str))) {
|
||||||
|
FILE *f;
|
||||||
|
char file_name[256], *buf;
|
||||||
|
|
||||||
|
if (str[0]) {
|
||||||
|
/* check if file starts with an absolute directory */
|
||||||
|
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||||
|
strcpy(file_name, str);
|
||||||
|
else {
|
||||||
|
strlcpy(file_name, resource_dir, sizeof(file_name));
|
||||||
|
strlcat(file_name, str, sizeof(file_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
f = fopen(file_name, "rb");
|
||||||
|
if (f != NULL) {
|
||||||
|
fseek(f, 0, SEEK_END);
|
||||||
|
size = TELL(fileno(f));
|
||||||
|
fseek(f, 0, SEEK_SET);
|
||||||
|
|
||||||
|
buf = xmalloc(size + 100);
|
||||||
|
fread(buf, 1, size, f);
|
||||||
|
buf[size] = 0;
|
||||||
|
fclose(f);
|
||||||
|
|
||||||
|
i = build_subst_list(lbs, slist, svalue, NULL, TRUE);
|
||||||
|
strsubst_list(buf, size+100, slist, svalue, i);
|
||||||
|
|
||||||
|
rsputs(buf);
|
||||||
|
xfree(buf);
|
||||||
|
} else {
|
||||||
|
i = build_subst_list(lbs, slist, svalue, NULL, TRUE);
|
||||||
|
strsubst_list(str, sizeof(str), slist, svalue, i);
|
||||||
|
|
||||||
|
rsputs(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
/* add little logo */
|
||||||
|
rsprintf
|
||||||
|
("<center><a class=\"bottomlink\" title=\"%s\" href=\"http://midas.psi.ch/elog/\">ELOG V%s-%d</a></center>",
|
||||||
|
loc("Goto ELOG home page"), VERSION, atoi(svn_revision + 13));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
void show_error(char *error)
|
void show_error(char *error)
|
||||||
{
|
{
|
||||||
/* header */
|
/* header */
|
||||||
@ -21406,9 +21456,7 @@ BOOL check_user_password(LOGBOOK * lbs, char *user, char *password, char *redir)
|
|||||||
|
|
||||||
rsprintf("</table>\n");
|
rsprintf("</table>\n");
|
||||||
|
|
||||||
rsprintf
|
show_bottom_text_login(lbs);
|
||||||
("<center><a class=\"bottomlink\" href=\"http://midas.psi.ch/elog/\">ELOG V%s</a></center>",
|
|
||||||
VERSION);
|
|
||||||
|
|
||||||
rsprintf("</form></body></html>\r\n");
|
rsprintf("</form></body></html>\r\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user