mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added 'restrict edit time'
SVN revision: 625
This commit is contained in:
parent
a7dfccb675
commit
0a053b8a34
@ -596,6 +596,13 @@ are set accordingly. The "Last xxx" page uses this setting directly.
|
|||||||
Number of logbook entries displayed per page in a search result. The default is 20.
|
Number of logbook entries displayed per page in a search result. The default is 20.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<li><b><code>Restrict edit time = <hours></code></b>
|
||||||
|
<br>
|
||||||
|
If this option is set, a new message can only be edited a certain number of hours
|
||||||
|
after its creation. This can be useful if one wants to ensure that old entries
|
||||||
|
cannot be modified. Hours can also be fractional, like 0.5 for 30 min.
|
||||||
|
<p>
|
||||||
|
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
<a name="attrib"><hr>
|
<a name="attrib"><hr>
|
||||||
|
|||||||
18
src/elogd.c
18
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.155 2003/11/20 13:37:20 midas
|
||||||
|
Added 'restrict edit time'
|
||||||
|
|
||||||
Revision 1.154 2003/11/19 14:11:38 midas
|
Revision 1.154 2003/11/19 14:11:38 midas
|
||||||
Added MAX_REPLY_TO
|
Added MAX_REPLY_TO
|
||||||
|
|
||||||
@ -5251,6 +5254,21 @@ char fl[8][NAME_LENGTH];
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check for editing interval */
|
||||||
|
if (bedit && getcfg(lbs->name, "Restrict edit time", str))
|
||||||
|
{
|
||||||
|
for (i = 0 ; i < *lbs->n_el_index ; i++)
|
||||||
|
if (lbs->el_index[i].message_id == message_id)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (i < *lbs->n_el_index && time(NULL) > lbs->el_index[i].file_time + atof(str)*3600)
|
||||||
|
{
|
||||||
|
sprintf(str, loc("Message can only be edited %1.2lg hours after creation"), atof(str));
|
||||||
|
show_error(str);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* remove attributes for replies */
|
/* remove attributes for replies */
|
||||||
if (breply)
|
if (breply)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user