]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/anonok.pm
anonk: Add anonok_pagespec configuration setting that can be used to allow anonymous...
[ikiwiki.git] / IkiWiki / Plugin / anonok.pm
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