]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/lockedit/discussion.mdwn
git: --getctime will now follow renames back to the original creation of a file.
[ikiwiki.git] / doc / plugins / lockedit / discussion.mdwn
1 This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose :
2
3     sub canedit ($$) {
4         my $page=shift;
5         my $cgi=shift;
6         my $session=shift;
7     
8         my $user=$session->param("name");
9         return undef if defined $user && IkiWiki::is_admin($user);
10     
11         if (defined $config{locked_pages} && length $config{locked_pages} &&
12             pagespec_match($page, $config{locked_pages},
13                     user => $session->param("name"),
14                     ip => $ENV{REMOTE_ADDR},
15             )) {
16                 return sprintf(gettext("%s is locked and cannot be edited"),
17                         htmllink("", "", $page, noimageinline => 1));
18         }
19     
20         return undef;
21     }