mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fix PAM overriding self registration settings.
This commit is contained in:
parent
e9d3b82ddb
commit
55798d4fa2
20
src/elogd.c
20
src/elogd.c
@ -27500,6 +27500,11 @@ void interprete(char *lbook, char *path)
|
|||||||
|
|
||||||
/* check if user in password file */
|
/* check if user in password file */
|
||||||
if (get_user_line(NULL, uname, NULL, full_name, NULL, NULL, NULL, NULL) == 2) {
|
if (get_user_line(NULL, uname, NULL, full_name, NULL, NULL, NULL, NULL) == 2) {
|
||||||
|
/* if self registering not allowed, go back to login screen */
|
||||||
|
if (!getcfg(group, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
||||||
|
show_login_page(NULL, str, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_PAM
|
||||||
/* show new user page if username is not in password file */
|
/* show new user page if username is not in password file */
|
||||||
getcfg(NULL, "Authentication", str, sizeof(str));
|
getcfg(NULL, "Authentication", str, sizeof(str));
|
||||||
@ -27508,11 +27513,6 @@ void interprete(char *lbook, char *path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_PAM */
|
#endif /* HAVE_PAM */
|
||||||
/* if self registering not allowed, go back to login screen */
|
|
||||||
if (!getcfg(group, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
|
||||||
show_login_page(NULL, str, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put encoded password into password file */
|
/* put encoded password into password file */
|
||||||
@ -27645,6 +27645,11 @@ 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, full_name, 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 (!getcfg(lbs->name, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
||||||
|
show_login_page(lbs, str, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_PAM
|
||||||
/* show new user page if username is not in password file */
|
/* show new user page if username is not in password file */
|
||||||
getcfg(lbs->name, "Authentication", str, sizeof(str));
|
getcfg(lbs->name, "Authentication", str, sizeof(str));
|
||||||
@ -27653,11 +27658,6 @@ void interprete(char *lbook, char *path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_PAM */
|
#endif /* HAVE_PAM */
|
||||||
/* if self registering not allowed, go back to login screen */
|
|
||||||
if (!getcfg(lbs->name, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
|
||||||
show_login_page(lbs, str, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* show error for inactive account */
|
/* show error for inactive account */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user