mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Strip ANY logbook in new redirection method
SVN revision: 1650
This commit is contained in:
parent
c35ee65a0c
commit
5cf2d03ca9
10
src/elogd.c
10
src/elogd.c
@ -6190,6 +6190,7 @@ void compose_base_url(LOGBOOK * lbs, char *base_url, int size)
|
|||||||
void set_location(LOGBOOK * lbs, char *rel_path)
|
void set_location(LOGBOOK * lbs, char *rel_path)
|
||||||
{
|
{
|
||||||
char str[NAME_LENGTH], *p;
|
char str[NAME_LENGTH], *p;
|
||||||
|
int i;
|
||||||
|
|
||||||
/* if path contains http(s), go directly there */
|
/* if path contains http(s), go directly there */
|
||||||
if (strncmp(rel_path, "http://", 7) == 0) {
|
if (strncmp(rel_path, "http://", 7) == 0) {
|
||||||
@ -6229,9 +6230,12 @@ void set_location(LOGBOOK * lbs, char *rel_path)
|
|||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
/* if last subdir equals logbook name, strip it */
|
/* if last subdir equals any logbook name, strip it */
|
||||||
if (lbs && stricmp(p, lbs->name_enc) == 0)
|
for (i = 0; lb_list[i].name[0]; i++)
|
||||||
*p = 0;
|
if (stricmp(p, lb_list[i].name) == 0) {
|
||||||
|
*p = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* if last subdir equals top group, strip it */
|
/* if last subdir equals top group, strip it */
|
||||||
if (!lbs && getcfg_topgroup() && stricmp(p, getcfg_topgroup()) == 0)
|
if (!lbs && getcfg_topgroup() && stricmp(p, getcfg_topgroup()) == 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user