mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added option 'Login user'
SVN revision: 461
This commit is contained in:
parent
01789e9387
commit
0e377d146c
@ -828,6 +828,7 @@ only. When the browser is restarted, the password must be re-entered.<P>
|
|||||||
<LI><b><code>Password file = <file></code></b>
|
<LI><b><code>Password file = <file></code></b>
|
||||||
<LI><b><code>Login expiration = <hours></code></b>
|
<LI><b><code>Login expiration = <hours></code></b>
|
||||||
<LI><b><code>Admin user = <user list></code></b>
|
<LI><b><code>Admin user = <user list></code></b>
|
||||||
|
<LI><b><code>Login user = <user list></code></b>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
An alternative to the read/write/admin passwords is the user level access with a
|
An alternative to the read/write/admin passwords is the user level access with a
|
||||||
@ -880,7 +881,20 @@ for example, makes the password expire after one day.<p>
|
|||||||
The <b><code>Admin user = <user list></b></code> is a list of one or more user names,
|
The <b><code>Admin user = <user list></b></code> is a list of one or more user names,
|
||||||
which have admin rights. The can execute the <b><code>Admin</code></b> command to directly
|
which have admin rights. The can execute the <b><code>Admin</code></b> command to directly
|
||||||
edit elogd.cfg through the web and modify other users via the <b><code>Config</code></b>
|
edit elogd.cfg through the web and modify other users via the <b><code>Config</code></b>
|
||||||
command.
|
command.<p>
|
||||||
|
|
||||||
|
The <b><code>Login user = <user list></b></code> is a list of users who can
|
||||||
|
log in to a specific logbook. This option can be used with a global password file. If a
|
||||||
|
<b><code>Password file</code></b> is present under the <b><code>[global]</b></code>
|
||||||
|
section, the registered users in that password file can log in to all logbooks. It might
|
||||||
|
be required that only certain users can log in to certain logbooks. This can be achieved
|
||||||
|
with the <b><code>Login user</code></b> option, places in each individual logbook
|
||||||
|
section in the configuration file. Only those users listed in this statement can log in
|
||||||
|
to the logbook where the statement is defined. This method has the advantage over the
|
||||||
|
option of definining individual password files for individual logbooks that only one
|
||||||
|
central password file exists. So if a user changes her/his password, this becomes then
|
||||||
|
valid for all logbooks. If there would be individual logbook password files, one would
|
||||||
|
have to change the password in all logbooks individually.<p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<LI><b><code>Self register = 0|1|2|3</code></b>
|
<LI><b><code>Self register = 0|1|2|3</code></b>
|
||||||
|
|||||||
19
src/elogd.c
19
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.60 2003/03/31 08:52:13 midas
|
||||||
|
Added option 'Login user'
|
||||||
|
|
||||||
Revision 1.59 2003/03/28 10:21:31 midas
|
Revision 1.59 2003/03/28 10:21:31 midas
|
||||||
Use 'Icon comment' in filter display
|
Use 'Icon comment' in filter display
|
||||||
|
|
||||||
@ -10512,13 +10515,27 @@ int i;
|
|||||||
|
|
||||||
BOOL check_user_password(LOGBOOK *lbs, char *user, char *password, char *redir)
|
BOOL check_user_password(LOGBOOK *lbs, char *user, char *password, char *redir)
|
||||||
{
|
{
|
||||||
char status, str[256], upwd[256], full_name[256], email[256];
|
char status, str[1000], upwd[256], full_name[256], email[256];
|
||||||
|
char list[MAX_N_LIST][NAME_LENGTH];
|
||||||
|
int i, n;
|
||||||
|
|
||||||
if (lbs == NULL)
|
if (lbs == NULL)
|
||||||
status = get_user_line("global", user, upwd, full_name, email, NULL);
|
status = get_user_line("global", user, upwd, full_name, email, NULL);
|
||||||
else
|
else
|
||||||
status = get_user_line(lbs->name, user, upwd, full_name, email, NULL);
|
status = get_user_line(lbs->name, user, upwd, full_name, email, NULL);
|
||||||
|
|
||||||
|
if (getcfg(lbs->name, "Login user", str) && user[0])
|
||||||
|
{
|
||||||
|
n = strbreak(str, list, MAX_N_LIST);
|
||||||
|
for (i=0 ; i<n ; i++)
|
||||||
|
if (strcmp(user, list[i]) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* invalid user if name not in list */
|
||||||
|
if (i == n)
|
||||||
|
status = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (status == 1)
|
if (status == 1)
|
||||||
{
|
{
|
||||||
if (user[0] && strcmp(password, upwd) == 0)
|
if (user[0] && strcmp(password, upwd) == 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user