mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Applied patch form JJK to fix user creation under Webserver authentication
This commit is contained in:
parent
cb3afcd826
commit
1ebfd06cf5
@ -13273,7 +13273,7 @@ int save_user_config(LOGBOOK *lbs, char *user, BOOL new_user) {
|
|||||||
|
|
||||||
/* if we outsourced the authentication, use external username */
|
/* if we outsourced the authentication, use external username */
|
||||||
getcfg(lbs->name, "Authentication", str, sizeof(str));
|
getcfg(lbs->name, "Authentication", str, sizeof(str));
|
||||||
if (stristr(str, "Webserver")) {
|
if (!is_admin_user(lbs, http_user) && stristr(str, "Webserver")) {
|
||||||
/* do not allow HTML in user name */
|
/* do not allow HTML in user name */
|
||||||
strencode2(user_enc, http_user, sizeof(user_enc));
|
strencode2(user_enc, http_user, sizeof(user_enc));
|
||||||
} else {
|
} else {
|
||||||
@ -26139,6 +26139,8 @@ BOOL is_admin_user(LOGBOOK *lbs, char *user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make sure user is logged in */
|
/* make sure user is logged in */
|
||||||
|
if (strcmp(user, http_user) == 0)
|
||||||
|
return TRUE;
|
||||||
if (lbs && !logged_in(lbs))
|
if (lbs && !logged_in(lbs))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user