]> sipb.mit.edu Git - ikiwiki.git/commitdiff
anonk: Add anonok_pagespec configuration setting that can be used to allow anonymous...
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 1 May 2008 18:58:23 +0000 (14:58 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 1 May 2008 18:58:23 +0000 (14:58 -0400)
IkiWiki/Plugin/anonok.pm
debian/changelog
doc/ikiwiki.setup
doc/plugins/anonok.mdwn

index cd05cd865f9029e76aa571d35b47c30a2d51de1b..ba02325ff7e1b8a8089797952623c9e4f4cd77b0 100644 (file)
@@ -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
index b7daeec27ca8d48bd0936eb3d6ba68bc23e6f9b1..1d06b4f5deda33d3151bf9ede7f14df030b0ab7c 100644 (file)
@@ -8,6 +8,8 @@ ikiwiki (2.45) UNRELEASED; urgency=low
   * Add missing de.po. Closes: #471540
   * img: Support a title attribute, will be passed through to html.
     Closes: #478718
+  * anonk: Add anonok_pagespec configuration setting that can be used to
+    allow anonymous users to edit only matching pages. Closes: #478892
 
  -- Joey Hess <joeyh@debian.org>  Sat, 26 Apr 2008 15:09:36 -0400
 
index 885f77813b8865ab8b32fed7c1cfe306639044a2..cbc4cbc9fd9943ebc056c7950a44b39dba61e3e2 100644 (file)
@@ -159,4 +159,8 @@ use IkiWiki::Setup::Standard {
        #       mirror1 => "http://hostname1",
        #       mirror2 => "http://hostname2/mirror",
        #},
+       
+       # For use with the anonok plugin, a PageSpec specifying what
+       # pages anonymous users can edit
+       #anonok_pagespec => "*",
 }
index 8afcf86f579b2119e33c537a28a31008cfce74c8..2afde29b3b43c3286f89cb42269d92d4fe058bd3 100644 (file)
@@ -2,4 +2,8 @@
 [[tag type/auth]]
 
 By default, anonymous users cannot edit the wiki. This plugin allows
-anonymous web users, who have not signed in, to edit any page in the wiki.
+anonymous web users, who have not signed in, to edit any page in the wiki
+by default.
+
+The plugin also has a configuration setting, `anonok_pagespec`. This
+[[PageSpec]] can be used to allow anonymous editing of matching pages.