From 028769e00b3d3795b3ed123d604f2d1414b9cccb Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 30 Jan 2002 04:26:05 +0000 Subject: [PATCH] Added flag 'restrict edit = 0/1' SVN revision: 27 --- elogd.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/elogd.c b/elogd.c index ecc193da..9d882634 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.9 2002/01/30 04:26:05 midas + Added flag 'restrict edit = 0/1' + Revision 1.8 2002/01/29 10:06:23 midas Fixed various bugs with fixed attributes @@ -3263,6 +3266,37 @@ time_t now; } } + /* check for author */ + if (bedit && getcfg(logbook, "Restrict edit", str) && atoi(str) == 1) + { + /* search attribute which contains author */ + for (i=0 ; i%s can edit this entry"), attrib[i]); + show_error(str); + return; + } + } + if (strstr(preset, "$long_name")) + { + if (strstr(attrib[i], getparam("full_name")) == NULL) + { + sprintf(str, loc("Only user %s can edit this entry"), attrib[i]); + show_error(str); + return; + } + } + } + } + } + /* remove attributes for replies */ if (path && !bedit) {