mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed problem with global admin user
This commit is contained in:
parent
2f6a300572
commit
9ca611aca2
@ -25653,7 +25653,9 @@ LOGBOOK *get_first_lbs_with_global_passwd()
|
|||||||
char str[256], global[256], orig_topgroup[256];
|
char str[256], global[256], orig_topgroup[256];
|
||||||
|
|
||||||
orig_topgroup[0] = 0;
|
orig_topgroup[0] = 0;
|
||||||
getcfg("global", "Password file", global, sizeof(global));
|
if (!getcfg("global", "Password file", global, sizeof(global)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (getcfg_topgroup() && *getcfg_topgroup())
|
if (getcfg_topgroup() && *getcfg_topgroup())
|
||||||
strcpy(orig_topgroup, getcfg_topgroup());
|
strcpy(orig_topgroup, getcfg_topgroup());
|
||||||
|
|
||||||
@ -25703,6 +25705,8 @@ int get_user_line(LOGBOOK * lbs, char *user, char *password, char *full_name, ch
|
|||||||
logbook with same password file than global section */
|
logbook with same password file than global section */
|
||||||
if (lbs == NULL)
|
if (lbs == NULL)
|
||||||
lbs = get_first_lbs_with_global_passwd();
|
lbs = get_first_lbs_with_global_passwd();
|
||||||
|
if (lbs == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
getcfg(lbs->name, "Password file", str, sizeof(str));
|
getcfg(lbs->name, "Password file", str, sizeof(str));
|
||||||
|
|
||||||
@ -26099,7 +26103,7 @@ BOOL is_admin_user(LOGBOOK *lbs, char *user)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make sure user is logged in */
|
/* make sure user is logged in */
|
||||||
if (!logged_in(lbs))
|
if (lbs && !logged_in(lbs))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user