]> sipb.mit.edu Git - ikiwiki.git/commitdiff
(no commit message)
authorJogo <Jogo@web>
Sat, 10 Oct 2009 08:22:41 +0000 (04:22 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 10 Oct 2009 08:22:41 +0000 (04:22 -0400)
doc/plugins/lockedit/discussion.mdwn [new file with mode: 0644]

diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn
new file mode 100644 (file)
index 0000000..b058b2b
--- /dev/null
@@ -0,0 +1,21 @@
+This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose :
+
+    sub canedit ($$) {
+       my $page=shift;
+       my $cgi=shift;
+       my $session=shift;
+    
+       my $user=$session->param("name");
+       return undef if defined $user && IkiWiki::is_admin($user);
+    
+       if (defined $config{locked_pages} && length $config{locked_pages} &&
+           pagespec_match($page, $config{locked_pages},
+                   user => $session->param("name"),
+                   ip => $ENV{REMOTE_ADDR},
+           )) {
+               return sprintf(gettext("%s is locked and cannot be edited"),
+                       htmllink("", "", $page, noimageinline => 1));
+       }
+    
+       return undef;
+    }