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) {