mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added flag 'restrict edit = 0/1'
SVN revision: 27
This commit is contained in:
parent
386ea06b6c
commit
028769e00b
34
elogd.c
34
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.9 2002/01/30 04:26:05 midas
|
||||||
|
Added flag 'restrict edit = 0/1'
|
||||||
|
|
||||||
Revision 1.8 2002/01/29 10:06:23 midas
|
Revision 1.8 2002/01/29 10:06:23 midas
|
||||||
Fixed various bugs with fixed attributes
|
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<n_attr ; i++)
|
||||||
|
{
|
||||||
|
sprintf(str, "Preset %s", attr_list[i]);
|
||||||
|
if (getcfg(logbook, str, preset))
|
||||||
|
{
|
||||||
|
if (strstr(preset, "$short_name"))
|
||||||
|
{
|
||||||
|
if (strstr(attrib[i], getparam("unm")) == NULL)
|
||||||
|
{
|
||||||
|
sprintf(str, loc("Only user <i>%s</i> 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 <i>%s</i> can edit this entry"), attrib[i]);
|
||||||
|
show_error(str);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* remove attributes for replies */
|
/* remove attributes for replies */
|
||||||
if (path && !bedit)
|
if (path && !bedit)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user