Added 'restrict edit time'

SVN revision: 625
This commit is contained in:
2003-11-20 13:37:20 +00:00
parent a7dfccb675
commit 0a053b8a34
2 changed files with 25 additions and 0 deletions
+7
View File
@@ -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.
<p>
<li><b><code>Restrict edit time = &lt;hours&gt;</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>
<a name="attrib"><hr>
+18
View File
@@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$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
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 */
if (breply)
{