diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-05-01 14:58:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-05-01 14:58:23 -0400 |
commit | 6f852e88e30775cb2238f301bb7ca1c4a83d59f4 (patch) | |
tree | 7d30c9308e9f3c1c43616e6b6011468030a84fbe /IkiWiki/Plugin | |
parent | f39659277db1865cf75d6a141e4dd6508945a2f5 (diff) | |
download | ikiwiki-6f852e88e30775cb2238f301bb7ca1c4a83d59f4.tar ikiwiki-6f852e88e30775cb2238f301bb7ca1c4a83d59f4.tar.gz |
anonk: Add anonok_pagespec configuration setting that can be used to allow anonymous users to edit only matching pages. Closes: #478892
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/anonok.pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/anonok.pm b/IkiWiki/Plugin/anonok.pm index cd05cd865..ba02325ff 100644 --- a/IkiWiki/Plugin/anonok.pm +++ b/IkiWiki/Plugin/anonok.pm @@ -10,7 +10,24 @@ sub import { #{{{ } # }}} sub canedit ($$$) { #{{{ - return ""; + my $page=shift; + my $cgi=shift; + my $session=shift; + + my $ret; + + if (length $config{anonok_pagespec}) { + if (pagespec_match($page, $config{anonok_pagespec}, + location => $page)) { + return ""; + } + else { + return undef; + } + } + else { + return ""; + } } #}}} 1 |