mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Set 'ufnm' cookie with full name, needed for shift check list
SVN revision: 2417
This commit is contained in:
parent
e3258ae7cb
commit
983baa50b4
21
src/elogd.c
21
src/elogd.c
@ -8007,7 +8007,7 @@ void show_query(LOGBOOK * lbs, char *title, char *query_string, char *button1, c
|
|||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
void set_sid_cookie(LOGBOOK * lbs, char *sid)
|
void set_sid_cookie(LOGBOOK * lbs, char *sid, char *full_name)
|
||||||
{
|
{
|
||||||
char str[256], lb_name[256], exp[80];
|
char str[256], lb_name[256], exp[80];
|
||||||
BOOL global;
|
BOOL global;
|
||||||
@ -8035,9 +8035,12 @@ void set_sid_cookie(LOGBOOK * lbs, char *sid)
|
|||||||
/* check if cookies should be global */
|
/* check if cookies should be global */
|
||||||
global = getcfg("global", "Password file", str, sizeof(str));
|
global = getcfg("global", "Password file", str, sizeof(str));
|
||||||
|
|
||||||
/* set the cookie */
|
/* set the session ID cookie */
|
||||||
set_cookie(lbs, "sid", sid, global, exp);
|
set_cookie(lbs, "sid", sid, global, exp);
|
||||||
|
|
||||||
|
/* set the use full name cookie */
|
||||||
|
set_cookie(lbs, "ufnm", full_name, global, exp);
|
||||||
|
|
||||||
/* set "remember me" cookie on login */
|
/* set "remember me" cookie on login */
|
||||||
if (isparam("remember"))
|
if (isparam("remember"))
|
||||||
set_cookie(lbs, "urem", "1", global, "8760"); /* one year = 24*365 */
|
set_cookie(lbs, "urem", "1", global, "8760"); /* one year = 24*365 */
|
||||||
@ -13057,7 +13060,7 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user)
|
|||||||
setparam("redir", str);
|
setparam("redir", str);
|
||||||
|
|
||||||
/* set SID cookie */
|
/* set SID cookie */
|
||||||
set_sid_cookie(lbs, sid);
|
set_sid_cookie(lbs, sid, getparam("new_user_name"));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -26326,7 +26329,7 @@ void interprete(char *lbook, char *path)
|
|||||||
sid_new(NULL, uname, (char *) inet_ntoa(rem_addr), sid);
|
sid_new(NULL, uname, (char *) inet_ntoa(rem_addr), sid);
|
||||||
|
|
||||||
/* set SID cookie */
|
/* set SID cookie */
|
||||||
set_sid_cookie(NULL, sid);
|
set_sid_cookie(NULL, sid, getparam("uname"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26422,7 +26425,7 @@ void interprete(char *lbook, char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if user in password file */
|
/* check if user in password file */
|
||||||
if (get_user_line(lbs, uname, NULL, NULL, NULL, NULL, NULL, &inactive) == 2) {
|
if (get_user_line(lbs, uname, NULL, full_name, NULL, NULL, NULL, &inactive) == 2) {
|
||||||
/* if self registering not allowed, go back to login screen */
|
/* if self registering not allowed, go back to login screen */
|
||||||
if (!getcfg(lbs->name, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
if (!getcfg(lbs->name, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
||||||
show_login_page(lbs, str, 1);
|
show_login_page(lbs, str, 1);
|
||||||
@ -26446,7 +26449,7 @@ void interprete(char *lbook, char *path)
|
|||||||
sid_new(lbs, uname, (char *) inet_ntoa(rem_addr), sid);
|
sid_new(lbs, uname, (char *) inet_ntoa(rem_addr), sid);
|
||||||
|
|
||||||
/* set SID cookie */
|
/* set SID cookie */
|
||||||
set_sid_cookie(lbs, sid);
|
set_sid_cookie(lbs, sid, full_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26502,7 +26505,7 @@ void interprete(char *lbook, char *path)
|
|||||||
setparam("redir", str);
|
setparam("redir", str);
|
||||||
|
|
||||||
/* set SID cookie */
|
/* set SID cookie */
|
||||||
set_sid_cookie(lbs, sid);
|
set_sid_cookie(lbs, sid, uname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27110,7 +27113,7 @@ void interprete(char *lbook, char *path)
|
|||||||
write_logfile(lbs, "LOGOUT");
|
write_logfile(lbs, "LOGOUT");
|
||||||
/* set cookies */
|
/* set cookies */
|
||||||
sid_remove(getparam("sid"));
|
sid_remove(getparam("sid"));
|
||||||
set_sid_cookie(lbs, "");
|
set_sid_cookie(lbs, "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* continue configuration as administrator */
|
/* continue configuration as administrator */
|
||||||
@ -27183,7 +27186,7 @@ void interprete(char *lbook, char *path)
|
|||||||
sprintf(str, "../");
|
sprintf(str, "../");
|
||||||
setparam("redir", str);
|
setparam("redir", str);
|
||||||
}
|
}
|
||||||
set_sid_cookie(lbs, "");
|
set_sid_cookie(lbs, "", "");
|
||||||
sid_remove(getparam("sid"));
|
sid_remove(getparam("sid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user