wiki.pl: Port some fixes from upstream
[Orgmuse.git] / modules / delete-all.pl
blobbb1f189faf8181b86f44135153a4d3340f975261
1 # Copyright (C) 2006-2013 Alex Schroeder <alex@gnu.org>
3 # This program is free software: you can redistribute it and/or modify it under
4 # the terms of the GNU General Public License as published by the Free Software
5 # Foundation, either version 3 of the License, or (at your option) any later
6 # version.
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License along with
13 # this program. If not, see <http://www.gnu.org/licenses/>.
15 $ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/delete-all.pl">delete-all.pl</a></p>';
17 use vars qw($DeletedAge);
19 $DeleteAge = 172800; # 2*24*60*60
21 *OldDelPageDeletable = *PageDeletable;
22 *PageDeletable = *NewDelPageDeletable;
24 # All pages will be deleted after two days of inactivity!
25 sub NewDelPageDeletable {
26 return 1 if $Now - $Page{ts} > $DeleteAge
27 and not $LockOnCreation{$OpenPageName};
28 return OldDelPageDeletable(@_);