summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJogo <Jogo@web>2009-10-10 04:22:41 -0400
committerJoey Hess <joey@kitenet.net>2009-10-10 04:22:41 -0400
commit800d165037ee9bc3362e21048ab07bdd120dcfe0 (patch)
tree632633dbf6b15850c8682778b15620cd9476bc84 /doc
parent97dd750380de2176b6f43f8bc9c27ec8122cadd3 (diff)
Diffstat (limited to 'doc')
-rw-r--r--doc/plugins/lockedit/discussion.mdwn21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn
new file mode 100644
index 000000000..b058b2b07
--- /dev/null
+++ b/doc/plugins/lockedit/discussion.mdwn
@@ -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;
+ }