Fixed problem when using webserver authentication and changing user, thanks to F.H.

This commit is contained in:
2024-02-23 15:13:17 +01:00
parent 715d9b39b7
commit 838ac0185f
+7 -1
View File
@@ -27418,7 +27418,13 @@ void interprete(char *lbook, const char *path)
getcfg(lbs->name, "Authentication", str, sizeof(str));
if (stristr(str, "Webserver")) {
if (http_user[0]) {
if (!sid_check(getparam("sid"), http_user)) { /* if we don't have a sid yet, set it */
char user[256];
bool flag = sid_check(getparam("sid"), user);
if (flag && strcmp(http_user , user) != 0) { /* user changed */
sid_remove(getparam("sid"));
flag=FALSE;
}
if (!flag) { /* if we don't have a sid yet, set it */
/* get a new session ID */
sid_new(lbs, http_user, (char *) inet_ntoa(rem_addr), sid);
/* set SID cookie */