diff --git a/doc/config.html b/doc/config.html index 9499583c..9307e6db 100755 --- a/doc/config.html +++ b/doc/config.html @@ -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.

+

  • Restrict edit time = <hours> +
    +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. +

    +


    diff --git a/src/elogd.c b/src/elogd.c index 53d27d6d..85bfda6e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -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) {