mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Check access to logbook before executing retrieve_url()
This commit is contained in:
parent
32ba07e192
commit
15787c1ede
@ -28496,6 +28496,14 @@ void decode_post(char *logbook, LOGBOOK *lbs, const char *string, const char *bo
|
||||
|
||||
/* check for URL */
|
||||
if (stristr(file_name, "http://") || stristr(file_name, "https://")) {
|
||||
|
||||
// check for logbook access
|
||||
if (getcfg(lbs->name, "Password file", str, sizeof(str))) {
|
||||
if (!check_login(lbs, getparam("sid"))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
size = retrieve_url(lbs, file_name, stristr(file_name, "https://") != NULL, &buffer, FALSE);
|
||||
if (size <= 0) {
|
||||
strencode2(str2, file_name, sizeof(str2));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user