From 36400bf8c835370df1c3414f4458e14c2433e15c Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 14 Mar 2012 13:31:05 +0000 Subject: [PATCH] Added "login user" check (needed for global password files) SVN revision: 2439 --- src/elogd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/elogd.c b/src/elogd.c index 1715b5bf..ce157e6a 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -19562,6 +19562,12 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa xfree(list); return; } + + /*---- if user present but not allowed, remove it (required when several logbooks are + used with different access rights and global passwords ----*/ + if (isparam("unm") && !check_login_user(lbs, getparam("unm"))) { + unsetparam("unm"); + } /*---- apply last login cut ----*/ @@ -26466,6 +26472,12 @@ void interprete(char *lbook, char *path) return; } + /* check if user has access to logbook */ + if (!check_login_user(lbs, getparam("uname"))) { + show_error("Use has no access to this logbook"); + return; + } + /* put encoded password into password file */ set_user_password(lbs, uname, getparam("upassword"));