mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Show new user page if user is not in password file.
This commit is contained in:
parent
c2133ddffd
commit
e20fd652ef
12
src/elogd.c
12
src/elogd.c
@ -27479,6 +27479,12 @@ 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) {
|
||||||
|
/* show new user page if username is not in password file */
|
||||||
|
getcfg(NULL, "Authentication", str, sizeof(str));
|
||||||
|
if (stristr(str, "PAM")) {
|
||||||
|
show_new_user_page(NULL, uname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* if self registering not allowed, go back to login screen */
|
/* if self registering not allowed, go back to login screen */
|
||||||
if (!getcfg(group, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
if (!getcfg(group, "Self register", str, sizeof(str)) || atoi(str) == 0) {
|
||||||
show_login_page(NULL, str, 1);
|
show_login_page(NULL, str, 1);
|
||||||
@ -27616,6 +27622,12 @@ 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) {
|
||||||
|
/* show new user page if username is not in password file */
|
||||||
|
getcfg(lbs->name, "Authentication", str, sizeof(str));
|
||||||
|
if (stristr(str, "PAM")) {
|
||||||
|
show_new_user_page(lbs, uname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* 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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user